mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
improve monokai by making the language a superset of javascript
This commit is contained in:
parent
b5a8ed1d9d
commit
80d197652d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -55,7 +55,7 @@ export function SetupTextEditor(): void {
|
||||
symbols = populate(ns);
|
||||
|
||||
const exclude = ["heart", "break", "exploit", "bypass", "corporation"];
|
||||
symbols = symbols.filter((symbol: string) => !exclude.includes(symbol));
|
||||
symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort();
|
||||
}
|
||||
|
||||
interface IProps {
|
||||
@ -311,6 +311,16 @@ export function Root(props: IProps): React.ReactElement {
|
||||
return { suggestions: suggestions };
|
||||
},
|
||||
});
|
||||
(async function () {
|
||||
const l = await monaco.languages
|
||||
.getLanguages()
|
||||
.find((l: any) => l.id === "javascript")
|
||||
.loader();
|
||||
l.language.tokenizer.root.unshift(["ns", { token: "ns" }]);
|
||||
for (const symbol of symbols) l.language.tokenizer.root.unshift(["\\." + symbol, { token: "netscriptfunction" }]);
|
||||
console.log(l);
|
||||
})();
|
||||
|
||||
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
||||
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
||||
loadThemes(monaco);
|
||||
|
@ -31,7 +31,14 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
token: "storage.type.function.js",
|
||||
foreground: "ae81ff",
|
||||
},
|
||||
|
||||
{
|
||||
token: "ns",
|
||||
foreground: "97d92b",
|
||||
},
|
||||
{
|
||||
token: "netscriptfunction",
|
||||
foreground: "53d3e4",
|
||||
},
|
||||
// {
|
||||
// foreground: "ae81ff",
|
||||
// token: "entity.name.function",
|
||||
|
@ -239,7 +239,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
|
||||
SuppressMessages: defaultSettings.SuppressMessages,
|
||||
SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,
|
||||
SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup,
|
||||
MonacoTheme: "vs-dark",
|
||||
MonacoTheme: "monokai",
|
||||
MonacoInsertSpaces: false,
|
||||
MonacoFontSize: 20,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user