Skip to content

Commit c0b8498

Browse files
authored
Merge pull request microsoft#262780 from mjbvz/retired-tortoise
Convert most top hitting eager event creations to use getters
2 parents 715d6f3 + 3763f08 commit c0b8498

File tree

22 files changed

+53
-53
lines changed

22 files changed

+53
-53
lines changed

src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
4747
private actionItem: HTMLElement | null = null;
4848

4949
private _onDidChangeVisibility = this._register(new Emitter<boolean>());
50-
readonly onDidChangeVisibility = this._onDidChangeVisibility.event;
50+
get onDidChangeVisibility() { return this._onDidChangeVisibility.event; }
5151

5252
protected override readonly options: IDropdownMenuActionViewItemOptions;
5353

src/vs/base/browser/ui/findinput/findInput.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,25 @@ export class FindInput extends Widget {
6363
public readonly inputBox: HistoryInputBox;
6464

6565
private readonly _onDidOptionChange = this._register(new Emitter<boolean>());
66-
public readonly onDidOptionChange: Event<boolean /* via keyboard */> = this._onDidOptionChange.event;
66+
public get onDidOptionChange(): Event<boolean /* via keyboard */> { return this._onDidOptionChange.event; }
6767

6868
private readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());
69-
public readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
69+
public get onKeyDown(): Event<IKeyboardEvent> { return this._onKeyDown.event; }
7070

7171
private readonly _onMouseDown = this._register(new Emitter<IMouseEvent>());
72-
public readonly onMouseDown: Event<IMouseEvent> = this._onMouseDown.event;
72+
public get onMouseDown(): Event<IMouseEvent> { return this._onMouseDown.event; }
7373

7474
private readonly _onInput = this._register(new Emitter<void>());
75-
public readonly onInput: Event<void> = this._onInput.event;
75+
public get onInput(): Event<void> { return this._onInput.event; }
7676

7777
private readonly _onKeyUp = this._register(new Emitter<IKeyboardEvent>());
78-
public readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;
78+
public get onKeyUp(): Event<IKeyboardEvent> { return this._onKeyUp.event; }
7979

8080
private _onCaseSensitiveKeyDown = this._register(new Emitter<IKeyboardEvent>());
81-
public readonly onCaseSensitiveKeyDown: Event<IKeyboardEvent> = this._onCaseSensitiveKeyDown.event;
81+
public get onCaseSensitiveKeyDown(): Event<IKeyboardEvent> { return this._onCaseSensitiveKeyDown.event; }
8282

8383
private _onRegexKeyDown = this._register(new Emitter<IKeyboardEvent>());
84-
public readonly onRegexKeyDown: Event<IKeyboardEvent> = this._onRegexKeyDown.event;
84+
public get onRegexKeyDown(): Event<IKeyboardEvent> { return this._onRegexKeyDown.event; }
8585

8686
constructor(parent: HTMLElement | null, contextViewProvider: IContextViewProvider | undefined, options: IFindInputOptions) {
8787
super();

src/vs/base/browser/ui/findinput/replaceInput.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ export class ReplaceInput extends Widget {
7070
public inputBox: HistoryInputBox;
7171

7272
private readonly _onDidOptionChange = this._register(new Emitter<boolean>());
73-
public readonly onDidOptionChange: Event<boolean /* via keyboard */> = this._onDidOptionChange.event;
73+
public get onDidOptionChange(): Event<boolean /* via keyboard */> { return this._onDidOptionChange.event; }
7474

7575
private readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());
76-
public readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
76+
public get onKeyDown(): Event<IKeyboardEvent> { return this._onKeyDown.event; }
7777

7878
private readonly _onMouseDown = this._register(new Emitter<IMouseEvent>());
79-
public readonly onMouseDown: Event<IMouseEvent> = this._onMouseDown.event;
79+
public get onMouseDown(): Event<IMouseEvent> { return this._onMouseDown.event; }
8080

8181
private readonly _onInput = this._register(new Emitter<void>());
82-
public readonly onInput: Event<void> = this._onInput.event;
82+
public get onInput(): Event<void> { return this._onInput.event; }
8383

8484
private readonly _onKeyUp = this._register(new Emitter<IKeyboardEvent>());
85-
public readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;
85+
public get onKeyUp(): Event<IKeyboardEvent> { return this._onKeyUp.event; }
8686

8787
private _onPreserveCaseKeyDown = this._register(new Emitter<IKeyboardEvent>());
88-
public readonly onPreserveCaseKeyDown: Event<IKeyboardEvent> = this._onPreserveCaseKeyDown.event;
88+
public get onPreserveCaseKeyDown(): Event<IKeyboardEvent> { return this._onPreserveCaseKeyDown.event; }
8989

9090
constructor(parent: HTMLElement | null, contextViewProvider: IContextViewProvider | undefined, private readonly _showOptionButtons: boolean, options: IReplaceInputOptions) {
9191
super();

src/vs/base/browser/ui/inputbox/inputBox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ export class InputBox extends Widget {
117117
private readonly hover: MutableDisposable<IDisposable> = this._register(new MutableDisposable());
118118

119119
private _onDidChange = this._register(new Emitter<string>());
120-
public readonly onDidChange: Event<string> = this._onDidChange.event;
120+
public get onDidChange(): Event<string> { return this._onDidChange.event; }
121121

122122
private _onDidHeightChange = this._register(new Emitter<number>());
123-
public readonly onDidHeightChange: Event<number> = this._onDidHeightChange.event;
123+
public get onDidHeightChange(): Event<number> { return this._onDidHeightChange.event; }
124124

125125
constructor(container: HTMLElement, contextViewProvider: IContextViewProvider | undefined, options: IInputOptions) {
126126
super();

src/vs/base/browser/ui/list/listWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Trait<T> implements ISpliceable<boolean>, IDisposable {
120120
protected sortedIndexes: number[] = [];
121121

122122
private readonly _onChange = new Emitter<ITraitChangeEvent>();
123-
readonly onChange: Event<ITraitChangeEvent> = this._onChange.event;
123+
get onChange(): Event<ITraitChangeEvent> { return this._onChange.event; }
124124

125125
get name(): string { return this._trait; }
126126

@@ -676,7 +676,7 @@ export class MouseController<T> implements IDisposable {
676676
private readonly disposables = new DisposableStore();
677677

678678
private readonly _onPointer = this.disposables.add(new Emitter<IListMouseEvent<T>>());
679-
readonly onPointer: Event<IListMouseEvent<T>> = this._onPointer.event;
679+
get onPointer() { return this._onPointer.event; }
680680

681681
constructor(protected list: List<T>) {
682682
if (list.options.multipleSelectionSupport !== false) {

src/vs/base/browser/ui/scrollbar/scrollableElement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ export abstract class AbstractScrollableElement extends Widget {
199199
private _inertialSpeed: { X: number; Y: number } = { X: 0, Y: 0 };
200200

201201
private readonly _onScroll = this._register(new Emitter<ScrollEvent>());
202-
public readonly onScroll: Event<ScrollEvent> = this._onScroll.event;
202+
public get onScroll(): Event<ScrollEvent> { return this._onScroll.event; }
203203

204204
private readonly _onWillScroll = this._register(new Emitter<ScrollEvent>());
205-
public readonly onWillScroll: Event<ScrollEvent> = this._onWillScroll.event;
205+
public get onWillScroll(): Event<ScrollEvent> { return this._onWillScroll.event; }
206206

207207
public get options(): Readonly<ScrollableElementResolvedOptions> {
208208
return this._options;

src/vs/base/browser/ui/toggle/toggle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ export class ToggleActionViewItem extends BaseActionViewItem {
122122
export class Toggle extends Widget {
123123

124124
private readonly _onChange = this._register(new Emitter<boolean>());
125-
readonly onChange: Event<boolean /* via keyboard */> = this._onChange.event;
125+
get onChange(): Event<boolean /* via keyboard */> { return this._onChange.event; }
126126

127127
private readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());
128-
readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
128+
get onKeyDown(): Event<IKeyboardEvent> { return this._onKeyDown.event; }
129129

130130
private readonly _opts: IToggleOpts;
131131
private _icon: ThemeIcon | undefined;

src/vs/base/browser/ui/toolbar/toolbar.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export class ToolBar extends Disposable {
6262

6363
private _onDidChangeDropdownVisibility = this._register(new EventMultiplexer<boolean>());
6464
get onDidChangeDropdownVisibility() { return this._onDidChangeDropdownVisibility.event; }
65-
6665
private readonly disposables = this._register(new DisposableStore());
6766

6867
constructor(container: HTMLElement, contextMenuProvider: IContextMenuProvider, options: IToolBarOptions = { orientation: ActionsOrientation.HORIZONTAL }) {

src/vs/editor/common/languageFeatureRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class LanguageFeatureRegistry<T> {
5959
private readonly _entries: Entry<T>[] = [];
6060

6161
private readonly _onDidChange = new Emitter<number>();
62-
readonly onDidChange = this._onDidChange.event;
62+
get onDidChange() { return this._onDidChange.event; }
6363

6464
constructor(private readonly _notebookInfoResolver?: NotebookInfoResolver) { }
6565

src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class PieceTreeTextBuffer extends Disposable implements ITextBuffer {
3939
private _mightContainNonBasicASCII: boolean;
4040

4141
private readonly _onDidChangeContent: Emitter<void> = this._register(new Emitter<void>());
42-
public readonly onDidChangeContent: Event<void> = this._onDidChangeContent.event;
42+
public get onDidChangeContent(): Event<void> { return this._onDidChangeContent.event; }
4343

4444
constructor(chunks: StringBuffer[], BOM: string, eol: '\r\n' | '\n', containsRTL: boolean, containsUnusualLineTerminators: boolean, isBasicASCII: boolean, eolNormalized: boolean) {
4545
super();

0 commit comments

Comments
 (0)