Skip to content

Commit cd0d646

Browse files
Change registerCommandWithErrorHandling from two type args to one
1 parent fcc5f69 commit cd0d646

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

extensions/ql-vscode/src/common/vscode/commands.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ export function createVSCodeCommandManager<
4040
* @param logger The logger to use for error reporting.
4141
* @param telemetry The telemetry listener to use for error reporting.
4242
*/
43-
export function registerCommandWithErrorHandling<S extends unknown[], T>(
43+
export function registerCommandWithErrorHandling<
44+
T extends (...args: unknown[]) => Promise<unknown>,
45+
>(
4446
commandId: string,
45-
task: (...args: S) => Promise<T>,
47+
task: T,
4648
logger: NotificationLogger = extLogger,
4749
telemetry: AppTelemetry | undefined = telemetryListener,
4850
): Disposable {
49-
return commands.registerCommand(commandId, async (...args: S) => {
51+
return commands.registerCommand(commandId, async (...args: Parameters<T>) => {
5052
const startTime = Date.now();
5153
let error: Error | undefined;
5254

0 commit comments

Comments
 (0)