mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
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:
@@ -26,7 +26,7 @@ function makeModel(hostname: string, filename: string, code: string) {
|
||||
scheme: "file",
|
||||
path: `${hostname}/${filename}`,
|
||||
});
|
||||
const language = filename.endsWith(".txt") ? "plaintext" : "javascript";
|
||||
const language = filename.endsWith(".txt") ? "plaintext" : filename.endsWith(".json") ? "json" : "javascript";
|
||||
//if somehow a model already exist return it
|
||||
return editor.getModel(uri) ?? editor.createModel(code, language, uri);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user