fix(m9/T31): Monaco dispose editor-before-model; preserve other jsonDefaults diagnostics

This commit is contained in:
Joseph Doherty
2026-06-18 13:21:02 -04:00
parent 45ad36c115
commit af2d4037ce
@@ -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];
}