@@ -4,14 +4,33 @@ import { CodeQLCliServer } from "../cli";
44import { getOnDiskWorkspaceFolders , showAndLogErrorMessage } from "../helpers" ;
55import { ProgressCallback } from "../progress" ;
66
7- export async function pickExtensionPack (
7+ const maxStep = 3 ;
8+
9+ export async function pickExtensionPackModelFile (
10+ cliServer : CodeQLCliServer ,
11+ progress : ProgressCallback ,
12+ ) : Promise < string | undefined > {
13+ const extensionPackPath = await pickExtensionPack ( cliServer , progress ) ;
14+ if ( ! extensionPackPath ) {
15+ return ;
16+ }
17+
18+ const modelFile = await pickModelFile ( cliServer , progress , extensionPackPath ) ;
19+ if ( ! modelFile ) {
20+ return ;
21+ }
22+
23+ return modelFile ;
24+ }
25+
26+ async function pickExtensionPack (
827 cliServer : CodeQLCliServer ,
928 progress : ProgressCallback ,
1029) : Promise < string | undefined > {
1130 progress ( {
1231 message : "Resolving extension packs..." ,
1332 step : 1 ,
14- maxStep : 3 ,
33+ maxStep,
1534 } ) ;
1635
1736 // Get all existing extension packs in the workspace
@@ -25,7 +44,7 @@ export async function pickExtensionPack(
2544 progress ( {
2645 message : "Choosing extension pack..." ,
2746 step : 2 ,
28- maxStep : 3 ,
47+ maxStep,
2948 } ) ;
3049
3150 const extensionPackOption = await window . showQuickPick ( options , {
@@ -53,7 +72,7 @@ export async function pickExtensionPack(
5372 return extensionPackPaths [ 0 ] ;
5473}
5574
56- export async function pickModelFile (
75+ async function pickModelFile (
5776 cliServer : CodeQLCliServer ,
5877 progress : ProgressCallback ,
5978 extensionPackPath : string ,
@@ -84,7 +103,7 @@ export async function pickModelFile(
84103 progress ( {
85104 message : "Choosing model file..." ,
86105 step : 3 ,
87- maxStep : 3 ,
106+ maxStep,
88107 } ) ;
89108
90109 const fileOption = await window . showQuickPick ( fileOptions , {
0 commit comments