-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
Description
monaco-editor version: 0.20.0
Browser: Chrome
OS: Windows
Playground code that reproduces the issue:
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
target: monaco.languages.typescript.ScriptTarget.ES2016,
allowNonTsExtensions: true,
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
module: monaco.languages.typescript.ModuleKind.CommonJS,
noEmit: true,
typeRoots: ["node_modules/@types"]
});
for (let i = 0; i < 500; i++) {
monaco.languages.typescript.typescriptDefaults.addExtraLib(
`export declare function next${i}() : string`,
`file:///node_modules/@types/external${i}/index.d.ts`
)
monaco.editor.createModel(`export declare function next${i}() : string`, "typescript", monaco.Uri.file(`/node_modules/@types/external${i}/index.d.ts`));
}
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
noSemanticValidation: false,
noSyntaxValidation: false
})
var jsCode = `import * as x from "external1"
const tt : string = x.next1();`;
monaco.editor.create(document.getElementById("container"), {
model: monaco.editor.createModel(jsCode, "typescript", monaco.Uri.file("main.tsx")),
});In the above sample, I can try to add 500 models to the editor. Normally, in small numbers, adding models isn't in issue, however, when adding more than about 100, I end up with "Loading..." when trying to hover over a function or import for about a minute or two.