mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Trigger an event when the extra libs changed, redoing all colorization and diagnostics
This commit is contained in:
parent
e39fa719bc
commit
357f54c652
2 changed files with 12 additions and 3 deletions
|
|
@ -134,14 +134,15 @@ export class DiagnostcsAdapter extends Adapter {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
this._disposables.push(this._defaults.onDidChange(() => {
|
||||
let redoDiagosticsCallback = () => {
|
||||
// redo diagnostics when options change
|
||||
for (const model of monaco.editor.getModels()) {
|
||||
onModelRemoved(model);
|
||||
onModelAdd(model);
|
||||
}
|
||||
}));
|
||||
};
|
||||
this._disposables.push(this._defaults.onDidChange(redoDiagosticsCallback));
|
||||
this._disposables.push(this._defaults.onDidExtraLibsChange(redoDiagosticsCallback));
|
||||
|
||||
monaco.editor.getModels().forEach(onModelAdd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue