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]; }