Skip to content

Commit

Permalink
add brand new ckdoc (output.json) for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
terryzfeng committed Jun 23, 2024
1 parent a4a7e64 commit ef93084
Show file tree
Hide file tree
Showing 2 changed files with 3,829 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/monaco/chuck-lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import { monaco } from "./monacoLite";
import { chuck_modules, chuck_libraries } from "./chuck-modules";
import ckdocJSON from "./ckdoc.json";
import ckdocJSON from "./output.json";

// Documentation Type for ckdoc
interface docType {
title: string;
description: string[];
method: string[];
example: string[];
description: string;
functions: string[];
examples: string[];
link: string;
}
const ckdoc: { [key: string]: docType } = ckdocJSON;
Expand Down Expand Up @@ -343,7 +343,8 @@ monaco.languages.registerHoverProvider("chuck", {
const token: string = word?.word;

// If we have a hover for that word
if (chuck_modules.includes(token)) {
// if (chuck_modules.includes(token)) {
if (ckdoc[token]) {
const word_doc: docType = ckdoc[token];
return {
// Where to show the hover
Expand All @@ -359,13 +360,14 @@ monaco.languages.registerHoverProvider("chuck", {
value: word_doc.title,
},
{
value: word_doc.description.join("\n\n"),
value: word_doc.description,
},
{
value: word_doc.method.join("\n\n"),
supportHtml: true,
value: word_doc.functions.join("\n\n"),
},
{
value: word_doc.example.join("\n\n"),
value: word_doc.examples.join("\n\n"),
},
{
value: word_doc.link,
Expand Down
Loading

0 comments on commit ef93084

Please sign in to comment.