Skip to content

Commit

Permalink
Event naming should be onDidVerbNoun
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed May 25, 2016
1 parent 3fa0a5b commit 4730f96
Show file tree
Hide file tree
Showing 43 changed files with 137 additions and 137 deletions.
12 changes: 6 additions & 6 deletions src/vs/editor/browser/widget/diffEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
26 changes: 13 additions & 13 deletions src/vs/editor/common/commonCodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions src/vs/editor/common/editorActionEnablement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}

Expand Down Expand Up @@ -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()));
}
}

Expand Down
26 changes: 13 additions & 13 deletions src/vs/editor/common/editorCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/clipboard/browser/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}));
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/contrib/codelens/browser/codelens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/vs/editor/contrib/color/browser/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}));

Expand Down Expand Up @@ -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()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ 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;
}
this.nextIdx = -1;
}));
}
if(this.options.alwaysRevealFirst) {
this.toUnbind.push(this.editor.getModifiedEditor().onDidModelChange((e) => {
this.toUnbind.push(this.editor.getModifiedEditor().onDidChangeModel((e) => {
this.revealFirst = true;
}));
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/find/browser/findWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/contrib/find/common/findController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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())) {
Expand All @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/find/common/findModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
Loading

0 comments on commit 4730f96

Please sign in to comment.