Skip to content

Commit b6c2269

Browse files
authored
1 parent 9a188c9 commit b6c2269

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/vs/editor/browser/widget/codeEditorWidget.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
118118
//#region Eventing
119119

120120
private readonly _deliveryQueue = new EventDeliveryQueue();
121-
protected readonly _contributions2: CodeEditorContributions = this._register(new CodeEditorContributions());
121+
protected readonly _contributions: CodeEditorContributions = this._register(new CodeEditorContributions());
122122

123123
private readonly _onDidDispose: Emitter<void> = this._register(new Emitter<void>());
124124
public readonly onDidDispose: Event<void> = this._onDidDispose.event;
@@ -153,7 +153,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
153153
private readonly _onDidChangeCursorSelection: Emitter<ICursorSelectionChangedEvent> = this._register(new Emitter<ICursorSelectionChangedEvent>({ deliveryQueue: this._deliveryQueue }));
154154
public readonly onDidChangeCursorSelection: Event<ICursorSelectionChangedEvent> = this._onDidChangeCursorSelection.event;
155155

156-
private readonly _onDidAttemptReadOnlyEdit: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions2, this._deliveryQueue));
156+
private readonly _onDidAttemptReadOnlyEdit: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions, this._deliveryQueue));
157157
public readonly onDidAttemptReadOnlyEdit: Event<void> = this._onDidAttemptReadOnlyEdit.event;
158158

159159
private readonly _onDidLayoutChange: Emitter<EditorLayoutInfo> = this._register(new Emitter<EditorLayoutInfo>({ deliveryQueue: this._deliveryQueue }));
@@ -167,55 +167,55 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
167167
public readonly onDidFocusEditorWidget: Event<void> = this._editorWidgetFocus.onDidChangeToTrue;
168168
public readonly onDidBlurEditorWidget: Event<void> = this._editorWidgetFocus.onDidChangeToFalse;
169169

170-
private readonly _onWillType: Emitter<string> = this._register(new InteractionEmitter<string>(this._contributions2, this._deliveryQueue));
170+
private readonly _onWillType: Emitter<string> = this._register(new InteractionEmitter<string>(this._contributions, this._deliveryQueue));
171171
public readonly onWillType = this._onWillType.event;
172172

173-
private readonly _onDidType: Emitter<string> = this._register(new InteractionEmitter<string>(this._contributions2, this._deliveryQueue));
173+
private readonly _onDidType: Emitter<string> = this._register(new InteractionEmitter<string>(this._contributions, this._deliveryQueue));
174174
public readonly onDidType = this._onDidType.event;
175175

176-
private readonly _onDidCompositionStart: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions2, this._deliveryQueue));
176+
private readonly _onDidCompositionStart: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions, this._deliveryQueue));
177177
public readonly onDidCompositionStart = this._onDidCompositionStart.event;
178178

179-
private readonly _onDidCompositionEnd: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions2, this._deliveryQueue));
179+
private readonly _onDidCompositionEnd: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions, this._deliveryQueue));
180180
public readonly onDidCompositionEnd = this._onDidCompositionEnd.event;
181181

182-
private readonly _onDidPaste: Emitter<editorBrowser.IPasteEvent> = this._register(new InteractionEmitter<editorBrowser.IPasteEvent>(this._contributions2, this._deliveryQueue));
182+
private readonly _onDidPaste: Emitter<editorBrowser.IPasteEvent> = this._register(new InteractionEmitter<editorBrowser.IPasteEvent>(this._contributions, this._deliveryQueue));
183183
public readonly onDidPaste = this._onDidPaste.event;
184184

185-
private readonly _onMouseUp: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions2, this._deliveryQueue));
185+
private readonly _onMouseUp: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions, this._deliveryQueue));
186186
public readonly onMouseUp: Event<editorBrowser.IEditorMouseEvent> = this._onMouseUp.event;
187187

188-
private readonly _onMouseDown: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions2, this._deliveryQueue));
188+
private readonly _onMouseDown: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions, this._deliveryQueue));
189189
public readonly onMouseDown: Event<editorBrowser.IEditorMouseEvent> = this._onMouseDown.event;
190190

191-
private readonly _onMouseDrag: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions2, this._deliveryQueue));
191+
private readonly _onMouseDrag: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions, this._deliveryQueue));
192192
public readonly onMouseDrag: Event<editorBrowser.IEditorMouseEvent> = this._onMouseDrag.event;
193193

194-
private readonly _onMouseDrop: Emitter<editorBrowser.IPartialEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IPartialEditorMouseEvent>(this._contributions2, this._deliveryQueue));
194+
private readonly _onMouseDrop: Emitter<editorBrowser.IPartialEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IPartialEditorMouseEvent>(this._contributions, this._deliveryQueue));
195195
public readonly onMouseDrop: Event<editorBrowser.IPartialEditorMouseEvent> = this._onMouseDrop.event;
196196

197-
private readonly _onMouseDropCanceled: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions2, this._deliveryQueue));
197+
private readonly _onMouseDropCanceled: Emitter<void> = this._register(new InteractionEmitter<void>(this._contributions, this._deliveryQueue));
198198
public readonly onMouseDropCanceled: Event<void> = this._onMouseDropCanceled.event;
199199

200-
private readonly _onDropIntoEditor = this._register(new InteractionEmitter<{ readonly position: IPosition; readonly event: DragEvent }>(this._contributions2, this._deliveryQueue));
200+
private readonly _onDropIntoEditor = this._register(new InteractionEmitter<{ readonly position: IPosition; readonly event: DragEvent }>(this._contributions, this._deliveryQueue));
201201
public readonly onDropIntoEditor = this._onDropIntoEditor.event;
202202

203-
private readonly _onContextMenu: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions2, this._deliveryQueue));
203+
private readonly _onContextMenu: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions, this._deliveryQueue));
204204
public readonly onContextMenu: Event<editorBrowser.IEditorMouseEvent> = this._onContextMenu.event;
205205

206-
private readonly _onMouseMove: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions2, this._deliveryQueue));
206+
private readonly _onMouseMove: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IEditorMouseEvent>(this._contributions, this._deliveryQueue));
207207
public readonly onMouseMove: Event<editorBrowser.IEditorMouseEvent> = this._onMouseMove.event;
208208

209-
private readonly _onMouseLeave: Emitter<editorBrowser.IPartialEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IPartialEditorMouseEvent>(this._contributions2, this._deliveryQueue));
209+
private readonly _onMouseLeave: Emitter<editorBrowser.IPartialEditorMouseEvent> = this._register(new InteractionEmitter<editorBrowser.IPartialEditorMouseEvent>(this._contributions, this._deliveryQueue));
210210
public readonly onMouseLeave: Event<editorBrowser.IPartialEditorMouseEvent> = this._onMouseLeave.event;
211211

212-
private readonly _onMouseWheel: Emitter<IMouseWheelEvent> = this._register(new InteractionEmitter<IMouseWheelEvent>(this._contributions2, this._deliveryQueue));
212+
private readonly _onMouseWheel: Emitter<IMouseWheelEvent> = this._register(new InteractionEmitter<IMouseWheelEvent>(this._contributions, this._deliveryQueue));
213213
public readonly onMouseWheel: Event<IMouseWheelEvent> = this._onMouseWheel.event;
214214

215-
private readonly _onKeyUp: Emitter<IKeyboardEvent> = this._register(new InteractionEmitter<IKeyboardEvent>(this._contributions2, this._deliveryQueue));
215+
private readonly _onKeyUp: Emitter<IKeyboardEvent> = this._register(new InteractionEmitter<IKeyboardEvent>(this._contributions, this._deliveryQueue));
216216
public readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;
217217

218-
private readonly _onKeyDown: Emitter<IKeyboardEvent> = this._register(new InteractionEmitter<IKeyboardEvent>(this._contributions2, this._deliveryQueue));
218+
private readonly _onKeyDown: Emitter<IKeyboardEvent> = this._register(new InteractionEmitter<IKeyboardEvent>(this._contributions, this._deliveryQueue));
219219
public readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
220220

221221
private readonly _onDidContentSizeChange: Emitter<editorCommon.IContentSizeChangedEvent> = this._register(new Emitter<editorCommon.IContentSizeChangedEvent>({ deliveryQueue: this._deliveryQueue }));
@@ -332,7 +332,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
332332
} else {
333333
contributions = EditorExtensionsRegistry.getEditorContributions();
334334
}
335-
this._contributions2.initialize(this, contributions, this._instantiationService);
335+
this._contributions.initialize(this, contributions, this._instantiationService);
336336

337337
for (const action of EditorExtensionsRegistry.getEditorActions()) {
338338
if (this._actions.has(action.id)) {
@@ -512,7 +512,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
512512
this._onDidChangeModel.fire(e);
513513
this._postDetachModelCleanup(detachedModel);
514514

515-
this._contributions2.onAfterModelAttached();
515+
this._contributions.onAfterModelAttached();
516516
}
517517

518518
private _removeDecorationTypes(): void {
@@ -979,7 +979,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
979979
if (!this._modelData) {
980980
return null;
981981
}
982-
const contributionsState = this._contributions2.saveViewState();
982+
const contributionsState = this._contributions.saveViewState();
983983
const cursorState = this._modelData.viewModel.saveCursorState();
984984
const viewState = this._modelData.viewModel.saveState();
985985
return {
@@ -1005,7 +1005,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
10051005
this._modelData.viewModel.restoreCursorState([<editorCommon.ICursorState>cursorState]);
10061006
}
10071007

1008-
this._contributions2.restoreViewState(codeEditorState.contributionsState || {});
1008+
this._contributions.restoreViewState(codeEditorState.contributionsState || {});
10091009
const reducedState = this._modelData.viewModel.reduceRestoreState(codeEditorState.viewState);
10101010
this._modelData.view.restoreState(reducedState);
10111011
}
@@ -1021,7 +1021,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
10211021
}
10221022

10231023
public getContribution<T extends editorCommon.IEditorContribution>(id: string): T | null {
1024-
return this._contributions2.get(id) as T | null;
1024+
return this._contributions.get(id) as T | null;
10251025
}
10261026

10271027
public getActions(): editorCommon.IEditorAction[] {

src/vs/editor/test/browser/testCodeEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class TestCodeEditor extends CodeEditorWidget implements ICodeEditor {
8787
}
8888
public registerAndInstantiateContribution<T extends IEditorContribution>(id: string, ctor: new (editor: ICodeEditor, ...services: BrandedService[]) => T): T {
8989
const r: T = this._instantiationService.createInstance(ctor, this);
90-
this._contributions2.set(id, r);
90+
this._contributions.set(id, r);
9191
return r;
9292
}
9393
public registerDisposable(disposable: IDisposable): void {

0 commit comments

Comments
 (0)