Johannes Rieken
2021-10-04 11:57:12 +02:00
parent fbe916a03f
commit 9c6de0fb16
2 changed files with 24 additions and 10 deletions

View File

@@ -242,7 +242,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
// namespace: commands
const commands: typeof vscode.commands = {
registerCommand(id: string, command: <T>(...args: any[]) => T | Thenable<T>, thisArgs?: any): vscode.Disposable {
return extHostCommands.registerCommand(true, id, command, thisArgs);
return extHostCommands.registerCommand(true, id, command, thisArgs, undefined, extension);
},
registerTextEditorCommand(id: string, callback: (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => void, thisArg?: any): vscode.Disposable {
return extHostCommands.registerCommand(true, id, (...args: any[]): any => {
@@ -262,7 +262,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}, (err) => {
extHostLogService.warn('An error occurred while running command ' + id, err);
});
});
}, undefined, undefined, extension);
},
registerDiffInformationCommand: (id: string, callback: (diff: vscode.LineChange[], ...args: any[]) => any, thisArg?: any): vscode.Disposable => {
checkProposedApiEnabled(extension);
@@ -275,7 +275,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const diff = await extHostEditors.getDiffInformation(activeTextEditor.id);
callback.apply(thisArg, [diff, ...args]);
});
}, undefined, undefined, extension);
},
executeCommand<T>(id: string, ...args: any[]): Thenable<T> {
return extHostCommands.executeCommand<T>(id, ...args);