When I switch the editor's language and values, the previous language error markers stick around. Fixes Microsoft/monaco-editor#475

pull/2748/head
Martin Aeschlimann 8 years ago
parent 9d724f1e05
commit 3cac4e7522

@ -92,7 +92,10 @@ export class DiagnostcsAdapter {
this._worker(resource).then(worker => {
return worker.doValidation(resource.toString()).then(diagnostics => {
const markers = diagnostics.map(d => toDiagnostics(resource, d));
monaco.editor.setModelMarkers(monaco.editor.getModel(resource), languageId, markers);
let model = monaco.editor.getModel(resource);
if (model.getModeId() === languageId) {
monaco.editor.setModelMarkers(model, languageId, markers);
}
});
}).then(undefined, err => {
console.error(err);

Loading…
Cancel
Save