fix ts 2.4.1 compile errors in workbench/api

This commit is contained in:
Johannes Rieken
2017-06-15 10:40:45 +02:00
parent ac08540b94
commit 6fdfe2f055
6 changed files with 15 additions and 14 deletions

View File

@@ -129,7 +129,7 @@ export function createApiFactory(
return extHostCommands.registerCommand(id, command, thisArgs);
},
registerTextEditorCommand(id: string, callback: (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => void, thisArg?: any): vscode.Disposable {
return extHostCommands.registerCommand(id, (...args: any[]) => {
return extHostCommands.registerCommand(id, (...args: any[]): any => {
let activeTextEditor = extHostEditors.getActiveTextEditor();
if (!activeTextEditor) {
console.warn('Cannot execute ' + id + ' because there is no active text editor.');
@@ -313,7 +313,7 @@ export function createApiFactory(
},
withScmProgress<R>(task: (progress: vscode.Progress<number>) => Thenable<R>) {
console.warn(`[Deprecation Warning] function 'withScmProgress' is deprecated and should no longer be used. Use 'withProgress' instead.`);
return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, task);
return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, (progress, token) => task({ report(n: number) { /*noop*/ } }));
},
withProgress<R>(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; percentage?: number }>) => Thenable<R>) {
return extHostProgress.withProgress(extension, options, task);