From af2d4037ce60f97e25c8b636d8dc44005aadaa36 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 18 Jun 2026 13:21:02 -0400 Subject: [PATCH] fix(m9/T31): Monaco dispose editor-before-model; preserve other jsonDefaults diagnostics --- .../wwwroot/js/monaco-init.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/monaco-init.js b/src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/monaco-init.js index 695a2b3b..99564951 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/monaco-init.js +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/monaco-init.js @@ -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]; }