Skip to content

Commit

Permalink
Add override keyword in codebase (#120755)
Browse files Browse the repository at this point in the history
For #120675

This uses a script to add the override keyword to places that need it in the codebase

Note that we can't enable the --noImplicitOverride setting yet since there are still around 200 errors that require further attention
  • Loading branch information
mjbvz committed Apr 8, 2021
1 parent 604b950 commit e1f0f8f
Show file tree
Hide file tree
Showing 541 changed files with 1,965 additions and 1,965 deletions.
2 changes: 1 addition & 1 deletion src/vs/base/browser/dnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DelayedDragHandler extends Disposable {
}
}

dispose(): void {
override dispose(): void {
super.dispose();

this.clearDragTimeout();
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ export class ModifierKeyEmitter extends Emitter<IModifierKeyStatus> {
return ModifierKeyEmitter.instance;
}

dispose() {
override dispose() {
super.dispose();
this._subscriptions.dispose();
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class Gesture extends Disposable {
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || (window as Window).navigator.msMaxTouchPoints > 0;
}

public dispose(): void {
public override dispose(): void {
if (this.handle) {
this.handle.dispose();
this.handle = null;
Expand Down
30 changes: 15 additions & 15 deletions src/vs/base/browser/ui/actionbar/actionViewItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class BaseActionViewItem extends Disposable implements IActionViewItem {
// implement in subclass
}

dispose(): void {
override dispose(): void {
if (this.element) {
this.element.remove();
this.element = undefined;
Expand All @@ -231,7 +231,7 @@ export interface IActionViewItemOptions extends IBaseActionViewItemOptions {
export class ActionViewItem extends BaseActionViewItem {

protected label: HTMLElement | undefined;
protected options: IActionViewItemOptions;
protected override options: IActionViewItemOptions;

private cssClass?: string;

Expand All @@ -244,7 +244,7 @@ export class ActionViewItem extends BaseActionViewItem {
this.cssClass = '';
}

render(container: HTMLElement): void {
override render(container: HTMLElement): void {
super.render(container);

if (this.element) {
Expand Down Expand Up @@ -276,32 +276,32 @@ export class ActionViewItem extends BaseActionViewItem {

// Only set the tabIndex on the element once it is about to get focused
// That way this element wont be a tab stop when it is not needed #106441
focus(): void {
override focus(): void {
if (this.label) {
this.label.tabIndex = 0;
this.label.focus();
}
}

blur(): void {
override blur(): void {
if (this.label) {
this.label.tabIndex = -1;
}
}

setFocusable(focusable: boolean): void {
override setFocusable(focusable: boolean): void {
if (this.label) {
this.label.tabIndex = focusable ? 0 : -1;
}
}

updateLabel(): void {
override updateLabel(): void {
if (this.options.label && this.label) {
this.label.textContent = this.getAction().label;
}
}

updateTooltip(): void {
override updateTooltip(): void {
let title: string | null = null;

if (this.getAction().tooltip) {
Expand All @@ -320,7 +320,7 @@ export class ActionViewItem extends BaseActionViewItem {
}
}

updateClass(): void {
override updateClass(): void {
if (this.cssClass && this.label) {
this.label.classList.remove(...this.cssClass.split(' '));
}
Expand All @@ -343,7 +343,7 @@ export class ActionViewItem extends BaseActionViewItem {
}
}

updateEnabled(): void {
override updateEnabled(): void {
if (this.getAction().enabled) {
if (this.label) {
this.label.removeAttribute('aria-disabled');
Expand All @@ -365,7 +365,7 @@ export class ActionViewItem extends BaseActionViewItem {
}
}

updateChecked(): void {
override updateChecked(): void {
if (this.label) {
if (this.getAction().checked) {
this.label.classList.add('checked');
Expand Down Expand Up @@ -407,23 +407,23 @@ export class SelectActionViewItem extends BaseActionViewItem {
return option;
}

setFocusable(focusable: boolean): void {
override setFocusable(focusable: boolean): void {
this.selectBox.setFocusable(focusable);
}

focus(): void {
override focus(): void {
if (this.selectBox) {
this.selectBox.focus();
}
}

blur(): void {
override blur(): void {
if (this.selectBox) {
this.selectBox.blur();
}
}

render(container: HTMLElement): void {
override render(container: HTMLElement): void {
this.selectBox.render(container);
}
}
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/actionbar/actionbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export class ActionBar extends Disposable implements IActionRunner {
await this._actionRunner.run(action, context);
}

dispose(): void {
override dispose(): void {
dispose(this.viewItems);
this.viewItems = [];

Expand Down
14 changes: 7 additions & 7 deletions src/vs/base/browser/ui/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class CheckboxActionViewItem extends BaseActionViewItem {
protected checkbox: Checkbox | undefined;
protected readonly disposables = new DisposableStore();

render(container: HTMLElement): void {
override render(container: HTMLElement): void {
this.element = container;

this.disposables.clear();
Expand All @@ -59,7 +59,7 @@ export class CheckboxActionViewItem extends BaseActionViewItem {
this.element.appendChild(this.checkbox.domNode);
}

updateEnabled(): void {
override updateEnabled(): void {
if (this.checkbox) {
if (this.isEnabled()) {
this.checkbox.enable();
Expand All @@ -69,33 +69,33 @@ export class CheckboxActionViewItem extends BaseActionViewItem {
}
}

updateChecked(): void {
override updateChecked(): void {
if (this.checkbox) {
this.checkbox.checked = this._action.checked;
}
}

focus(): void {
override focus(): void {
if (this.checkbox) {
this.checkbox.domNode.tabIndex = 0;
this.checkbox.focus();
}
}

blur(): void {
override blur(): void {
if (this.checkbox) {
this.checkbox.domNode.tabIndex = -1;
this.checkbox.domNode.blur();
}
}

setFocusable(focusable: boolean): void {
override setFocusable(focusable: boolean): void {
if (this.checkbox) {
this.checkbox.domNode.tabIndex = focusable ? 0 : -1;
}
}

dispose(): void {
override dispose(): void {
this.disposables.dispose();
super.dispose();
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/contextview/contextview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class ContextView extends Disposable {
}
}

dispose(): void {
override dispose(): void {
this.hide();

super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class Dialog extends Disposable {
this.applyStyles();
}

dispose(): void {
override dispose(): void {
super.dispose();

if (this.modalElement) {
Expand Down
10 changes: 5 additions & 5 deletions src/vs/base/browser/ui/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class BaseDropdown extends ActionRunner {
this.hide();
}

dispose(): void {
override dispose(): void {
super.dispose();
this.hide();

Expand Down Expand Up @@ -159,7 +159,7 @@ export class Dropdown extends BaseDropdown {
this.contextViewProvider = options.contextViewProvider;
}

show(): void {
override show(): void {
super.show();

this.element.classList.add('active');
Expand Down Expand Up @@ -187,7 +187,7 @@ export class Dropdown extends BaseDropdown {
this.element.classList.remove('active');
}

hide(): void {
override hide(): void {
super.hide();

if (this.contextViewProvider) {
Expand Down Expand Up @@ -250,7 +250,7 @@ export class DropdownMenu extends BaseDropdown {
this._actions = actions;
}

show(): void {
override show(): void {
super.show();

this.element.classList.add('active');
Expand All @@ -269,7 +269,7 @@ export class DropdownMenu extends BaseDropdown {
});
}

hide(): void {
override hide(): void {
super.hide();
}

Expand Down
8 changes: 4 additions & 4 deletions src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
}
}

render(container: HTMLElement): void {
override render(container: HTMLElement): void {
this.actionItem = container;

const labelRenderer: ILabelRenderer = (el: HTMLElement): IDisposable | null => {
Expand Down Expand Up @@ -123,7 +123,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
this.updateEnabled();
}

setActionContext(newContext: unknown): void {
override setActionContext(newContext: unknown): void {
super.setActionContext(newContext);

if (this.dropdownMenu) {
Expand All @@ -141,7 +141,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
}
}

protected updateEnabled(): void {
protected override updateEnabled(): void {
const disabled = !this.getAction().enabled;
this.actionItem?.classList.toggle('disabled', disabled);
this.element?.classList.toggle('disabled', disabled);
Expand All @@ -166,7 +166,7 @@ export class ActionWithDropdownActionViewItem extends ActionViewItem {
super(context, action, options);
}

render(container: HTMLElement): void {
override render(container: HTMLElement): void {
super.render(container);
if (this.element) {
this.element.classList.add('action-dropdown-item');
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/findinput/replaceInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export class ReplaceInput extends Widget {
this.domNode.style.width = newWidth + 'px';
}

public dispose(): void {
public override dispose(): void {
super.dispose();
}
}
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/grid/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ export class SerializableGrid<T extends ISerializableView> extends Grid<T> {
};
}

layout(width: number, height: number): void {
override layout(width: number, height: number): void {
super.layout(width, height);

if (this.initialLayoutContext) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/inputbox/inputBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ export class InputBox extends Widget {
}
}

public dispose(): void {
public override dispose(): void {
this._hideMessage();

this.message = null;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class SelectionTrait<T> extends Trait<T> {
super('selected');
}

renderIndex(index: number, container: HTMLElement): void {
override renderIndex(index: number, container: HTMLElement): void {
super.renderIndex(index, container);

if (this.setAriaSelected) {
Expand Down

0 comments on commit e1f0f8f

Please sign in to comment.