fix(m9/T31): Monaco dispose editor-before-model; preserve other jsonDefaults diagnostics
This commit is contained in:
@@ -314,6 +314,7 @@
|
||||
}
|
||||
}
|
||||
defaults.setDiagnosticsOptions({
|
||||
...defaults.diagnosticsOptions,
|
||||
validate: true,
|
||||
enableSchemaRequest: false,
|
||||
schemas: schemas
|
||||
@@ -437,12 +438,14 @@
|
||||
// a disposed json editor leaves nothing behind in the global defaults.
|
||||
if (entry.isJson) {
|
||||
try { applyJsonSchema(id, null); } catch (e) {}
|
||||
}
|
||||
try { entry.editor.dispose(); } catch (e) {}
|
||||
if (entry.isJson) {
|
||||
try {
|
||||
const model = monaco.editor.getModel(modelUriFor(id));
|
||||
if (model) model.dispose();
|
||||
} catch (e) {}
|
||||
}
|
||||
try { entry.editor.dispose(); } catch (e) {}
|
||||
delete editors[id];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user