@@ -4,13 +4,48 @@ import {
44 showAndLogExceptionWithTelemetry ,
55 showAndLogInformationMessage ,
66} from "./helpers" ;
7- import { QuickPickItem , window } from "vscode" ;
8- import { ProgressCallback , UserCancellationException } from "./commandRunner" ;
7+ import { ExtensionContext , QuickPickItem , window } from "vscode" ;
8+ import {
9+ commandRunnerWithProgress ,
10+ ProgressCallback ,
11+ UserCancellationException ,
12+ } from "./commandRunner" ;
913import { extLogger } from "./common" ;
1014import { asError , getErrorStack } from "./pure/helpers-pure" ;
1115import { redactableError } from "./pure/errors" ;
1216import { PACKS_BY_QUERY_LANGUAGE } from "./common/query-language" ;
1317
18+ type PackagingOptions = {
19+ cliServer : CodeQLCliServer ;
20+ } ;
21+
22+ export function registerPackagingCommands (
23+ ctx : ExtensionContext ,
24+ { cliServer } : PackagingOptions ,
25+ ) {
26+ ctx . subscriptions . push (
27+ commandRunnerWithProgress (
28+ "codeQL.installPackDependencies" ,
29+ async ( progress : ProgressCallback ) =>
30+ await handleInstallPackDependencies ( cliServer , progress ) ,
31+ {
32+ title : "Installing pack dependencies" ,
33+ } ,
34+ ) ,
35+ ) ;
36+
37+ ctx . subscriptions . push (
38+ commandRunnerWithProgress (
39+ "codeQL.downloadPacks" ,
40+ async ( progress : ProgressCallback ) =>
41+ await handleDownloadPacks ( cliServer , progress ) ,
42+ {
43+ title : "Downloading packs" ,
44+ } ,
45+ ) ,
46+ ) ;
47+ }
48+
1449/**
1550 * Prompts user to choose packs to download, and downloads them.
1651 *
0 commit comments