diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 28c681b995b..ea6e7b708a4 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -132,8 +132,8 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif public onDidChangeModelContent(listener: (e: editorCommon.IModelContentChangedEvent2) => void): IDisposable { return this.addListener2(editorCommon.EventType.ModelContentChanged2, listener); } - public onDidChangeModelMode(listener: (e: editorCommon.IModelModeChangedEvent) => void): IDisposable { - return this.addListener2(editorCommon.EventType.ModelModeChanged, listener); + public onDidChangeModelLanguage(listener: (e: editorCommon.IModelLanguageChangedEvent) => void): IDisposable { + return this.addListener2(editorCommon.EventType.ModelLanguageChanged, listener); } public onDidChangeModelOptions(listener: (e: editorCommon.IModelOptionsChangedEvent) => void): IDisposable { return this.addListener2(editorCommon.EventType.ModelOptionsChanged, listener); @@ -734,7 +734,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif let changed = false; for (let i = 0; !changed && i < events.length; i++) { let type = events[i].getType(); - changed = changed || type === editorCommon.EventType.ModelRawContentChanged || type === editorCommon.EventType.ModelModeChanged; + changed = changed || type === editorCommon.EventType.ModelRawContentChanged; } if (changed && this._isVisible) { // Clear previous timeout if necessary diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index 1577d2788ef..02ee9023254 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -39,7 +39,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom public readonly onDidChangeModelRawContent: Event = fromEventEmitter(this, editorCommon.EventType.ModelRawContentChanged); public readonly onDidChangeModelContent: Event = fromEventEmitter(this, editorCommon.EventType.ModelContentChanged2); - public readonly onDidChangeModelMode: Event = fromEventEmitter(this, editorCommon.EventType.ModelModeChanged); + public readonly onDidChangeModelLanguage: Event = fromEventEmitter(this, editorCommon.EventType.ModelLanguageChanged); public readonly onDidChangeModelOptions: Event = fromEventEmitter(this, editorCommon.EventType.ModelOptionsChanged); public readonly onDidChangeModelDecorations: Event = fromEventEmitter(this, editorCommon.EventType.ModelDecorationsChanged); public readonly onDidChangeConfiguration: Event = fromEventEmitter(this, editorCommon.EventType.ConfigurationChanged); @@ -877,9 +877,9 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom this.emit(editorCommon.EventType.ModelDecorationsChanged, e); break; - case editorCommon.EventType.ModelModeChanged: + case editorCommon.EventType.ModelLanguageChanged: this.domElement.setAttribute('data-mode-id', this.model.getLanguageIdentifier().language); - this.emit(editorCommon.EventType.ModelModeChanged, e); + this.emit(editorCommon.EventType.ModelLanguageChanged, e); break; case editorCommon.EventType.ModelRawContentChanged: diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index 5137c367b30..f97b671b7b9 100644 --- a/src/vs/editor/common/controller/cursor.ts +++ b/src/vs/editor/common/controller/cursor.ts @@ -116,12 +116,12 @@ export class Cursor extends EventEmitter { this.modelUnbinds.push(this.model.onDidChangeRawContent((e) => { this._onModelContentChanged(e); })); - this.modelUnbinds.push(this.model.onDidChangeMode((e) => { - this._onModelModeChanged(); + this.modelUnbinds.push(this.model.onDidChangeLanguage((e) => { + this._onModelLanguageChanged(); })); this.modelUnbinds.push(LanguageConfigurationRegistry.onDidChange(() => { // TODO@Alex: react only if certain supports changed? (and if my model's mode changed) - this._onModelModeChanged(); + this._onModelLanguageChanged(); })); this._handlers = {}; @@ -224,7 +224,7 @@ export class Cursor extends EventEmitter { } } - private _onModelModeChanged(): void { + private _onModelLanguageChanged(): void { // the mode of this model has changed this.cursors.updateMode(); } diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index d209afc1650..75cdd60f03c 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -10,7 +10,7 @@ import * as types from 'vs/base/common/types'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { ServicesAccessor, IConstructorSignature1 } from 'vs/platform/instantiation/common/instantiation'; -import { IMode, LanguageId, LanguageIdentifier, StandardTokenType } from 'vs/editor/common/modes'; +import { LanguageId, LanguageIdentifier, StandardTokenType } from 'vs/editor/common/modes'; import { LineTokens } from 'vs/editor/common/core/lineTokens'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import { IDisposable } from 'vs/base/common/lifecycle'; @@ -2168,7 +2168,7 @@ export interface IModel extends IReadOnlyModel, IEditableTextModel, ITextModelWi * An event emitted when the language associated with the model has changed. * @event */ - onDidChangeMode(listener: (e: IModelModeChangedEvent) => void): IDisposable; + onDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; /** * An event emitted right before disposing the model. * @event @@ -2218,17 +2218,15 @@ export interface IModel extends IReadOnlyModel, IEditableTextModel, ITextModelWi /** * An event describing that the current mode associated with a model has changed. */ -export interface IModelModeChangedEvent { +export interface IModelLanguageChangedEvent { /** - * Previous mode - * TODO@tokenization + * Previous language */ - readonly oldMode: IMode; + readonly oldLanguageIdentifier: LanguageIdentifier; /** - * New mode - * TODO@tokenization + * New language */ - readonly newMode: IMode; + readonly newLanguageIdentifier: LanguageIdentifier; } /** @@ -3423,7 +3421,7 @@ export interface IEditor { * An event emitted when the language of the current model has changed. * @event */ - onDidChangeModelMode(listener: (e: IModelModeChangedEvent) => void): IDisposable; + onDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; /** * An event emitted when the options of the current model has changed. * @event @@ -4102,7 +4100,7 @@ export var EventType = { ModelChanged: 'modelChanged', ModelTokensChanged: 'modelTokensChanged', - ModelModeChanged: 'modelsModeChanged', + ModelLanguageChanged: 'modelLanguageChanged', ModelOptionsChanged: 'modelOptionsChanged', ModelRawContentChanged: 'contentChanged', ModelContentChanged2: 'contentChanged2', diff --git a/src/vs/editor/common/model/model.ts b/src/vs/editor/common/model/model.ts index 4af20f75a77..bb4b2b1fa4c 100644 --- a/src/vs/editor/common/model/model.ts +++ b/src/vs/editor/common/model/model.ts @@ -7,7 +7,7 @@ import URI from 'vs/base/common/uri'; import { EventType, IModel, ITextModelCreationOptions, IModelDecorationsChangedEvent, - IModelOptionsChangedEvent, IModelModeChangedEvent, IRawText + IModelOptionsChangedEvent, IModelLanguageChangedEvent, IRawText } from 'vs/editor/common/editorCommon'; import { EditableTextModel } from 'vs/editor/common/model/editableTextModel'; import { TextModel } from 'vs/editor/common/model/textModel'; @@ -44,8 +44,8 @@ export class Model extends EditableTextModel implements IModel { public onWillDispose(listener: () => void): IDisposable { return this.addListener2(EventType.ModelDispose, listener); } - public onDidChangeMode(listener: (e: IModelModeChangedEvent) => void): IDisposable { - return this.addListener2(EventType.ModelModeChanged, listener); + public onDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable { + return this.addListener2(EventType.ModelLanguageChanged, listener); } public addBulkListener(listener: BulkListenerCallback): IDisposable { diff --git a/src/vs/editor/common/model/textModelWithTokens.ts b/src/vs/editor/common/model/textModelWithTokens.ts index fbd5c94ee6e..2479672941d 100644 --- a/src/vs/editor/common/model/textModelWithTokens.ts +++ b/src/vs/editor/common/model/textModelWithTokens.ts @@ -13,7 +13,7 @@ import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { TextModel } from 'vs/editor/common/model/textModel'; import { TokenIterator } from 'vs/editor/common/model/tokenIterator'; -import { ITokenizationSupport, IMode, IState, TokenizationRegistry, LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; +import { ITokenizationSupport, IState, TokenizationRegistry, LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; import { NULL_LANGUAGE_IDENTIFIER, nullTokenize3 } from 'vs/editor/common/modes/nullMode'; import { ignoreBracketsInToken } from 'vs/editor/common/modes/supports'; import { BracketsUtils, RichEditBrackets, RichEditBracket } from 'vs/editor/common/modes/supports/richEditBrackets'; @@ -23,23 +23,6 @@ import { LineTokens, LineToken } from 'vs/editor/common/core/lineTokens'; import { getWordAtText } from 'vs/editor/common/model/wordHelper'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; -class Mode implements IMode { - - private _languageIdentifier: LanguageIdentifier; - - constructor(languageId: LanguageIdentifier) { - this._languageIdentifier = languageId; - } - - getId(): string { - return this._languageIdentifier.language; - } - - getLanguageIdentifier(): LanguageIdentifier { - return this._languageIdentifier; - } -} - class ModelTokensChangedEventBuilder { private _ranges: { fromLineNumber: number; toLineNumber: number; }[]; @@ -91,7 +74,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke constructor(allowedEventTypes: string[], rawText: editorCommon.IRawText, languageIdentifier: LanguageIdentifier) { allowedEventTypes.push(editorCommon.EventType.ModelTokensChanged); - allowedEventTypes.push(editorCommon.EventType.ModelModeChanged); + allowedEventTypes.push(editorCommon.EventType.ModelLanguageChanged); super(allowedEventTypes, rawText); this._languageIdentifier = languageIdentifier || NULL_LANGUAGE_IDENTIFIER; @@ -214,9 +197,9 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke return; } - let e: editorCommon.IModelModeChangedEvent = { - oldMode: new Mode(this._languageIdentifier), - newMode: new Mode(languageIdentifier) + let e: editorCommon.IModelLanguageChangedEvent = { + oldLanguageIdentifier: this._languageIdentifier, + newLanguageIdentifier: languageIdentifier }; this._languageIdentifier = languageIdentifier; @@ -412,9 +395,9 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke } } - private _emitModelModeChangedEvent(e: editorCommon.IModelModeChangedEvent): void { + private _emitModelModeChangedEvent(e: editorCommon.IModelLanguageChangedEvent): void { if (!this._isDisposing) { - this.emit(editorCommon.EventType.ModelModeChanged, e); + this.emit(editorCommon.EventType.ModelLanguageChanged, e); } } diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 6cce58c3d79..62e5bb8d593 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -40,6 +40,7 @@ export class LanguageIdentifier { /** * A mode. Will soon be obsolete. + * @internal */ export interface IMode { diff --git a/src/vs/editor/common/modes/editorModeContext.ts b/src/vs/editor/common/modes/editorModeContext.ts index 239937ca622..1bcac6ebf21 100644 --- a/src/vs/editor/common/modes/editorModeContext.ts +++ b/src/vs/editor/common/modes/editorModeContext.ts @@ -50,7 +50,7 @@ export class EditorModeContext { // update when model/mode changes this._disposables.push(editor.onDidChangeModel(() => this._update())); - this._disposables.push(editor.onDidChangeModelMode(() => this._update())); + this._disposables.push(editor.onDidChangeModelLanguage(() => this._update())); // update when registries change modes.SuggestRegistry.onDidChange(this._update, this, this._disposables); diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 7452e25be92..9cfa291c623 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -476,10 +476,10 @@ export class ModelServiceImpl implements IModelService { // Second, look for mode change for (let i = 0, len = events.length; i < len; i++) { let e = events[i]; - if (e.getType() === editorCommon.EventType.ModelModeChanged) { + if (e.getType() === editorCommon.EventType.ModelLanguageChanged) { this._onModelModeChanged.fire({ model: modelData.model, - oldModeId: (e.getData()).oldMode.getId() + oldModeId: (e.getData()).oldLanguageIdentifier.language }); } } diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts index 1b6a46dcd2b..62eaaf2ee3c 100644 --- a/src/vs/editor/common/viewModel/viewModelImpl.ts +++ b/src/vs/editor/common/viewModel/viewModelImpl.ts @@ -235,7 +235,7 @@ export class ViewModel extends EventEmitter implements IViewModel { this.onModelTokensChanged(data); break; - case editorCommon.EventType.ModelModeChanged: + case editorCommon.EventType.ModelLanguageChanged: // That's ok, a model tokens changed event will follow shortly break; diff --git a/src/vs/editor/contrib/codelens/browser/codelens.ts b/src/vs/editor/contrib/codelens/browser/codelens.ts index 60c48e47a92..b60299bb935 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.ts +++ b/src/vs/editor/contrib/codelens/browser/codelens.ts @@ -330,7 +330,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._modelChangeCounter = 0; this._globalToDispose.push(this._editor.onDidChangeModel(() => this.onModelChange())); - this._globalToDispose.push(this._editor.onDidChangeModelMode(() => this.onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this.onModelChange())); this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => { let prevIsEnabled = this._isEnabled; this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; diff --git a/src/vs/editor/contrib/format/common/formatActions.ts b/src/vs/editor/contrib/format/common/formatActions.ts index 31190415d87..8b74b7e3ba2 100644 --- a/src/vs/editor/contrib/format/common/formatActions.ts +++ b/src/vs/editor/contrib/format/common/formatActions.ts @@ -40,7 +40,7 @@ class FormatOnType implements editorCommon.IEditorContribution { this.callOnDispose.push(editor.onDidChangeConfiguration(() => this.update())); this.callOnDispose.push(editor.onDidChangeModel(() => this.update())); - this.callOnDispose.push(editor.onDidChangeModelMode(() => this.update())); + this.callOnDispose.push(editor.onDidChangeModelLanguage(() => this.update())); this.callOnDispose.push(OnTypeFormattingEditProviderRegistry.onDidChange(this.update, this)); } diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index 538decdc66a..55fc820e554 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -111,7 +111,7 @@ class LinkDetector implements editorCommon.IEditorContribution { this.listenersToRemove = []; this.listenersToRemove.push(editor.onDidChangeModelContent((e) => this.onChange())); this.listenersToRemove.push(editor.onDidChangeModel((e) => this.onModelChanged())); - this.listenersToRemove.push(editor.onDidChangeModelMode((e) => this.onModelModeChanged())); + this.listenersToRemove.push(editor.onDidChangeModelLanguage((e) => this.onModelModeChanged())); this.listenersToRemove.push(LinkProviderRegistry.onDidChange((e) => this.onModelModeChanged())); this.listenersToRemove.push(this.editor.onMouseUp((e: IEditorMouseEvent) => this.onEditorMouseUp(e))); this.listenersToRemove.push(this.editor.onMouseMove((e: IEditorMouseEvent) => this.onEditorMouseMove(e))); diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts index dce77c73051..ff24ce99d14 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts @@ -57,7 +57,7 @@ export class ParameterHintsModel extends Disposable { this._register(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange())); this._register(this.editor.onDidChangeModel(e => this.onModelChanged())); - this._register(this.editor.onDidChangeModelMode(_ => this.onModelChanged())); + this._register(this.editor.onDidChangeModelLanguage(_ => this.onModelChanged())); this._register(this.editor.onDidChangeCursorSelection(e => this.onCursorChange(e))); this._register(SignatureHelpProviderRegistry.onDidChange(this.onModelChanged, this)); diff --git a/src/vs/editor/contrib/quickFix/common/quickFixModel.ts b/src/vs/editor/contrib/quickFix/common/quickFixModel.ts index eb680670dff..d1528776d4f 100644 --- a/src/vs/editor/contrib/quickFix/common/quickFixModel.ts +++ b/src/vs/editor/contrib/quickFix/common/quickFixModel.ts @@ -139,7 +139,7 @@ export class QuickFixModel { this._markerService = markerService; this._disposables.push(this._editor.onDidChangeModel(() => this._update())); - this._disposables.push(this._editor.onDidChangeModelMode(() => this._update())); + this._disposables.push(this._editor.onDidChangeModelLanguage(() => this._update())); this._disposables.push(CodeActionProviderRegistry.onDidChange(this._update, this)); this._update(); diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts index 3b461e6b519..11a678c40ce 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts @@ -96,7 +96,7 @@ export class ReferencesController implements editorCommon.IEditorContribution { this._referenceSearchVisible.set(true); // close the widget on model/mode changes - this._disposables.push(this._editor.onDidChangeModelMode(() => { this.closeWidget(); })); + this._disposables.push(this._editor.onDidChangeModelLanguage(() => { this.closeWidget(); })); this._disposables.push(this._editor.onDidChangeModel(() => { if (!this._ignoreModelChangeEvent) { this.closeWidget(); diff --git a/src/vs/editor/contrib/suggest/common/suggestModel.ts b/src/vs/editor/contrib/suggest/common/suggestModel.ts index 7e8eab227da..5a3f163ea12 100644 --- a/src/vs/editor/contrib/suggest/common/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/common/suggestModel.ts @@ -118,7 +118,7 @@ export class SuggestModel implements IDisposable { this.updateTriggerCharacters(); this.cancel(); })); - this.toDispose.push(editor.onDidChangeModelMode(() => { + this.toDispose.push(editor.onDidChangeModelLanguage(() => { this.updateTriggerCharacters(); this.cancel(); })); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index e45b9f0651f..403fb03c42d 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2262,7 +2262,7 @@ declare module monaco.editor { * An event emitted when the language associated with the model has changed. * @event */ - onDidChangeMode(listener: (e: IModelModeChangedEvent) => void): IDisposable; + onDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; /** * An event emitted right before disposing the model. * @event @@ -2282,17 +2282,15 @@ declare module monaco.editor { /** * An event describing that the current mode associated with a model has changed. */ - export interface IModelModeChangedEvent { + export interface IModelLanguageChangedEvent { /** - * Previous mode - * TODO@tokenization + * Previous language */ - readonly oldMode: languages.IMode; + readonly oldLanguageIdentifier: languages.LanguageIdentifier; /** - * New mode - * TODO@tokenization + * New language */ - readonly newMode: languages.IMode; + readonly newLanguageIdentifier: languages.LanguageIdentifier; } /** @@ -2854,7 +2852,7 @@ declare module monaco.editor { * An event emitted when the language of the current model has changed. * @event */ - onDidChangeModelMode(listener: (e: IModelModeChangedEvent) => void): IDisposable; + onDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; /** * An event emitted when the options of the current model has changed. * @event @@ -4290,14 +4288,6 @@ declare module monaco.languages { constructor(language: string, id: number); } - /** - * A mode. Will soon be obsolete. - */ - export interface IMode { - getId(): string; - getLanguageIdentifier(): LanguageIdentifier; - } - /** * The state of the tokenizer between two lines. * It is useful to store flags such as in multiline comment, etc. diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index f1335386432..22d7e8220ce 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -24,7 +24,7 @@ import { IDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecyc import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IEditorAction, ICommonCodeEditor, IModelContentChangedEvent, IModelOptionsChangedEvent, IModelModeChangedEvent, ICursorPositionChangedEvent, EndOfLineSequence, EditorType, IModel, IDiffEditorModel, IEditor } from 'vs/editor/common/editorCommon'; +import { IEditorAction, ICommonCodeEditor, IModelContentChangedEvent, IModelOptionsChangedEvent, IModelLanguageChangedEvent, ICursorPositionChangedEvent, EndOfLineSequence, EditorType, IModel, IDiffEditorModel, IEditor } from 'vs/editor/common/editorCommon'; import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { TrimTrailingWhitespaceAction } from 'vs/editor/contrib/linesOperations/common/linesOperations'; import { IndentUsingSpaces, IndentUsingTabs, DetectIndentation, IndentationToSpacesAction, IndentationToTabsAction } from 'vs/workbench/parts/indentation/common/indentation'; @@ -495,7 +495,7 @@ export class EditorStatus implements IStatusbarItem { })); // Hook Listener for mode changes - this.activeEditorListeners.push(control.onDidChangeModelMode((event: IModelModeChangedEvent) => { + this.activeEditorListeners.push(control.onDidChangeModelLanguage((event: IModelLanguageChangedEvent) => { this.onModeChange(control); }));