mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-23 00:22:56 +01:00
🆙 monaco-editor-core
This commit is contained in:
parent
1196e89298
commit
bb72646030
3 changed files with 11 additions and 11 deletions
|
|
@ -35,7 +35,7 @@ export class DiagnosticsAdapter {
|
|||
defaults: LanguageServiceDefaults
|
||||
) {
|
||||
const onModelAdd = (model: editor.IModel): void => {
|
||||
let modeId = model.getModeId();
|
||||
let modeId = model.getLanguageId();
|
||||
if (modeId !== this._languageId) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ export class DiagnosticsAdapter {
|
|||
this._disposables.push(
|
||||
defaults.onDidChange((_) => {
|
||||
editor.getModels().forEach((model) => {
|
||||
if (model.getModeId() === this._languageId) {
|
||||
if (model.getLanguageId() === this._languageId) {
|
||||
onModelRemoved(model);
|
||||
onModelAdd(model);
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ export class DiagnosticsAdapter {
|
|||
return worker.doValidation(resource.toString()).then((diagnostics) => {
|
||||
const markers = diagnostics.map((d) => toDiagnostics(resource, d));
|
||||
let model = editor.getModel(resource);
|
||||
if (model && model.getModeId() === languageId) {
|
||||
if (model && model.getLanguageId() === languageId) {
|
||||
editor.setModelMarkers(model, languageId, markers);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue