Skip to content

Commit

Permalink
Remove suppressImplicitAnyIndexErrors (#76442)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Jul 2, 2019
1 parent 41ae43e commit 044a5f9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/vs/workbench/api/browser/mainThreadQuickOpen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
params[param].forEach((item: TransferQuickPickItems) => {
handlesToItems.set(item.handle, item);
});
input[param] = params[param];
(input as any)[param] = params[param];
} else if (param === 'activeItems' || param === 'selectedItems') {
input[param] = params[param]
(input as any)[param] = params[param]
.filter((handle: number) => handlesToItems.has(handle))
.map((handle: number) => handlesToItems.get(handle));
} else if (param === 'buttons') {
input[param] = params.buttons!.map(button => {
(input as any)[param] = params.buttons!.map(button => {
if (button.handle === -1) {
return this._quickInputService.backButton;
}
Expand All @@ -195,7 +195,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
};
});
} else {
input[param] = params[param];
(input as any)[param] = params[param];
}
}
return Promise.resolve(undefined);
Expand Down
2 changes: 2 additions & 0 deletions src/vs/workbench/api/common/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ export type TransferQuickInput = TransferQuickPick | TransferInputBox;

export interface BaseTransferQuickInput {

[key: string]: any;

id: number;

type?: 'quickPick' | 'inputBox';
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/common/extHostQuickOpen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,14 @@ function getLightIconUri(iconPath: QuickInputButton['iconPath']) {
|| iconPath instanceof URI) {
return getIconUri(iconPath);
}
return getIconUri(iconPath['light']);
return getIconUri((iconPath as any).light);
}
return undefined;
}

function getDarkIconUri(iconPath: QuickInputButton['iconPath']) {
if (iconPath && !(iconPath instanceof ThemeIcon) && iconPath['dark']) {
return getIconUri(iconPath['dark']);
if (iconPath && !(iconPath instanceof ThemeIcon) && (iconPath as any).dark) {
return getIconUri((iconPath as any).dark);
}
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export class QuickInputList {
what = 'Last';
}

this.list['focus' + what]();
(this.list as any)['focus' + what]();
this.list.reveal(this.list.getFocus()[0]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as dom from 'vs/base/browser/dom';
import { URI } from 'vs/base/common/uri';
import { IdGenerator } from 'vs/base/common/idGenerator';

const iconPathToClass = {};
const iconPathToClass: Record<string, string> = {};
const iconClassGenerator = new IdGenerator('quick-input-button-icon-');

export function getIconClass(iconPath: { dark: URI; light?: URI; } | undefined): string | undefined {
Expand Down

2 comments on commit 044a5f9

@bpasero
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bypasses any kind of TypeScript checking and would certainly break for any refactoring we do in the tree for those methods, why do we have to use any here?

@chrmarti
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bpasero Got rid of any: 35cae14

Please sign in to comment.