提交 8235163d 编写于 作者: M Matt Bierner

More implicitAny fixes

上级 0999096b
......@@ -174,7 +174,7 @@ export function create(ctor: Function, ...args: any[]): any {
}
// https://stackoverflow.com/a/32235645/1499159
function isNativeClass(thing): boolean {
function isNativeClass(thing: any): boolean {
return typeof thing === 'function'
&& thing.hasOwnProperty('prototype')
&& !thing.hasOwnProperty('arguments');
......
......@@ -746,7 +746,7 @@ export class WindowsManager implements IWindowsMainService {
private doOpenFilesInExistingWindow(configuration: IOpenConfiguration, window: ICodeWindow, fileInputs?: IFileInputs): ICodeWindow {
window.focus(); // make sure window has focus
const params: { filesToOpen?, filesToCreate?, filesToDiff?, filesToWait?, termProgram?} = {};
const params: { filesToOpen?: IPath[], filesToCreate?: IPath[], filesToDiff?: IPath[], filesToWait?: IPathsToWaitFor, termProgram?: string } = {};
if (fileInputs) {
params.filesToOpen = fileInputs.filesToOpen;
params.filesToCreate = fileInputs.filesToCreate;
......
......@@ -26,7 +26,7 @@ export function getGalleryExtensionId(publisher: string, name: string): string {
export function groupByExtension<T>(extensions: T[], getExtensionIdentifier: (t: T) => IExtensionIdentifier): T[][] {
const byExtension: T[][] = [];
const findGroup = extension => {
const findGroup = (extension: T) => {
for (const group of byExtension) {
if (group.some(e => areSameExtensions(getExtensionIdentifier(e), getExtensionIdentifier(extension)))) {
return group;
......
......@@ -54,7 +54,7 @@ export class ExtensionsLifecycle extends Disposable {
return new Promise<void>((c, e) => {
const extensionLifecycleProcess = this.start(lifecycleHook, lifecycleType, args, extension);
let timeoutHandler;
let timeoutHandler: any;
const onexit = (error?: string) => {
if (timeoutHandler) {
......
......@@ -44,7 +44,7 @@ export class ExtensionManagementChannel implements IServerChannel {
this.onDidUninstallExtension = Event.buffer(service.onDidUninstallExtension, true);
}
listen(context, event: string): Event<any> {
listen(context: any, event: string): Event<any> {
const uriTransformer = this.getUriTransformer(context);
switch (event) {
case 'onInstallExtension': return this.onInstallExtension;
......@@ -56,7 +56,7 @@ export class ExtensionManagementChannel implements IServerChannel {
throw new Error('Invalid listen');
}
call(context, command: string, args?: any): Promise<any> {
call(context: any, command: string, args?: any): Promise<any> {
const uriTransformer: IURITransformer | null = this.getUriTransformer(context);
switch (command) {
case 'zip': return this.service.zip(transformIncomingExtension(args[0], uriTransformer)).then(uri => transformOutgoingURI(uri, uriTransformer));
......
......@@ -272,8 +272,8 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
private createWebviewEventDelegate(handle: WebviewPanelHandle) {
return {
onDidClickLink: uri => this.onDidClickLink(handle, uri),
onMessage: message => this._proxy.$onMessage(handle, message),
onDidClickLink: (uri: URI) => this.onDidClickLink(handle, uri),
onMessage: (message: any) => this._proxy.$onMessage(handle, message),
onDispose: () => {
this._proxy.$onDidDisposeWebviewPanel(handle).finally(() => {
this._webviews.delete(handle);
......
......@@ -175,13 +175,13 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
// ---- QuickInput
createQuickPick<T extends QuickPickItem>(extensionId: ExtensionIdentifier, enableProposedApi: boolean): QuickPick<T> {
const session = new ExtHostQuickPick(this._proxy, extensionId, enableProposedApi, () => this._sessions.delete(session._id));
const session: ExtHostQuickPick<T> = new ExtHostQuickPick(this._proxy, extensionId, enableProposedApi, () => this._sessions.delete(session._id));
this._sessions.set(session._id, session);
return session;
}
createInputBox(extensionId: ExtensionIdentifier): InputBox {
const session = new ExtHostInputBox(this._proxy, extensionId, () => this._sessions.delete(session._id));
const session: ExtHostInputBox = new ExtHostInputBox(this._proxy, extensionId, () => this._sessions.delete(session._id));
this._sessions.set(session._id, session);
return session;
}
......@@ -379,7 +379,7 @@ class ExtHostQuickInput implements QuickInput {
this._onDidAcceptEmitter.fire();
}
_fireDidChangeValue(value) {
_fireDidChangeValue(value: string) {
this._value = value;
this._onDidChangeValueEmitter.fire(value);
}
......
......@@ -186,7 +186,8 @@ class ExtHostTreeView<T> extends Disposable {
this._register(this.dataProvider.onDidChangeTreeData(element => this._onDidChangeData.fire({ message: false, element })));
}
let refreshingPromise, promiseCallback;
let refreshingPromise: Promise<void> | null;
let promiseCallback: () => void;
this._register(Event.debounce<TreeData<T>, { message: boolean, elements: (T | Root)[] }>(this._onDidChangeData.event, (result, current) => {
if (!result) {
result = { message: false, elements: [] };
......@@ -195,7 +196,7 @@ class ExtHostTreeView<T> extends Disposable {
if (!refreshingPromise) {
// New refresh has started
refreshingPromise = new Promise(c => promiseCallback = c);
this.refreshPromise = this.refreshPromise.then(() => refreshingPromise);
this.refreshPromise = this.refreshPromise.then(() => refreshingPromise!);
}
result.elements.push(current.element);
}
......
......@@ -791,7 +791,7 @@ export class SimpleRemoteFileService implements IFileService {
return Promise.resolve(createFolder(parent, basename(_resource.path)));
}
registerProvider(_scheme: string, _provider) { return { dispose() { } }; }
registerProvider() { return { dispose() { } }; }
activateProvider(_scheme: string): Promise<void> { return Promise.resolve(undefined); }
......@@ -1059,14 +1059,14 @@ export const IRequestService = createDecorator<IRequestService>('requestService'
export interface IRequestService {
_serviceBrand: any;
request(options, token: CancellationToken): Promise<object>;
request(options: any, token: CancellationToken): Promise<object>;
}
export class SimpleRequestService implements IRequestService {
_serviceBrand: any;
request(options, token: CancellationToken): Promise<object> {
request(options: any, token: CancellationToken): Promise<object> {
return Promise.resolve(Object.create(null));
}
}
......
......@@ -309,7 +309,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
private static INPUT_BOX_ARIA_LABEL = localize('quickInputBox.ariaLabel', "Type to narrow down results.");
private _value = '';
private _placeholder;
private _placeholder: string;
private onDidChangeValueEmitter = new Emitter<string>();
private onDidAcceptEmitter = new Emitter<void>();
private _items: Array<T | IQuickPickSeparator> = [];
......
......@@ -6,7 +6,7 @@
import { Registry } from 'vs/platform/registry/common/platform';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { ICommandHandler, CommandsRegistry } from 'vs/platform/commands/common/commands';
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { SyncActionDescriptor, MenuRegistry, MenuId, ICommandAction } from 'vs/platform/actions/common/actions';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
......@@ -58,16 +58,16 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR
if (descriptor.label) {
let idx = alias.indexOf(': ');
let categoryOriginal;
let categoryOriginal = '';
if (idx > 0) {
categoryOriginal = alias.substr(0, idx);
alias = alias.substr(idx + 2);
}
const command = {
const command: ICommandAction = {
id: descriptor.id,
title: { value: descriptor.label, original: alias },
category: category && { value: category, original: categoryOriginal }
category: category ? { value: category, original: categoryOriginal } : undefined
};
MenuRegistry.addCommand(command);
......
......@@ -60,7 +60,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
private _resizeObserver: any;
private _onDidClose = new Emitter<ReviewZoneWidget | undefined>();
private _onDidCreateThread = new Emitter<ReviewZoneWidget>();
private _isCollapsed;
private _isCollapsed: boolean;
private _collapseAction: Action;
private _commentGlyph?: CommentGlyphWidget;
private _submitActionsDisposables: IDisposable[];
......
......@@ -156,9 +156,9 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem {
const info = document.createElement('div');
const building = document.createElement('div');
const errorTitle = n => nls.localize('totalErrors', "{0} Errors", n);
const warningTitle = n => nls.localize('totalWarnings', "{0} Warnings", n);
const infoTitle = n => nls.localize('totalInfos', "{0} Infos", n);
const errorTitle = (n: number) => nls.localize('totalErrors', "{0} Errors", n);
const warningTitle = (n: number) => nls.localize('totalWarnings', "{0} Warnings", n);
const infoTitle = (n: number) => nls.localize('totalInfos', "{0} Infos", n);
Dom.addClass(element, 'task-statusbar-item');
element.title = nls.localize('problems', "Problems");
......@@ -211,7 +211,7 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem {
}));
const manyProblems = nls.localize('manyProblems', "10K+");
const packNumber = n => n > 9999 ? manyProblems : n > 999 ? n.toString().charAt(0) + 'K' : n.toString();
const packNumber = (n: number) => n > 9999 ? manyProblems : n > 999 ? n.toString().charAt(0) + 'K' : n.toString();
let updateLabel = (stats: MarkerStatistics) => {
error.innerHTML = packNumber(stats.errors);
error.title = errorIcon.title = errorTitle(stats.errors);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册