@@ -86,6 +86,7 @@ import {
8686import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item" ;
8787import { RequestError } from "@octokit/request-error" ;
8888import { handleRequestError } from "./custom-errors" ;
89+ import { createMultiSelectionCommand } from "../common/vscode/selection-commands" ;
8990
9091const maxRetryCount = 3 ;
9192
@@ -167,11 +168,15 @@ export class VariantAnalysisManager
167168 "codeQL.openVariantAnalysisView" : this . showView . bind ( this ) ,
168169 "codeQL.runVariantAnalysis" :
169170 this . runVariantAnalysisFromCommand . bind ( this ) ,
170- // Since we are tracking extension usage through commands, this command mirrors the "codeQL.runVariantAnalysis" command
171171 "codeQL.runVariantAnalysisContextEditor" :
172172 this . runVariantAnalysisFromCommand . bind ( this ) ,
173+ "codeQL.runVariantAnalysisContextExplorer" : createMultiSelectionCommand (
174+ this . runVariantAnalysisFromExplorer . bind ( this ) ,
175+ ) ,
173176 "codeQLQueries.runVariantAnalysisContextMenu" :
174177 this . runVariantAnalysisFromQueriesPanel . bind ( this ) ,
178+ "codeQL.runVariantAnalysisPublishedPack" :
179+ this . runVariantAnalysisFromPublishedPack . bind ( this ) ,
175180 } ;
176181 }
177182
@@ -194,6 +199,13 @@ export class VariantAnalysisManager
194199 ) ;
195200 }
196201
202+ private async runVariantAnalysisFromExplorer ( fileURIs : Uri [ ] ) : Promise < void > {
203+ if ( fileURIs . length !== 1 ) {
204+ throw new Error ( "Can only run a single query at a time" ) ;
205+ }
206+ return this . runVariantAnalysisFromCommand ( fileURIs [ 0 ] ) ;
207+ }
208+
197209 private async runVariantAnalysisFromQueriesPanel (
198210 queryTreeViewItem : QueryTreeViewItem ,
199211 ) : Promise < void > {
@@ -204,6 +216,10 @@ export class VariantAnalysisManager
204216 }
205217 }
206218
219+ private async runVariantAnalysisFromPublishedPack ( ) : Promise < void > {
220+ throw new Error ( "Command not yet implemented" ) ;
221+ }
222+
207223 public async runVariantAnalysis (
208224 uri : Uri | undefined ,
209225 progress : ProgressCallback ,
0 commit comments