mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
When I switch the editor's language and values, the previous language error markers stick around Microsoft/monaco-editor#475
This commit is contained in:
parent
a3fe14998f
commit
9a25293cce
1 changed files with 4 additions and 1 deletions
|
|
@ -84,7 +84,10 @@ export class DiagnostcsAdapter {
|
|||
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);
|
||||
}
|
||||
}).done(undefined, err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue