提交 58aca31e 编写于 作者: M Matt Bierner

Fix implicit any errors

上级 03c3dc5c
......@@ -244,7 +244,7 @@ export class SimpleWorkerClient<T> extends Disposable {
this._onModuleLoaded.then((availableMethods: string[]) => {
let proxy = <T>{};
for (let i = 0; i < availableMethods.length; i++) {
proxy[availableMethods[i]] = createProxyMethod(availableMethods[i], proxyMethodRequest);
(proxy as any)[availableMethods[i]] = createProxyMethod(availableMethods[i], proxyMethodRequest);
}
lazyProxyFulfill(proxy);
}, (e) => {
......
......@@ -153,7 +153,7 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
try {
const watcher = extfs.watch(path, (type, file) => this.onConfigFileChange(type, file, isParentFolder));
watcher.on('error', (code, signal) => this.options.onError(`Error watching ${path} for configuration changes (${code}, ${signal})`));
watcher.on('error', (code: number, signal: string) => this.options.onError(`Error watching ${path} for configuration changes (${code}, ${signal})`));
this.disposables.push(toDisposable(() => {
watcher.removeAllListeners();
......@@ -209,7 +209,7 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
return fallback;
}
const value = this.cache ? this.cache[key] : void 0;
const value = this.cache ? (this.cache as any)[key] : void 0;
return typeof value !== 'undefined' ? value : fallback;
}
......
......@@ -177,7 +177,7 @@ function setupIPC(hook: string): TPromise<Server> {
function startHandshake(): TPromise<ISharedProcessInitData> {
return new TPromise<ISharedProcessInitData>((c, e) => {
ipcRenderer.once('handshake:hey there', (_, r) => c(r));
ipcRenderer.once('handshake:hey there', (_: any, r: ISharedProcessInitData) => c(r));
ipcRenderer.send('handshake:hello');
});
}
......
......@@ -130,7 +130,7 @@ export class CodeApplication {
const isValidWebviewSource = (source: string) =>
!source || (URI.parse(source.toLowerCase()).toString() as any).startsWith(URI.file(this.environmentService.appRoot.toLowerCase()).toString());
app.on('web-contents-created', (event, contents) => {
app.on('web-contents-created', (_event: any, contents) => {
contents.on('will-attach-webview', (event: Electron.Event, webPreferences, params) => {
delete webPreferences.preload;
webPreferences.nodeIntegration = false;
......@@ -185,19 +185,19 @@ export class CodeApplication {
this.windowsMainService.openNewWindow(OpenContext.DESKTOP); //macOS native tab "+" button
});
ipc.on('vscode:exit', (event, code: number) => {
ipc.on('vscode:exit', (_event: any, code: number) => {
this.logService.log('IPC#vscode:exit', code);
this.dispose();
this.lifecycleService.kill(code);
});
ipc.on(machineIdIpcChannel, (event, machineId: string) => {
ipc.on(machineIdIpcChannel, (_event: any, machineId: string) => {
this.logService.log('IPC#vscode-machineId');
this.storageService.setItem(machineIdStorageKey, machineId);
});
ipc.on('vscode:fetchShellEnv', (event, windowId) => {
ipc.on('vscode:fetchShellEnv', (_event: any, windowId: number) => {
const { webContents } = BrowserWindow.fromId(windowId);
getShellEnvironment().then(shellEnv => {
if (!webContents.isDestroyed()) {
......@@ -212,7 +212,7 @@ export class CodeApplication {
});
});
ipc.on('vscode:broadcast', (event, windowId: number, broadcast: { channel: string; payload: any; }) => {
ipc.on('vscode:broadcast', (_event: any, windowId: number, broadcast: { channel: string; payload: any; }) => {
if (this.windowsMainService && broadcast.channel && !isUndefinedOrNull(broadcast.payload)) {
this.logService.log('IPC#vscode:broadcast', broadcast.channel, broadcast.payload);
......
......@@ -99,7 +99,7 @@ export class CodeMenu {
this.windowsService.onWindowClose(() => this.updateWorkspaceMenuItems());
// Listen to extension viewlets
ipc.on('vscode:extensionViewlets', (event, rawExtensionViewlets) => {
ipc.on('vscode:extensionViewlets', (_event: any, rawExtensionViewlets: string) => {
let extensionViewlets: IExtensionViewlet[] = [];
try {
extensionViewlets = JSON.parse(rawExtensionViewlets);
......
......@@ -65,7 +65,7 @@ export class SharedProcess implements ISharedProcess {
}));
return new TPromise<void>((c, e) => {
ipcMain.once('handshake:hello', ({ sender }) => {
ipcMain.once('handshake:hello', ({ sender }: { sender: any }) => {
sender.send('handshake:hey there', {
sharedIPCHandle: this.environmentService.sharedIPCHandle,
args: this.environmentService.args
......
......@@ -339,7 +339,7 @@ export class CodeWindow implements ICodeWindow {
'X-Market-User-Id': this.environmentService.machineUUID
};
this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details, cb) => {
this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details: any, cb: any) => {
cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) });
});
......@@ -355,7 +355,7 @@ export class CodeWindow implements ICodeWindow {
return callback({});
});
this._win.webContents.session.webRequest.onHeadersReceived(null, (details, callback) => {
this._win.webContents.session.webRequest.onHeadersReceived(null, (details: any, callback: any) => {
const contentType: string[] = (details.responseHeaders['content-type'] || details.responseHeaders['Content-Type']) as any;
if (contentType && Array.isArray(contentType) && contentType.some(x => x.toLowerCase().indexOf('image/svg') >= 0)) {
return callback({ cancel: true });
......
......@@ -201,7 +201,7 @@ export class WindowsManager implements IWindowsMainService {
});
// React to workbench loaded events from windows
ipc.on('vscode:workbenchLoaded', (event, windowId: number) => {
ipc.on('vscode:workbenchLoaded', (_event: any, windowId: number) => {
this.logService.log('IPC#vscode-workbenchLoaded');
const win = this.getWindowById(windowId);
......
......@@ -38,7 +38,7 @@ if (typeof global.Promise === 'undefined') {
let base = createMonacoBaseAPI();
for (let prop in base) {
if (base.hasOwnProperty(prop)) {
exports[prop] = base[prop];
exports[prop] = (base as any)[prop];
}
}
exports.editor = createMonacoEditorAPI();
......
......@@ -234,7 +234,7 @@ export abstract class CompositeDescriptor<T extends Composite> {
public name: string;
public cssClass: string;
public order: number;
public keybindingId;
public keybindingId: string;
private ctor: IConstructorSignature0<T>;
......
......@@ -439,7 +439,7 @@ export class ShowStartupPerformance extends Action {
}
private analyzeLoaderStats(): { [type: string]: any[] } {
const stats = <ILoaderEvent[]>(<any>require).getStats().slice(0).sort((a, b) => {
const stats = <ILoaderEvent[]>(<any>require).getStats().slice(0).sort((a: ILoaderEvent, b: ILoaderEvent) => {
if (a.detail < b.detail) {
return -1;
} else if (a.detail > b.detail) {
......
......@@ -593,7 +593,7 @@ export class FeedbackWidgetRenderer extends Disposable {
const result = this._currentResult;
const actualResultNames = Object.keys(result.metadata.scoredResults);
const feedbackQuery = {};
const feedbackQuery: any = {};
feedbackQuery['comment'] = FeedbackWidgetRenderer.DEFAULT_COMMENT_TEXT;
feedbackQuery['queryString'] = result.query;
feedbackQuery['resultScores'] = {};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册