allow json (#1137)

Allow creating .json files.
Also added the json language server so syntax highlighting and validation works with the ingame editor
This commit is contained in:
Shy
2024-03-07 00:52:32 +01:00
committed by GitHub
parent 863ac2c8c0
commit d2dd6916b1
5 changed files with 11 additions and 4 deletions
+6
View File
@@ -60,6 +60,12 @@ export class ScriptEditor {
const source = (libSource + "").replace(/export /g, "");
monaco.languages.typescript.javascriptDefaults.addExtraLib(source, "netscript.d.ts");
monaco.languages.typescript.typescriptDefaults.addExtraLib(source, "netscript.d.ts");
monaco.languages.json.jsonDefaults.setModeConfiguration({
...monaco.languages.json.jsonDefaults.modeConfiguration,
//completion should be disabled because the
//json language server tries to load a schema by default
completionItems: false,
});
// Load themes
loadThemes(monaco.editor.defineTheme);
sanitizeTheme(Settings.EditorTheme);