diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index b14a431bc10..5c01f8f5e67 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -126,22 +126,22 @@ var DIFF_EDITOR_ID = 0; export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDiffEditor { - public onDidModelContentChange(listener: (e:editorCommon.IModelContentChangedEvent)=>void): IDisposable { + public onDidChangeModelContent(listener: (e:editorCommon.IModelContentChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelContentChanged, listener); } - public onDidModelModeChange(listener: (e:editorCommon.IModelModeChangedEvent)=>void): IDisposable { + public onDidChangeModelMode(listener: (e:editorCommon.IModelModeChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelModeChanged, listener); } - public onDidModelOptionsChange(listener: (e:editorCommon.IModelOptionsChangedEvent)=>void): IDisposable { + public onDidChangeModelOptions(listener: (e:editorCommon.IModelOptionsChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelOptionsChanged, listener); } - public onDidConfigurationChange(listener: (e:editorCommon.IConfigurationChangedEvent)=>void): IDisposable { + public onDidChangeConfiguration(listener: (e:editorCommon.IConfigurationChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ConfigurationChanged, listener); } - public onDidCursorPositionChange(listener: (e:editorCommon.ICursorPositionChangedEvent)=>void): IDisposable { + public onDidChangeCursorPosition(listener: (e:editorCommon.ICursorPositionChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.CursorPositionChanged, listener); } - public onDidCursorSelectionChange(listener: (e:editorCommon.ICursorSelectionChangedEvent)=>void): IDisposable { + public onDidChangeCursorSelection(listener: (e:editorCommon.ICursorSelectionChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.CursorSelectionChanged, listener); } public onDidDispose(listener: ()=>void): IDisposable { diff --git a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts index d1b53061f3a..324d4b6185a 100644 --- a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts +++ b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts @@ -35,7 +35,7 @@ export class EmbeddedCodeEditorWidget extends CodeEditorWidget { // Overwrite parent's options super.updateOptions(this._overwriteOptions); - this._lifetimeDispose.push(parentEditor.onDidConfigurationChange((e:IConfigurationChangedEvent) => this._onParentConfigurationChanged(e))); + this._lifetimeDispose.push(parentEditor.onDidChangeConfiguration((e:IConfigurationChangedEvent) => this._onParentConfigurationChanged(e))); } public getParentEditor(): ICodeEditor { diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index eae3b33fce3..d2cf8e2fbc1 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -36,43 +36,43 @@ var EDITOR_ID = 0; export abstract class CommonCodeEditor extends EventEmitter implements IActionProvider, editorCommon.ICommonCodeEditor { - public onDidModelContentChange(listener: (e:editorCommon.IModelContentChangedEvent)=>void): IDisposable { + public onDidChangeModelContent(listener: (e:editorCommon.IModelContentChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelContentChanged, listener); } - public onDidModelModeChange(listener: (e:editorCommon.IModelModeChangedEvent)=>void): IDisposable { + public onDidChangeModelMode(listener: (e:editorCommon.IModelModeChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelModeChanged, listener); } - public onDidModelOptionsChange(listener: (e:editorCommon.IModelOptionsChangedEvent)=>void): IDisposable { + public onDidChangeModelOptions(listener: (e:editorCommon.IModelOptionsChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelOptionsChanged, listener); } - public onDidModelModeSupportChange(listener: (e:editorCommon.IModeSupportChangedEvent)=>void): IDisposable { + public onDidChangeModelModeSupport(listener: (e:editorCommon.IModeSupportChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelModeSupportChanged, listener); } - public onDidModelDecorationsChange(listener: (e:editorCommon.IModelDecorationsChangedEvent)=>void): IDisposable { + public onDidChangeModelDecorations(listener: (e:editorCommon.IModelDecorationsChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelDecorationsChanged, listener); } - public onDidConfigurationChange(listener: (e:editorCommon.IConfigurationChangedEvent)=>void): IDisposable { + public onDidChangeConfiguration(listener: (e:editorCommon.IConfigurationChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ConfigurationChanged, listener); } - public onDidModelChange(listener: (e:editorCommon.IModelChangedEvent)=>void): IDisposable { + public onDidChangeModel(listener: (e:editorCommon.IModelChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.ModelChanged, listener); } - public onDidCursorPositionChange(listener: (e:editorCommon.ICursorPositionChangedEvent)=>void): IDisposable { + public onDidChangeCursorPosition(listener: (e:editorCommon.ICursorPositionChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.CursorPositionChanged, listener); } - public onDidCursorSelectionChange(listener: (e:editorCommon.ICursorSelectionChangedEvent)=>void): IDisposable { + public onDidChangeCursorSelection(listener: (e:editorCommon.ICursorSelectionChangedEvent)=>void): IDisposable { return this.addListener2(editorCommon.EventType.CursorSelectionChanged, listener); } - public onDidEditorTextFocus(listener: ()=>void): IDisposable { + public onDidFocusEditorText(listener: ()=>void): IDisposable { return this.addListener2(editorCommon.EventType.EditorTextFocus, listener); } - public onDidEditorTextBlur(listener: ()=>void): IDisposable { + public onDidBlurEditorText(listener: ()=>void): IDisposable { return this.addListener2(editorCommon.EventType.EditorTextBlur, listener); } - public onDidEditorFocus(listener: ()=>void): IDisposable { + public onDidFocusEditor(listener: ()=>void): IDisposable { return this.addListener2(editorCommon.EventType.EditorFocus, listener); } - public onDidEditorBlur(listener: ()=>void): IDisposable { + public onDidBlurEditor(listener: ()=>void): IDisposable { return this.addListener2(editorCommon.EventType.EditorBlur, listener); } public onDidDispose(listener: ()=>void): IDisposable { diff --git a/src/vs/editor/common/editorActionEnablement.ts b/src/vs/editor/common/editorActionEnablement.ts index 10add037488..1149504194d 100644 --- a/src/vs/editor/common/editorActionEnablement.ts +++ b/src/vs/editor/common/editorActionEnablement.ts @@ -115,15 +115,15 @@ class InternalEnablementState extends CachingEnablementState { this._callOnDispose = []; if (this._behaviour & Behaviour.TextFocus) { - this._callOnDispose.push(this.editor.onDidEditorTextFocus(() => this._updateTextFocus(true))); - this._callOnDispose.push(this.editor.onDidEditorTextBlur(() => this._updateTextFocus(false))); + this._callOnDispose.push(this.editor.onDidFocusEditorText(() => this._updateTextFocus(true))); + this._callOnDispose.push(this.editor.onDidBlurEditorText(() => this._updateTextFocus(false))); } if (this._behaviour & Behaviour.WidgetFocus) { - this._callOnDispose.push(this.editor.onDidEditorFocus(() => this._updateWidgetFocus(true))); - this._callOnDispose.push(this.editor.onDidEditorBlur(() => this._updateWidgetFocus(false))); + this._callOnDispose.push(this.editor.onDidFocusEditor(() => this._updateWidgetFocus(true))); + this._callOnDispose.push(this.editor.onDidBlurEditor(() => this._updateWidgetFocus(false))); } if (this._behaviour & Behaviour.Writeable) { - this._callOnDispose.push(this.editor.onDidConfigurationChange((e) => this._update())); + this._callOnDispose.push(this.editor.onDidChangeConfiguration((e) => this._update())); } } @@ -174,12 +174,12 @@ class DescentEnablementState extends CachingEnablementState { super(); if (behaviour & Behaviour.UpdateOnModelChange) { - this._callOnDispose.push(this.editor.onDidModelChange(() => this.reset())); - this._callOnDispose.push(this.editor.onDidModelModeChange(() => this.reset())); - this._callOnDispose.push(this.editor.onDidModelModeSupportChange(() => this.reset())); + this._callOnDispose.push(this.editor.onDidChangeModel(() => this.reset())); + this._callOnDispose.push(this.editor.onDidChangeModelMode(() => this.reset())); + this._callOnDispose.push(this.editor.onDidChangeModelModeSupport(() => this.reset())); } if (behaviour & Behaviour.UpdateOnCursorPositionChange) { - this._callOnDispose.push(this.editor.onDidCursorPositionChange(() => this.reset())); + this._callOnDispose.push(this.editor.onDidChangeCursorPosition(() => this.reset())); } } diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index ebee3689655..223d4b204df 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -2930,12 +2930,12 @@ export interface ICommonEditorContributionDescriptor { */ export interface IEditor { - onDidModelContentChange(listener: (e:IModelContentChangedEvent)=>void): IDisposable; - onDidModelModeChange(listener: (e:IModelModeChangedEvent)=>void): IDisposable; - onDidModelOptionsChange(listener: (e:IModelOptionsChangedEvent)=>void): IDisposable; - onDidConfigurationChange(listener: (e:IConfigurationChangedEvent)=>void): IDisposable; - onDidCursorPositionChange(listener: (e:ICursorPositionChangedEvent)=>void): IDisposable; - onDidCursorSelectionChange(listener: (e:ICursorSelectionChangedEvent)=>void): IDisposable; + onDidChangeModelContent(listener: (e:IModelContentChangedEvent)=>void): IDisposable; + onDidChangeModelMode(listener: (e:IModelModeChangedEvent)=>void): IDisposable; + onDidChangeModelOptions(listener: (e:IModelOptionsChangedEvent)=>void): IDisposable; + onDidChangeConfiguration(listener: (e:IConfigurationChangedEvent)=>void): IDisposable; + onDidChangeCursorPosition(listener: (e:ICursorPositionChangedEvent)=>void): IDisposable; + onDidChangeCursorSelection(listener: (e:ICursorSelectionChangedEvent)=>void): IDisposable; onDidDispose(listener: ()=>void): IDisposable; dispose(): void; @@ -3211,15 +3211,15 @@ export interface IRangeWithMessage { export interface ICommonCodeEditor extends IEditor { - onDidModelChange(listener: (e:IModelChangedEvent)=>void): IDisposable; - onDidModelModeSupportChange(listener: (e:IModeSupportChangedEvent)=>void): IDisposable; - onDidModelDecorationsChange(listener: (e:IModelDecorationsChangedEvent)=>void): IDisposable; + onDidChangeModel(listener: (e:IModelChangedEvent)=>void): IDisposable; + onDidChangeModelModeSupport(listener: (e:IModeSupportChangedEvent)=>void): IDisposable; + onDidChangeModelDecorations(listener: (e:IModelDecorationsChangedEvent)=>void): IDisposable; - onDidEditorTextFocus(listener: ()=>void): IDisposable; - onDidEditorTextBlur(listener: ()=>void): IDisposable; + onDidFocusEditorText(listener: ()=>void): IDisposable; + onDidBlurEditorText(listener: ()=>void): IDisposable; - onDidEditorFocus(listener: ()=>void): IDisposable; - onDidEditorBlur(listener: ()=>void): IDisposable; + onDidFocusEditor(listener: ()=>void): IDisposable; + onDidBlurEditor(listener: ()=>void): IDisposable; /** * Returns true if this editor or one of its widgets has keyboard focus. diff --git a/src/vs/editor/contrib/clipboard/browser/clipboard.ts b/src/vs/editor/contrib/clipboard/browser/clipboard.ts index 40abb8f771a..8a1fc72c0e1 100644 --- a/src/vs/editor/contrib/clipboard/browser/clipboard.ts +++ b/src/vs/editor/contrib/clipboard/browser/clipboard.ts @@ -26,7 +26,7 @@ class ClipboardWritingAction extends EditorAction { constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor, condition:Behaviour) { super(descriptor, editor, condition); this.toUnhook = []; - this.toUnhook.push(this.editor.onDidCursorSelectionChange((e:editorCommon.ICursorSelectionChangedEvent) => { + this.toUnhook.push(this.editor.onDidChangeCursorSelection((e:editorCommon.ICursorSelectionChangedEvent) => { this.resetEnablementState(); })); } diff --git a/src/vs/editor/contrib/codelens/browser/codelens.ts b/src/vs/editor/contrib/codelens/browser/codelens.ts index 754783dd817..fcab8d63a24 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.ts +++ b/src/vs/editor/contrib/codelens/browser/codelens.ts @@ -362,9 +362,9 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._currentFindCodeLensSymbolsPromise = null; this._modelChangeCounter = 0; - this._globalToDispose.push(this._editor.onDidModelChange(() => this.onModelChange())); - this._globalToDispose.push(this._editor.onDidModelModeChange(() => this.onModelChange())); - this._globalToDispose.push(this._editor.onDidConfigurationChange((e: editorCommon.IConfigurationChangedEvent) => { + this._globalToDispose.push(this._editor.onDidChangeModel(() => this.onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeModelMode(() => this.onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => { let prevIsEnabled = this._isEnabled; this._isEnabled = this._editor.getConfiguration().contribInfo.referenceInfos; if (prevIsEnabled !== this._isEnabled) { diff --git a/src/vs/editor/contrib/color/browser/color.ts b/src/vs/editor/contrib/color/browser/color.ts index bdf8c0dc3c2..15d210a976c 100644 --- a/src/vs/editor/contrib/color/browser/color.ts +++ b/src/vs/editor/contrib/color/browser/color.ts @@ -95,9 +95,9 @@ export class ColorContribution implements editorCommon.IEditorContribution { this._callOnDispose.push(this._contentChangedScheduler); this._callOnDispose.push(this._decorationsChangedScheduler); - this._callOnDispose.push(this._editor.onDidModelChange(() => this.onModelChange())); - this._callOnDispose.push(this._editor.onDidModelModeChange(() => this.onModelChange())); - this._callOnDispose.push(this._editor.onDidModelModeSupportChange((e: editorCommon.IModeSupportChangedEvent) => { + this._callOnDispose.push(this._editor.onDidChangeModel(() => this.onModelChange())); + this._callOnDispose.push(this._editor.onDidChangeModelMode(() => this.onModelChange())); + this._callOnDispose.push(this._editor.onDidChangeModelModeSupport((e: editorCommon.IModeSupportChangedEvent) => { this.onModelChange(); })); @@ -173,7 +173,7 @@ export class ColorContribution implements editorCommon.IEditorContribution { this._currentFindColorDeclarationsPromise = null; } }); - this._callOnModelChange.push(this._editor.onDidModelContentChange((event) => this._contentChangedScheduler.schedule())); + this._callOnModelChange.push(this._editor.onDidChangeModelContent((event) => this._contentChangedScheduler.schedule())); this._callOnModelChange.push(model.addListener2(editorCommon.EventType.ModelDecorationsChanged, (event) => this._decorationsChangedScheduler.schedule())); } diff --git a/src/vs/editor/contrib/defineKeybinding/browser/defineKeybinding.ts b/src/vs/editor/contrib/defineKeybinding/browser/defineKeybinding.ts index fd12692066e..d32e97668b8 100644 --- a/src/vs/editor/contrib/defineKeybinding/browser/defineKeybinding.ts +++ b/src/vs/editor/contrib/defineKeybinding/browser/defineKeybinding.ts @@ -62,14 +62,14 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut this._launchWidget = new DefineKeybindingLauncherWidget(this._editor, keybindingService, () => this.launch()); this._defineWidget = new DefineKeybindingWidget(this._editor, keybindingService, (keybinding) => this._onAccepted(keybinding)); - this._toDispose.push(this._editor.onDidConfigurationChange((e) => { + this._toDispose.push(this._editor.onDidChangeConfiguration((e) => { if (isInterestingEditorModel(this._editor)) { this._launchWidget.show(); } else { this._launchWidget.hide(); } })); - this._toDispose.push(this._editor.onDidModelChange((e) => { + this._toDispose.push(this._editor.onDidChangeModel((e) => { if (isInterestingEditorModel(this._editor)) { this._launchWidget.show(); } else { @@ -379,7 +379,7 @@ class DefineKeybindingWidget implements IOverlayWidget { let htmlkb = this._keybindingService.getHTMLLabelFor(this._lastKeybinding); htmlkb.forEach((item) => this._outputNode.appendChild(renderHtml(item))); })); - this._toDispose.push(this._editor.onDidConfigurationChange((e) => { + this._toDispose.push(this._editor.onDidChangeConfiguration((e) => { if (this._isVisible) { this._layout(); } diff --git a/src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts b/src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts index 549b20fda09..7cd9697cc4e 100644 --- a/src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts +++ b/src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts @@ -67,7 +67,7 @@ export class DiffNavigator extends EventEmitter { this.toUnbind.push(this.editor.onDidUpdateDiff(() => this.onDiffUpdated() )); if(this.options.followsCaret) { - this.toUnbind.push(this.editor.getModifiedEditor().onDidCursorPositionChange((e:ICursorPositionChangedEvent) => { + this.toUnbind.push(this.editor.getModifiedEditor().onDidChangeCursorPosition((e:ICursorPositionChangedEvent) => { if(this.ignoreSelectionChange) { return; } @@ -75,7 +75,7 @@ export class DiffNavigator extends EventEmitter { })); } if(this.options.alwaysRevealFirst) { - this.toUnbind.push(this.editor.getModifiedEditor().onDidModelChange((e) => { + this.toUnbind.push(this.editor.getModifiedEditor().onDidChangeModel((e) => { this.revealFirst = true; })); } diff --git a/src/vs/editor/contrib/find/browser/findWidget.ts b/src/vs/editor/contrib/find/browser/findWidget.ts index 01049fc647c..0afda4ef78f 100644 --- a/src/vs/editor/contrib/find/browser/findWidget.ts +++ b/src/vs/editor/contrib/find/browser/findWidget.ts @@ -98,7 +98,7 @@ export class FindWidget extends Widget implements IOverlayWidget { this.focusTracker = this._register(dom.trackFocus(this._findInput.inputBox.inputElement)); this.focusTracker.addFocusListener(() => this._reseedFindScope()); - this._register(this._codeEditor.onDidConfigurationChange((e:IConfigurationChangedEvent) => { + this._register(this._codeEditor.onDidChangeConfiguration((e:IConfigurationChangedEvent) => { if (e.readOnly) { if (this._codeEditor.getConfiguration().readOnly) { // Hide replace part if editor becomes read only @@ -107,7 +107,7 @@ export class FindWidget extends Widget implements IOverlayWidget { this._updateButtons(); } })); - this._register(this._codeEditor.onDidCursorSelectionChange(() => { + this._register(this._codeEditor.onDidChangeCursorSelection(() => { if (this._isVisible) { this._updateToggleSelectionFindButton(); } diff --git a/src/vs/editor/contrib/find/common/findController.ts b/src/vs/editor/contrib/find/common/findController.ts index ddfdedcec53..4807339c137 100644 --- a/src/vs/editor/contrib/find/common/findController.ts +++ b/src/vs/editor/contrib/find/common/findController.ts @@ -60,7 +60,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd this._model = null; - this._register(this._editor.onDidModelChange(() => { + this._register(this._editor.onDidChangeModel(() => { let shouldRestartFind = (this._editor.getModel() && this._state.isRevealed); this.disposeModel(); @@ -523,7 +523,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd this.updateSoon = this._register(new RunOnceScheduler(() => this._update(), 300)); this.lastWordUnderCursor = null; - this._register(editor.onDidCursorSelectionChange((e: editorCommon.ICursorSelectionChangedEvent) => { + this._register(editor.onDidChangeCursorSelection((e: editorCommon.ICursorSelectionChangedEvent) => { if (e.selection.isEmpty()) { if (e.reason === editorCommon.CursorChangeReason.Explicit) { if (!this.lastWordUnderCursor || !this.lastWordUnderCursor.containsPosition(e.selection.getStartPosition())) { @@ -539,7 +539,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd this._update(); } })); - this._register(editor.onDidModelChange((e) => { + this._register(editor.onDidChangeModel((e) => { this.removeDecorations(); })); this._register(CommonFindController.getFindController(editor).getState().addChangeListener((e) => { diff --git a/src/vs/editor/contrib/find/common/findModel.ts b/src/vs/editor/contrib/find/common/findModel.ts index c5308879234..349c99787b0 100644 --- a/src/vs/editor/contrib/find/common/findModel.ts +++ b/src/vs/editor/contrib/find/common/findModel.ts @@ -57,7 +57,7 @@ export class FindModelBoundToEditorModel { this._updateDecorationsScheduler = new RunOnceScheduler(() => this.research(false), 100); this._toDispose.push(this._updateDecorationsScheduler); - this._toDispose.push(this._editor.onDidCursorPositionChange((e:editorCommon.ICursorPositionChangedEvent) => { + this._toDispose.push(this._editor.onDidChangeCursorPosition((e:editorCommon.ICursorPositionChangedEvent) => { if ( e.reason === editorCommon.CursorChangeReason.Explicit || e.reason === editorCommon.CursorChangeReason.Undo @@ -68,7 +68,7 @@ export class FindModelBoundToEditorModel { })); this._ignoreModelContentChanged = false; - this._toDispose.push(this._editor.onDidModelContentChange((e:editorCommon.IModelContentChangedEvent) => { + this._toDispose.push(this._editor.onDidChangeModelContent((e:editorCommon.IModelContentChangedEvent) => { if (this._ignoreModelContentChanged) { return; } diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index a92fbfea1de..8f2f19c2147 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -164,8 +164,8 @@ export class FoldingController implements editorCommon.IEditorContribution { this.decorations = []; this.computeToken = 0; - this.globalToDispose.push(this.editor.onDidModelChange(() => this.onModelChanged())); - this.globalToDispose.push(this.editor.onDidConfigurationChange((e: editorCommon.IConfigurationChangedEvent) => { + this.globalToDispose.push(this.editor.onDidChangeModel(() => this.onModelChanged())); + this.globalToDispose.push(this.editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => { let oldIsEnabled = this._isEnabled; this._isEnabled = this.editor.getConfiguration().contribInfo.folding; if (oldIsEnabled !== this._isEnabled) { @@ -316,7 +316,7 @@ export class FoldingController implements editorCommon.IEditorContribution { this.localToDispose.push(this.contentChangedScheduler); this.localToDispose.push(this.cursorChangedScheduler); - this.localToDispose.push(this.editor.onDidModelContentChange(() => { + this.localToDispose.push(this.editor.onDidChangeModelContent(() => { this.contentChangedScheduler.schedule(); })); this.localToDispose.push({ dispose: () => { @@ -330,7 +330,7 @@ export class FoldingController implements editorCommon.IEditorContribution { }}); this.localToDispose.push(this.editor.onMouseDown(e => this.onEditorMouseDown(e))); this.localToDispose.push(this.editor.onMouseUp(e => this.onEditorMouseUp(e))); - this.localToDispose.push(this.editor.onDidCursorPositionChange(e => { + this.localToDispose.push(this.editor.onDidChangeCursorPosition(e => { this.cursorChangedScheduler.schedule(); })); diff --git a/src/vs/editor/contrib/format/common/formatActions.ts b/src/vs/editor/contrib/format/common/formatActions.ts index 816121e5148..be120f5b945 100644 --- a/src/vs/editor/contrib/format/common/formatActions.ts +++ b/src/vs/editor/contrib/format/common/formatActions.ts @@ -31,9 +31,9 @@ class FormatOnType implements editorCommon.IEditorContribution { this.callOnDispose = []; this.callOnModel = []; - this.callOnDispose.push(editor.onDidConfigurationChange(() => this.update())); - this.callOnDispose.push(editor.onDidModelChange(() => this.update())); - this.callOnDispose.push(editor.onDidModelModeChange(() => this.update())); + this.callOnDispose.push(editor.onDidChangeConfiguration(() => this.update())); + this.callOnDispose.push(editor.onDidChangeModel(() => this.update())); + this.callOnDispose.push(editor.onDidChangeModelMode(() => this.update())); this.callOnDispose.push(OnTypeFormattingEditProviderRegistry.onDidChange(this.update, this)); } @@ -79,7 +79,7 @@ class FormatOnType implements editorCommon.IEditorContribution { // install a listener that checks if edits happens before the // position on which we format right now. Iff so, we won't // apply the format edits - var unbind = this.editor.onDidModelContentChange((e: editorCommon.IModelContentChangedEvent) => { + var unbind = this.editor.onDidChangeModelContent((e: editorCommon.IModelContentChangedEvent) => { if (e.changeType === editorCommon.EventType.ModelContentChangedFlush) { // a model.setValue() was called canceled = true; diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts index cf2473dafb8..9f33b23310c 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts @@ -228,8 +228,8 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC this.toUnhook.push(this.editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e))); this.toUnhook.push(this.editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e))); - this.toUnhook.push(this.editor.onDidModelChange((e) => this.resetHandler())); - this.toUnhook.push(this.editor.onDidModelContentChange((e: editorCommon.IModelContentChangedEvent) => this.resetHandler())); + this.toUnhook.push(this.editor.onDidChangeModel((e) => this.resetHandler())); + this.toUnhook.push(this.editor.onDidChangeModelContent((e: editorCommon.IModelContentChangedEvent) => this.resetHandler())); this.toUnhook.push(this.editor.onDidScrollChange((e) => { if (e.scrollTopChanged || e.scrollLeftChanged) { this.resetHandler(); diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index f6ab1a248d7..5241af30ebc 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -53,7 +53,7 @@ class MarkerModel { // listen on editor this._toUnbind.push(this._editor.onDidDispose(() => this.dispose())); - this._toUnbind.push(this._editor.onDidCursorPositionChange(() => { + this._toUnbind.push(this._editor.onDidChangeCursorPosition(() => { if (!this._ignoreSelectionChange) { this._nextIdx = -1; } @@ -437,7 +437,7 @@ class MarkerController implements editorCommon.IEditorContribution { this._callOnClose.push(this._model); this._callOnClose.push(this._zone); - this._callOnClose.push(this._editor.onDidModelChange(() => { + this._callOnClose.push(this._editor.onDidChangeModel(() => { this._cleanUp(); })); diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 33ed3f18b5f..e1f4231f749 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -50,8 +50,8 @@ class ModesHoverController implements editorCommon.IEditorContribution { this._toUnhook.push(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); this._toUnhook.push(this._editor.onMouseLeave((e: IEditorMouseEvent) => this._hideWidgets())); this._toUnhook.push(this._editor.onKeyDown((e:IKeyboardEvent) => this._onKeyDown(e))); - this._toUnhook.push(this._editor.onDidModelChange(() => this._hideWidgets())); - this._toUnhook.push(this._editor.onDidModelDecorationsChange(() => this._onModelDecorationsChanged())); + this._toUnhook.push(this._editor.onDidChangeModel(() => this._hideWidgets())); + this._toUnhook.push(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged())); this._toUnhook.push(this._editor.onDidScrollChange((e) => { if (e.scrollTopChanged || e.scrollLeftChanged) { this._hideWidgets(); diff --git a/src/vs/editor/contrib/hover/browser/hoverWidgets.ts b/src/vs/editor/contrib/hover/browser/hoverWidgets.ts index 75437948eef..579a41d4290 100644 --- a/src/vs/editor/contrib/hover/browser/hoverWidgets.ts +++ b/src/vs/editor/contrib/hover/browser/hoverWidgets.ts @@ -45,7 +45,7 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent }); this._editor.applyFontInfo(this._domNode); - this._register(this._editor.onDidConfigurationChange((e:IConfigurationChangedEvent) => { + this._register(this._editor.onDidChangeConfiguration((e:IConfigurationChangedEvent) => { if (e.fontInfo) { this._editor.applyFontInfo(this._domNode); } @@ -144,7 +144,7 @@ export class GlyphHoverWidget extends Widget implements editorBrowser.IOverlayWi this._showAtLineNumber = -1; this._editor.applyFontInfo(this._domNode); - this._register(this._editor.onDidConfigurationChange((e:IConfigurationChangedEvent) => { + this._register(this._editor.onDidChangeConfiguration((e:IConfigurationChangedEvent) => { if (e.fontInfo) { this._editor.applyFontInfo(this._domNode); } diff --git a/src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.ts b/src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.ts index 5aa3530eb3a..0961ff85fb3 100644 --- a/src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.ts +++ b/src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.ts @@ -25,7 +25,7 @@ export class IPadShowKeyboard implements IEditorContribution { this.editor = editor; this.toDispose = []; if (browser.isIPad) { - this.toDispose.push(editor.onDidConfigurationChange(() => this.update())); + this.toDispose.push(editor.onDidChangeConfiguration(() => this.update())); this.update(); } } diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index 8b3270aba06..d422e61070f 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -121,9 +121,9 @@ class LinkDetector implements editorCommon.IEditorContribution { this.messageService = messageService; this.editorWorkerService = editorWorkerService; this.listenersToRemove = []; - this.listenersToRemove.push(editor.onDidModelContentChange((e:editorCommon.IModelContentChangedEvent) => this.onChange())); - this.listenersToRemove.push(editor.onDidModelChange((e) => this.onModelChanged())); - this.listenersToRemove.push(editor.onDidModelModeChange((e) => this.onModelModeChanged())); + this.listenersToRemove.push(editor.onDidChangeModelContent((e:editorCommon.IModelContentChangedEvent) => this.onChange())); + this.listenersToRemove.push(editor.onDidChangeModel((e) => this.onModelChanged())); + this.listenersToRemove.push(editor.onDidChangeModelMode((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))); this.listenersToRemove.push(this.editor.onKeyDown((e:IKeyboardEvent) => this.onEditorKeyDown(e))); diff --git a/src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts b/src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts index c7150b5596a..2360502202b 100644 --- a/src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts +++ b/src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts @@ -129,9 +129,9 @@ export class OutlineMarkerContribution implements editorCommon.IEditorContributi this._markers = []; this._currentOutlinePromise = null; - this._globalToDispose.push(this._editor.onDidModelChange(() => this.onChange(true))); - this._globalToDispose.push(this._editor.onDidModelModeChange(() => this.onChange(false))); - this._globalToDispose.push(this._editor.onDidConfigurationChange((e: editorCommon.IConfigurationChangedEvent) => { + this._globalToDispose.push(this._editor.onDidChangeModel(() => this.onChange(true))); + this._globalToDispose.push(this._editor.onDidChangeModelMode(() => this.onChange(false))); + this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => { let oldIsEnabled = this._isEnabled; this._isEnabled = this._editor.getConfiguration().contribInfo.outlineMarkers; if (oldIsEnabled !== this._isEnabled) { @@ -193,7 +193,7 @@ export class OutlineMarkerContribution implements editorCommon.IEditorContributi }); }, 250); this._localToDispose.push(scheduler); - this._localToDispose.push(this._editor.onDidModelContentChange(() => { + this._localToDispose.push(this._editor.onDidChangeModelContent(() => { // Synchronously move markers this._editor.changeViewZones((viewAccessor) => { diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts index 8c16f9b3307..a0281c79dcb 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts @@ -42,9 +42,9 @@ export class ParameterHintsModel extends Disposable { this.active = false; - this._register(this.editor.onDidModelChange(e => this.onModelChanged())); - this._register(this.editor.onDidModelModeChange(_ => this.onModelChanged())); - this._register(this.editor.onDidCursorSelectionChange(e => this.onCursorChange(e))); + this._register(this.editor.onDidChangeModel(e => this.onModelChanged())); + this._register(this.editor.onDidChangeModelMode(_ => this.onModelChanged())); + this._register(this.editor.onDidChangeCursorSelection(e => this.onCursorChange(e))); this._register(SignatureHelpProviderRegistry.onDidChange(this.onModelChanged, this)); this.onModelChanged(); } diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts index b9c45f4501c..28e4e7d96c0 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts @@ -100,14 +100,14 @@ export class ParameterHintsWidget implements IContentWidget { this.editor.addContentWidget(this); this.hide(); - this.toDispose.push(this.editor.onDidCursorSelectionChange((e: ICursorSelectionChangedEvent) => { + this.toDispose.push(this.editor.onDidChangeCursorSelection((e: ICursorSelectionChangedEvent) => { if (this.isVisible) { this.editor.layoutContentWidget(this); } })); this.editor.applyFontInfo(this.getDomNode()); - this.toDispose.push(this.editor.onDidConfigurationChange((e: IConfigurationChangedEvent) => { + this.toDispose.push(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { if (e.fontInfo) { this.editor.applyFontInfo(this.getDomNode()); } diff --git a/src/vs/editor/contrib/quickFix/browser/quickFixModel.ts b/src/vs/editor/contrib/quickFix/browser/quickFixModel.ts index 3567b2895b7..9d24ee30e99 100644 --- a/src/vs/editor/contrib/quickFix/browser/quickFixModel.ts +++ b/src/vs/editor/contrib/quickFix/browser/quickFixModel.ts @@ -78,8 +78,8 @@ export class QuickFixModel extends EventEmitter { this.autoSuggestDelay = 300; } - this.toDispose.push(this.editor.onDidModelChange(() => this.onModelChanged())); - this.toDispose.push(this.editor.onDidModelModeChange(() => this.onModelChanged())); + this.toDispose.push(this.editor.onDidChangeModel(() => this.onModelChanged())); + this.toDispose.push(this.editor.onDidChangeModelMode(() => this.onModelChanged())); this.toDispose.push(CodeActionProviderRegistry.onDidChange(this.onModelChanged, this)); } @@ -98,7 +98,7 @@ export class QuickFixModel extends EventEmitter { this.markerService.onMarkerChanged(this.onMarkerChanged, this, this.toLocalDispose); - this.toLocalDispose.push(this.editor.onDidCursorPositionChange((e: ICursorPositionChangedEvent) => { + this.toLocalDispose.push(this.editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { this.onCursorPositionChanged(); })); } diff --git a/src/vs/editor/contrib/quickFix/browser/quickFixSelectionWidget.ts b/src/vs/editor/contrib/quickFix/browser/quickFixSelectionWidget.ts index eed53aa1587..03b02bd9643 100644 --- a/src/vs/editor/contrib/quickFix/browser/quickFixSelectionWidget.ts +++ b/src/vs/editor/contrib/quickFix/browser/quickFixSelectionWidget.ts @@ -313,7 +313,7 @@ export class QuickFixSelectionWidget implements IContentWidget { this.editor.addContentWidget(this); - this.listenersToRemove.push(this.editor.onDidCursorSelectionChange((e: ICursorSelectionChangedEvent) => { + this.listenersToRemove.push(this.editor.onDidChangeCursorSelection((e: ICursorSelectionChangedEvent) => { if (this.isActive) { this.editor.layoutContentWidget(this); } diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts index 23c5d62212b..590462d715e 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts @@ -92,8 +92,8 @@ export class ReferencesController implements editorCommon.IEditorContribution { this._referenceSearchVisible.set(true); // close the widget on model/mode changes - this._disposables.push(this._editor.onDidModelModeChange(() => { this.closeWidget(); })); - this._disposables.push(this._editor.onDidModelChange(() => { + this._disposables.push(this._editor.onDidChangeModelMode(() => { this.closeWidget(); })); + this._disposables.push(this._editor.onDidChangeModel(() => { if(!this._ignoreModelChangeEvent) { this.closeWidget(); } diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts index 4961a9dc43a..b998fad3013 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts @@ -52,7 +52,7 @@ class DecorationsManager implements IDisposable { private _callOnModelChange:IDisposable[] = []; constructor(private editor:ICodeEditor, private model:ReferencesModel) { - this._callOnDispose.push(this.editor.onDidModelChange(() => this._onModelChanged())); + this._callOnDispose.push(this.editor.onDidChangeModel(() => this._onModelChanged())); this._onModelChanged(); } diff --git a/src/vs/editor/contrib/rename/browser/renameInputField.ts b/src/vs/editor/contrib/rename/browser/renameInputField.ts index 45c82361333..61bd78d4f87 100644 --- a/src/vs/editor/contrib/rename/browser/renameInputField.ts +++ b/src/vs/editor/contrib/rename/browser/renameInputField.ts @@ -116,8 +116,8 @@ export default class RenameInputField implements IContentWidget, IDisposable { } }; - disposeOnDone.push(this._editor.onDidCursorSelectionChange(onCursorChanged)); - disposeOnDone.push(this._editor.onDidEditorBlur(this._currentCancelInput)); + disposeOnDone.push(this._editor.onDidChangeCursorSelection(onCursorChanged)); + disposeOnDone.push(this._editor.onDidBlurEditor(this._currentCancelInput)); this._show(); diff --git a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts b/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts index 94673ab4820..9d1664fff9e 100644 --- a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts +++ b/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts @@ -25,7 +25,7 @@ class SelectionClipboard extends Disposable implements IEditorContribution { if (platform.isLinux) { var isEnabled = editor.getConfiguration().contribInfo.selectionClipboard; - this._register(editor.onDidConfigurationChange((e:IConfigurationChangedEvent) => { + this._register(editor.onDidChangeConfiguration((e:IConfigurationChangedEvent) => { if (e.contribInfo) { isEnabled = editor.getConfiguration().contribInfo.selectionClipboard; } @@ -81,7 +81,7 @@ class SelectionClipboard extends Disposable implements IEditorContribution { clipboard.writeText(textToCopy, 'selection'); }, 100)); - this._register(editor.onDidCursorSelectionChange((e:ICursorSelectionChangedEvent) => { + this._register(editor.onDidChangeCursorSelection((e:ICursorSelectionChangedEvent) => { if (!isEnabled) { return; } diff --git a/src/vs/editor/contrib/smartSelect/common/smartSelect.ts b/src/vs/editor/contrib/smartSelect/common/smartSelect.ts index 4f274873c66..c822f7bc024 100644 --- a/src/vs/editor/contrib/smartSelect/common/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/common/smartSelect.ts @@ -98,7 +98,7 @@ class SmartSelect extends EditorAction { state = editorState; // listen to caret move and forget about state - var unhook = this.editor.onDidCursorPositionChange((e: ICursorPositionChangedEvent) => { + var unhook = this.editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { if (ignoreSelection) { return; } diff --git a/src/vs/editor/contrib/snippet/common/snippet.ts b/src/vs/editor/contrib/snippet/common/snippet.ts index 2fffeec2c8d..22792bbeac1 100644 --- a/src/vs/editor/contrib/snippet/common/snippet.ts +++ b/src/vs/editor/contrib/snippet/common/snippet.ts @@ -460,7 +460,7 @@ class InsertSnippetController { }); this.listenersToRemove = []; - this.listenersToRemove.push(this.editor.onDidModelContentChange((e:editorCommon.IModelContentChangedEvent) => { + this.listenersToRemove.push(this.editor.onDidChangeModelContent((e:editorCommon.IModelContentChangedEvent) => { if (this.isFinished) { return; } @@ -502,7 +502,7 @@ class InsertSnippetController { } })); - this.listenersToRemove.push(this.editor.onDidCursorPositionChange((e:editorCommon.ICursorPositionChangedEvent) => { + this.listenersToRemove.push(this.editor.onDidChangeCursorPosition((e:editorCommon.ICursorPositionChangedEvent) => { if (this.isFinished) { return; } @@ -513,19 +513,19 @@ class InsertSnippetController { } })); - this.listenersToRemove.push(this.editor.onDidModelChange(() => { + this.listenersToRemove.push(this.editor.onDidChangeModel(() => { this.stopAll(); })); var blurTimeout = -1; - this.listenersToRemove.push(this.editor.onDidEditorBlur(() => { + this.listenersToRemove.push(this.editor.onDidBlurEditor(() => { // Blur if within 100ms we do not focus back blurTimeout = setTimeout(() => { this.stopAll(); }, 100); })); - this.listenersToRemove.push(this.editor.onDidEditorFocus(() => { + this.listenersToRemove.push(this.editor.onDidFocusEditor(() => { // Cancel the blur timeout (if any) if (blurTimeout !== -1) { clearTimeout(blurTimeout); diff --git a/src/vs/editor/contrib/suggest/browser/suggest.ts b/src/vs/editor/contrib/suggest/browser/suggest.ts index 70b98b6a701..d54ac1d59ac 100644 --- a/src/vs/editor/contrib/suggest/browser/suggest.ts +++ b/src/vs/editor/contrib/suggest/browser/suggest.ts @@ -50,9 +50,9 @@ export class SuggestController implements IEditorContribution { this.toDispose = []; this.toDispose.push(this.widget.onDidVisibilityChange(visible => visible ? this.suggestWidgetVisible.set(true) : this.suggestWidgetVisible.reset())); - this.toDispose.push(editor.onDidConfigurationChange(() => this.update())); - this.toDispose.push(editor.onDidModelChange(() => this.update())); - this.toDispose.push(editor.onDidModelModeChange(() => this.update())); + this.toDispose.push(editor.onDidChangeConfiguration(() => this.update())); + this.toDispose.push(editor.onDidChangeModel(() => this.update())); + this.toDispose.push(editor.onDidChangeModelMode(() => this.update())); this.toDispose.push(SuggestRegistry.onDidChange(this.update, this)); this.toDispose.push(this.model.onDidAccept(e => getSnippetController(this.editor).run(e.snippet, e.overwriteBefore, e.overwriteAfter))); diff --git a/src/vs/editor/contrib/suggest/browser/suggestModel.ts b/src/vs/editor/contrib/suggest/browser/suggestModel.ts index fccd01c8a00..91395042691 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestModel.ts @@ -196,9 +196,9 @@ export class SuggestModel implements IDisposable { this.context = null; this.toDispose = []; - this.toDispose.push(this.editor.onDidConfigurationChange(() => this.onEditorConfigurationChange())); - this.toDispose.push(this.editor.onDidCursorSelectionChange(e => this.onCursorChange(e))); - this.toDispose.push(this.editor.onDidModelChange(() => this.cancel())); + this.toDispose.push(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange())); + this.toDispose.push(this.editor.onDidChangeCursorSelection(e => this.onCursorChange(e))); + this.toDispose.push(this.editor.onDidChangeModel(() => this.cancel())); this.toDispose.push(SuggestRegistry.onDidChange(this.onSuggestRegistryChange, this)); this.onEditorConfigurationChange(); } diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 63f057a96ee..0d88790db16 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -81,7 +81,7 @@ class Renderer implements IRenderer { configureFont(); - data.disposables.push(this.editor.onDidConfigurationChange((e: IConfigurationChangedEvent) => { + data.disposables.push(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { if (e.fontInfo) { configureFont(); } @@ -231,7 +231,7 @@ class SuggestionDetails { this.configureFont(); - this.disposables.push(this.editor.onDidConfigurationChange((e: IConfigurationChangedEvent) => { + this.disposables.push(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { if (e.fontInfo) { this.configureFont(); } @@ -369,10 +369,10 @@ export class SuggestWidget implements IContentWidget, IDisposable { this.list = new List(this.listElement, this.delegate, [renderer]); this.toDispose = [ - editor.onDidEditorTextBlur(() => this.onEditorBlur()), + editor.onDidBlurEditorText(() => this.onEditorBlur()), this.list.onSelectionChange(e => this.onListSelection(e)), this.list.onFocusChange(e => this.onListFocus(e)), - this.editor.onDidCursorSelectionChange(() => this.onCursorSelectionChanged()), + this.editor.onDidChangeCursorSelection(() => this.onCursorSelectionChanged()), this.model.onDidTrigger(e => this.onDidTrigger(e)), this.model.onDidSuggest(e => this.onDidSuggest(e)), this.model.onDidCancel(e => this.onDidCancel(e)) diff --git a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts index 15c46a28b13..6112b03274b 100644 --- a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts @@ -64,14 +64,14 @@ class WordHighlighter { this.editor = editor; this.model = this.editor.getModel(); this.toUnhook = []; - this.toUnhook.push(editor.onDidCursorPositionChange((e:editorCommon.ICursorPositionChangedEvent) => { + this.toUnhook.push(editor.onDidChangeCursorPosition((e:editorCommon.ICursorPositionChangedEvent) => { this._onPositionChanged(e); })); - this.toUnhook.push(editor.onDidModelChange((e) => { + this.toUnhook.push(editor.onDidChangeModel((e) => { this._stopAll(); this.model = this.editor.getModel(); })); - this.toUnhook.push(editor.onDidModelContentChange((e) => { + this.toUnhook.push(editor.onDidChangeModelContent((e) => { this._stopAll(); })); diff --git a/src/vs/workbench/api/node/mainThreadEditors.ts b/src/vs/workbench/api/node/mainThreadEditors.ts index 7a5e44a89d3..84cd9edf480 100644 --- a/src/vs/workbench/api/node/mainThreadEditors.ts +++ b/src/vs/workbench/api/node/mainThreadEditors.ts @@ -128,7 +128,7 @@ export class MainThreadTextEditor { if (this._codeEditor) { // Catch early the case that this code editor gets a different model set and disassociate from this model - this._codeEditorListeners.push(this._codeEditor.onDidModelChange(() => { + this._codeEditorListeners.push(this._codeEditor.onDidChangeModel(() => { this.setCodeEditor(null); })); @@ -136,17 +136,17 @@ export class MainThreadTextEditor { this._lastSelection = this._codeEditor.getSelections(); this._onSelectionChanged.fire(this._lastSelection); }; - this._codeEditorListeners.push(this._codeEditor.onDidCursorSelectionChange(forwardSelection)); + this._codeEditorListeners.push(this._codeEditor.onDidChangeCursorSelection(forwardSelection)); if (!Selection.selectionsArrEqual(this._lastSelection, this._codeEditor.getSelections())) { forwardSelection(); } - this._codeEditorListeners.push(this._codeEditor.onDidEditorFocus(() => { + this._codeEditorListeners.push(this._codeEditor.onDidFocusEditor(() => { this._focusTracker.onGainedFocus(); })); - this._codeEditorListeners.push(this._codeEditor.onDidEditorBlur(() => { + this._codeEditorListeners.push(this._codeEditor.onDidBlurEditor(() => { this._focusTracker.onLostFocus(); })); - this._codeEditorListeners.push(this._codeEditor.onDidConfigurationChange(() => { + this._codeEditorListeners.push(this._codeEditor.onDidChangeConfiguration(() => { this._setConfiguration(this._readConfiguration(this._model, this._codeEditor)); })); this._setConfiguration(this._readConfiguration(this._model, this._codeEditor)); @@ -405,7 +405,7 @@ export class MainThreadEditorsTracker { } private _onCodeEditorAdd(codeEditor: EditorCommon.ICommonCodeEditor): void { - this._editorModelChangeListeners[codeEditor.getId()] = codeEditor.onDidModelChange(_ => this._updateMapping.schedule()); + this._editorModelChangeListeners[codeEditor.getId()] = codeEditor.onDidChangeModel(_ => this._updateMapping.schedule()); this._updateMapping.schedule(); } diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index d93998ee6c4..05cb59d09ef 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -134,28 +134,28 @@ export abstract class BaseTextEditor extends BaseEditor { this.editorControl = this.createEditorControl(parent); // Hook Listener for Selection changes - this.toUnbind.push(this.editorControl.onDidCursorPositionChange((event: ICursorPositionChangedEvent) => { + this.toUnbind.push(this.editorControl.onDidChangeCursorPosition((event: ICursorPositionChangedEvent) => { let selection = this.editorControl.getSelection(); this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_SELECTION_CHANGED, new TextEditorSelectionEvent(selection, this, this.getId(), this.input, null, this.position, event)); })); // Hook Listener for mode changes - this.toUnbind.push(this.editorControl.onDidModelModeChange((event: IModelModeChangedEvent) => { + this.toUnbind.push(this.editorControl.onDidChangeModelMode((event: IModelModeChangedEvent) => { this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_MODE_CHANGED, new EditorEvent(this, this.getId(), this.input, null, this.position, event)); })); // Hook Listener for content changes - this.toUnbind.push(this.editorControl.onDidModelContentChange((event: IModelContentChangedEvent) => { + this.toUnbind.push(this.editorControl.onDidChangeModelContent((event: IModelContentChangedEvent) => { this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_CONTENT_CHANGED, new EditorEvent(this, this.getId(), this.input, null, this.position, event)); })); // Hook Listener for content options changes - this.toUnbind.push(this.editorControl.onDidModelOptionsChange((event: IModelOptionsChangedEvent) => { + this.toUnbind.push(this.editorControl.onDidChangeModelOptions((event: IModelOptionsChangedEvent) => { this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_CONTENT_OPTIONS_CHANGED, new EditorEvent(this, this.getId(), this.input, null, this.position, event)); })); // Hook Listener for options changes - this.toUnbind.push(this.editorControl.onDidConfigurationChange((event: IConfigurationChangedEvent) => { + this.toUnbind.push(this.editorControl.onDidChangeConfiguration((event: IConfigurationChangedEvent) => { this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_CONFIGURATION_CHANGED, new EditorEvent(this, this.getId(), this.input, null, this.position, event)); })); diff --git a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts index c6fa9c8caf7..edd9f88d0c2 100644 --- a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts +++ b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts @@ -45,7 +45,7 @@ export class BreakpointWidget extends ZoneWidget { this.breakpointWidgetVisible = keybindingService.createKey(CONTEXT_BREAKPOINT_WIDGET_VISIBLE, false); this.breakpointWidgetVisible.set(true); BreakpointWidget.INSTANCE = this; - this.toDispose.push(editor.onDidModelChange(() => this.dispose())); + this.toDispose.push(editor.onDidChangeModel(() => this.dispose())); } public static createInstance(editor: editorbrowser.ICodeEditor, lineNumber: number, instantiationService: IInstantiationService): void { diff --git a/src/vs/workbench/parts/debug/browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/browser/debugEditorContribution.ts index 3062cea6e68..3b4f88d8d43 100644 --- a/src/vs/workbench/parts/debug/browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/browser/debugEditorContribution.ts @@ -126,7 +126,7 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution { this.toDispose.push(this.editor.onMouseMove((e: editorbrowser.IEditorMouseEvent) => this.onEditorMouseMove(e))); this.toDispose.push(this.editor.onMouseLeave((e: editorbrowser.IEditorMouseEvent) => this.hoverWidget.hide())); this.toDispose.push(this.editor.onKeyDown((e: keyboard.IKeyboardEvent) => this.onKeyDown(e))); - this.toDispose.push(this.editor.onDidModelChange(() => this.hideHoverWidget())); + this.toDispose.push(this.editor.onDidChangeModel(() => this.hideHoverWidget())); this.toDispose.push(this.editor.onDidScrollChange(() => this.hideHoverWidget)); } diff --git a/src/vs/workbench/parts/debug/browser/debugHover.ts b/src/vs/workbench/parts/debug/browser/debugHover.ts index a237d60342e..7e111d588a7 100644 --- a/src/vs/workbench/parts/debug/browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/browser/debugHover.ts @@ -85,7 +85,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { this.hide(); } })); - this.toDispose.push(this.editor.onDidConfigurationChange((e: IConfigurationChangedEvent) => { + this.toDispose.push(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { if (e.fontInfo) { this.editor.applyFontInfo(this.domNode); } diff --git a/src/vs/workbench/parts/git/browser/gitActions.contribution.ts b/src/vs/workbench/parts/git/browser/gitActions.contribution.ts index 914aff6ec27..477604fb253 100644 --- a/src/vs/workbench/parts/git/browser/gitActions.contribution.ts +++ b/src/vs/workbench/parts/git/browser/gitActions.contribution.ts @@ -255,7 +255,7 @@ export class StageRangesAction extends baseeditor.EditorInputAction { this.editorService = editorService; this.gitService = gitService; this.editor = editor.getControl(); - this.editor.onDidCursorSelectionChange(() => this.updateEnablement()); + this.editor.onDidChangeCursorSelection(() => this.updateEnablement()); this.editor.onDidUpdateDiff(() => this.updateEnablement()); this.class = 'git-action stage-ranges'; } diff --git a/src/vs/workbench/parts/git/browser/gitEditorContributions.ts b/src/vs/workbench/parts/git/browser/gitEditorContributions.ts index 176c50669fd..edaf3d86998 100644 --- a/src/vs/workbench/parts/git/browser/gitEditorContributions.ts +++ b/src/vs/workbench/parts/git/browser/gitEditorContributions.ts @@ -98,7 +98,7 @@ export class MergeDecorator implements common.IEditorContribution { this.gitService = gitService; this.contextService = contextService; this.editor = editor; - this.toUnbind = [ this.editor.onDidModelChange(() => this.onModelChanged()) ]; + this.toUnbind = [ this.editor.onDidChangeModel(() => this.onModelChanged()) ]; this.mergeDecorator = null; }