mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +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
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import {LanguageServiceDefaultsImpl} from './monaco.contribution';
|
import { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
||||||
import {CSSWorker} from './cssWorker';
|
import { CSSWorker } from './cssWorker';
|
||||||
|
|
||||||
import * as ls from 'vscode-languageserver-types';
|
import * as ls from 'vscode-languageserver-types';
|
||||||
|
|
||||||
|
|
@ -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));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue