mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23: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 () {
|
(async function () {
|
||||||
|
// We have to improve the default js language otherwise theme sucks
|
||||||
const l = await monaco.languages
|
const l = await monaco.languages
|
||||||
.getLanguages()
|
.getLanguages()
|
||||||
.find((l: any) => l.id === "javascript")
|
.find((l: any) => l.id === "javascript")
|
||||||
.loader();
|
.loader();
|
||||||
l.language.tokenizer.root.unshift(["ns", { token: "ns" }]);
|
l.language.tokenizer.root.unshift(["ns", { token: "ns" }]);
|
||||||
for (const symbol of symbols) l.language.tokenizer.root.unshift(["\\." + symbol, { token: "netscriptfunction" }]);
|
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);
|
console.log(l);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
|||||||
token: "number",
|
token: "number",
|
||||||
foreground: "ae81ff",
|
foreground: "ae81ff",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
token: "otherkeyvars",
|
||||||
|
foreground: "ae81ff",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
foreground: "ae81ff",
|
foreground: "ae81ff",
|
||||||
token: "function",
|
token: "function",
|
||||||
@ -39,10 +43,14 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
|||||||
token: "netscriptfunction",
|
token: "netscriptfunction",
|
||||||
foreground: "53d3e4",
|
foreground: "53d3e4",
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// foreground: "ae81ff",
|
token: "otherkeywords",
|
||||||
// token: "entity.name.function",
|
foreground: "53d3e4",
|
||||||
// },
|
},
|
||||||
|
{
|
||||||
|
token: "this",
|
||||||
|
foreground: "fd971f",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
colors: {
|
colors: {
|
||||||
"editor.foreground": "#F8F8F2",
|
"editor.foreground": "#F8F8F2",
|
||||||
|
Loading…
Reference in New Issue
Block a user