mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
commit
b6157e6851
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -313,12 +313,18 @@ export function Root(props: IProps): React.ReactElement {
|
||||
},
|
||||
});
|
||||
(async function () {
|
||||
// We have to improve the default js language otherwise theme sucks
|
||||
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" }]);
|
||||
const otherKeywords = ["let", "const", "var", "function"];
|
||||
const otherKeyvars = ["true", "false", "null", "undefined"];
|
||||
otherKeywords.forEach((k) => l.language.tokenizer.root.unshift([k, { token: "otherkeywords" }]));
|
||||
otherKeyvars.forEach((k) => l.language.tokenizer.root.unshift([k, { token: "otherkeyvars" }]));
|
||||
l.language.tokenizer.root.unshift(["this", { token: "this" }]);
|
||||
console.log(l);
|
||||
})();
|
||||
|
||||
|
@ -19,6 +19,10 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
token: "number",
|
||||
foreground: "ae81ff",
|
||||
},
|
||||
{
|
||||
token: "otherkeyvars",
|
||||
foreground: "ae81ff",
|
||||
},
|
||||
{
|
||||
foreground: "ae81ff",
|
||||
token: "function",
|
||||
@ -39,10 +43,14 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
token: "netscriptfunction",
|
||||
foreground: "53d3e4",
|
||||
},
|
||||
// {
|
||||
// foreground: "ae81ff",
|
||||
// token: "entity.name.function",
|
||||
// },
|
||||
{
|
||||
token: "otherkeywords",
|
||||
foreground: "53d3e4",
|
||||
},
|
||||
{
|
||||
token: "this",
|
||||
foreground: "fd971f",
|
||||
},
|
||||
],
|
||||
colors: {
|
||||
"editor.foreground": "#F8F8F2",
|
||||
|
Loading…
Reference in New Issue
Block a user