[Bug] Updating extra lib not working after dispose in 0.34.0 and 0.39.0 version. It is working fine in lower version 0.26.0 #4020
Replies: 3 comments 1 reply
-
Are you using JavaScript as the model language? We have the use case where we add libraries on editor open and remove them again on editor close, depending on which editor is opened, and it works fine with 0.39.0. However, in the case of Edit: I clarified what is actually necessary and adjusted the playground link correspondingly. var library = "declare class Test { description:string; } ";
// if editor language is JavaScript register the d.ts file on the javascriptDefaults object
let testDisposable2 = monaco.languages.typescript.javascriptDefaults.addExtraLib(library, monaco.Uri.file("test.d.ts").toString()); |
Beta Was this translation helpful? Give feedback.
-
No, we are using typeScript as model language. I checked with javascript and it is working fine, Issue is only with typescript. |
Beta Was this translation helpful? Give feedback.
-
Please create a new issue with link to a playground example, so we can reproduce. Also, please use the bisect feature in the playground to figure out in which version it broke. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Link
We have requirement where we add library at runtime and dispose the lib. But it is not working properly, I checked in the latest version and lower version but in lower version 0.26.0 it is working but in latest versions 0.39.0 it is not working.
Steps to reproduce the issue.
Add extra lib in monaco editor using below method.
var library = "declare class Test { description:string; } ";
let testDisposable = this.monaco.languages.typescript.typescriptDefaults.addExtraLib(library, test.d.ts);
Dispose the lib
testDisposable.dispose();
Change the variable Name of description to description123 and add again using extra lib function.
var library = "declare class Test { description123:string; } ";
let testDisposable = this.monaco.languages.typescript.typescriptDefaults.addExtraLib(library, test.d.ts);
first time it will dispose the lib and add the new changed lib but second time it will stop the disposing previous library. and will not show the intelligence for changed Test class
Monaco Editor Playground Code
Reproduction Steps
Steps to reproduce the issue.
Add extra lib in monaco editor using below method.
var library = "declare class Test { description:string; } ";
let testDisposable = this.monaco.languages.typescript.typescriptDefaults.addExtraLib(library, test.d.ts);
Dispose the lib
testDisposable.dispose();
Change the variable Name of description to description123 and add again using extra lib function.
var library = "declare class Test { description123:string; } ";
let testDisposable = this.monaco.languages.typescript.typescriptDefaults.addExtraLib(library, test.d.ts);
first time it will dispose the lib and add the new changed lib but second time it will stop the disposing previous library. and will not show the intelligence for changed Test class
Actual (Problematic) Behavior
If we dispose the library and add again with changes, first time it will work but from the second time it is not working.
Expected Behavior
it should dispose the previous library and add changed library and also should show the intelligence for change library even if we repeat the steps multiple times.
Additional Context
We have requirement where we add library at runtime and dispose the lib. But it is not working properly, I checked in the latest version and lower version but in lower version 0.26.0 it is working but in latest versions 0.39.0 it is not working.
Steps to reproduce the issue.
Add extra lib in monaco editor using below method.
var library = "declare class Test { description:string; } ";
let testDisposable = this.monaco.languages.typescript.typescriptDefaults.addExtraLib(library, test.d.ts);
Dispose the lib
testDisposable.dispose();
Change the variable Name of description to description123 and add again using extra lib function.
var library = "declare class Test { description123:string; } ";
let testDisposable = this.monaco.languages.typescript.typescriptDefaults.addExtraLib(library, test.d.ts);
first time it will dispose the lib and add the new changed lib but second time it will stop the disposing previous library. and will not show the intelligence for changed Test class
Beta Was this translation helpful? Give feedback.
All reactions