mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 10:25:42 +01:00
raise onDidChange only when needed
This commit is contained in:
parent
c6c45135c2
commit
e556e53389
1 changed files with 8 additions and 2 deletions
|
|
@ -79,11 +79,17 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript.
|
|||
return {
|
||||
dispose: () => {
|
||||
if (paths.length > 0) {
|
||||
let changed = false;
|
||||
|
||||
paths.forEach(filePath => {
|
||||
delete this._extraLibs[filePath];
|
||||
if (delete this._extraLibs[filePath]) {
|
||||
changed = true;
|
||||
}
|
||||
});
|
||||
|
||||
this._onDidChange.fire(this);
|
||||
if (changed) {
|
||||
this._onDidChange.fire(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue