Skip to content

Commit fcc5f69

Browse files
Add generic types to registerCommandWithErrorHandling
1 parent 74070fb commit fcc5f69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ 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(
43+
export function registerCommandWithErrorHandling<S extends unknown[], T>(
4444
commandId: string,
45-
task: (...args: any[]) => Promise<any>,
45+
task: (...args: S) => Promise<T>,
4646
logger: NotificationLogger = extLogger,
4747
telemetry: AppTelemetry | undefined = telemetryListener,
4848
): Disposable {
49-
return commands.registerCommand(commandId, async (...args: any[]) => {
49+
return commands.registerCommand(commandId, async (...args: S) => {
5050
const startTime = Date.now();
5151
let error: Error | undefined;
5252

0 commit comments

Comments
 (0)