Playground highlights and shows info/errors from build

This commit is contained in:
2024-11-05 13:44:16 -08:00
parent f92d287909
commit 182876d16b
15 changed files with 305 additions and 145 deletions

View File

@@ -1,8 +1,59 @@
import * as monaco from 'monaco-editor'
import * as monaco from "monaco-editor";
export let newtLanguage: monaco.languages.IMonarchLanguage = {
export let newtConfig: monaco.languages.LanguageConfiguration = {
comments: {
// symbol used for single line comment. Remove this entry if your language does not support line comments
lineComment: "--",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
blockComment: ["/-", "-/"],
},
// symbols used as brackets
brackets: [
["{", "}"],
["[", "]"],
["(", ")"],
],
// symbols that are auto closed when typing
autoClosingPairs: [
{ open: "{", close: "}" },
{ open: "[", close: "]" },
{ open: "(", close: ")" },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
],
// symbols that can be used to surround a selection
surroundingPairs: [
{ open: "{", close: "}" },
{ open: "[", close: "]" },
{ open: "(", close: ")" },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
],
onEnterRules: [
{
beforeText: /^\s+$/,
action: {
indentAction: monaco.languages.IndentAction.Outdent,
},
},
{
beforeText: /\bwhere$/,
action: {
indentAction: monaco.languages.IndentAction.Indent,
},
},
{
beforeText: /\bof$/,
action: {
indentAction: monaco.languages.IndentAction.Indent,
},
},
],
};
export let newtTokens: monaco.languages.IMonarchLanguage = {
// Set defaultToken to invalid to see what you do not tokenize yet
// defaultToken: 'invalid',
defaultToken: "invalid",
keywords: [
"let",