44 showAndLogExceptionWithTelemetry ,
55 showAndLogInformationMessage ,
66} from "./helpers" ;
7- import { ExtensionContext , QuickPickItem , window } from "vscode" ;
7+ import { QuickPickItem , window } from "vscode" ;
88import {
9- commandRunner ,
109 ProgressCallback ,
1110 UserCancellationException ,
1211 withProgress ,
@@ -15,38 +14,33 @@ import { extLogger } from "./common";
1514import { asError , getErrorStack } from "./pure/helpers-pure" ;
1615import { redactableError } from "./pure/errors" ;
1716import { PACKS_BY_QUERY_LANGUAGE } from "./common/query-language" ;
17+ import { PackagingCommands } from "./common/commands" ;
1818
1919type PackagingOptions = {
2020 cliServer : CodeQLCliServer ;
2121} ;
2222
23- export function registerPackagingCommands (
24- ctx : ExtensionContext ,
25- { cliServer } : PackagingOptions ,
26- ) {
27- ctx . subscriptions . push (
28- commandRunner ( "codeQL.installPackDependencies" , async ( ) =>
23+ export function getPackagingCommands ( {
24+ cliServer,
25+ } : PackagingOptions ) : PackagingCommands {
26+ return {
27+ "codeQL.installPackDependencies" : async ( ) =>
2928 withProgress (
3029 async ( progress : ProgressCallback ) =>
3130 await handleInstallPackDependencies ( cliServer , progress ) ,
3231 {
3332 title : "Installing pack dependencies" ,
3433 } ,
3534 ) ,
36- ) ,
37- ) ;
38-
39- ctx . subscriptions . push (
40- commandRunner ( "codeQL.downloadPacks" , async ( ) =>
35+ "codeQL.downloadPacks" : async ( ) =>
4136 withProgress (
4237 async ( progress : ProgressCallback ) =>
4338 await handleDownloadPacks ( cliServer , progress ) ,
4439 {
4540 title : "Downloading packs" ,
4641 } ,
4742 ) ,
48- ) ,
49- ) ;
43+ } ;
5044}
5145
5246/**
0 commit comments