mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 14:42:28 +01:00
build fix for duplicate autocomplete
This commit is contained in:
parent
01d15176ac
commit
06df10d2f9
28
dist/vendor.bundle.js
vendored
28
dist/vendor.bundle.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -29,8 +29,8 @@ import Box from "@mui/material/Box";
|
|||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import SettingsIcon from "@mui/icons-material/Settings";
|
import SettingsIcon from "@mui/icons-material/Settings";
|
||||||
import { loadThemes } from "./themes";
|
|
||||||
|
|
||||||
|
let symbolsLoaded = false;
|
||||||
let symbols: string[] = [];
|
let symbols: string[] = [];
|
||||||
export function SetupTextEditor(): void {
|
export function SetupTextEditor(): void {
|
||||||
const ns = NetscriptFunctions({} as WorkerScript);
|
const ns = NetscriptFunctions({} as WorkerScript);
|
||||||
@ -276,6 +276,8 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function beforeMount(monaco: any): void {
|
function beforeMount(monaco: any): void {
|
||||||
|
if (symbolsLoaded) return;
|
||||||
|
symbolsLoaded = true;
|
||||||
monaco.languages.registerCompletionItemProvider("javascript", {
|
monaco.languages.registerCompletionItemProvider("javascript", {
|
||||||
provideCompletionItems: () => {
|
provideCompletionItems: () => {
|
||||||
const suggestions = [];
|
const suggestions = [];
|
||||||
@ -292,7 +294,6 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
});
|
});
|
||||||
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
||||||
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
||||||
loadThemes(monaco);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -317,7 +318,7 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
onMount={onMount}
|
onMount={onMount}
|
||||||
loading={<Typography>Loading script editor!</Typography>}
|
loading={<Typography>Loading script editor!</Typography>}
|
||||||
height="90%"
|
height="90%"
|
||||||
language="javascript"
|
defaultLanguage="javascript"
|
||||||
defaultValue={code}
|
defaultValue={code}
|
||||||
onChange={updateCode}
|
onChange={updateCode}
|
||||||
theme={options.theme}
|
theme={options.theme}
|
||||||
|
Loading…
Reference in New Issue
Block a user