mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
Markers appear for wrong language id. Fixes Microsoft/monaco-editor#111
This commit is contained in:
parent
f144cfb0ba
commit
a0f4474c54
2 changed files with 10 additions and 4 deletions
|
|
@ -4,8 +4,8 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {LanguageServiceDefaultsImpl} from './monaco.contribution';
|
||||
import {CSSWorker} from './cssWorker';
|
||||
import { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
||||
import { CSSWorker } from './cssWorker';
|
||||
|
||||
import * as ls from 'vscode-languageserver-types';
|
||||
|
||||
|
|
@ -47,7 +47,13 @@ export class DiagnostcsAdapter {
|
|||
|
||||
const onModelRemoved = (model: monaco.editor.IModel): void => {
|
||||
monaco.editor.setModelMarkers(model, this._languageId, []);
|
||||
delete this._listener[model.uri.toString()];
|
||||
|
||||
let uriStr = model.uri.toString();
|
||||
let listener = this._listener[uriStr];
|
||||
if (listener) {
|
||||
listener.dispose();
|
||||
delete this._listener[uriStr];
|
||||
}
|
||||
};
|
||||
|
||||
this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue