Markers appear for wrong language id. Fixes Microsoft/monaco-editor#111

This commit is contained in:
Martin Aeschlimann 2017-01-16 12:48:00 +01:00
parent f144cfb0ba
commit a0f4474c54
2 changed files with 10 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "monaco-css", "name": "monaco-css",
"version": "1.2.1", "version": "1.2.2",
"description": "CSS, LESS and SCSS plugin for the Monaco Editor", "description": "CSS, LESS and SCSS plugin for the Monaco Editor",
"scripts": { "scripts": {
"compile": "gulp compile", "compile": "gulp compile",

View file

@ -47,7 +47,13 @@ export class DiagnostcsAdapter {
const onModelRemoved = (model: monaco.editor.IModel): void => { const onModelRemoved = (model: monaco.editor.IModel): void => {
monaco.editor.setModelMarkers(model, this._languageId, []); 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)); this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd));