File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 510510 "command" : " codeQLQueries.runLocalQueryContextMenu" ,
511511 "title" : " Run against local database"
512512 },
513+ {
514+ "command" : " codeQLQueries.runVariantAnalysisContextMenu" ,
515+ "title" : " Run against variant analysis repositories"
516+ },
513517 {
514518 "command" : " codeQLVariantAnalysisRepositories.openConfigFile" ,
515519 "title" : " Open database configuration file" ,
11141118 "group" : " queriesPanel@1" ,
11151119 "when" : " view == codeQLQueries && viewItem == queryFile && codeQL.currentDatabaseItem"
11161120 },
1121+ {
1122+ "command" : " codeQLQueries.runVariantAnalysisContextMenu" ,
1123+ "group" : " queriesPanel@1" ,
1124+ "when" : " view == codeQLQueries && viewItem == queryFile"
1125+ },
11171126 {
11181127 "command" : " codeQLTests.showOutputDifferences" ,
11191128 "group" : " qltest@1" ,
13011310 "command" : " codeQLQueries.runLocalQueryContextMenu" ,
13021311 "when" : " false"
13031312 },
1313+ {
1314+ "command" : " codeQLQueries.runVariantAnalysisContextMenu" ,
1315+ "when" : " false"
1316+ },
13041317 {
13051318 "command" : " codeQLVariantAnalysisRepositories.openConfigFile" ,
13061319 "when" : " false"
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ export type VariantAnalysisCommands = {
265265 ) => Promise < void > ;
266266 "codeQL.runVariantAnalysis" : ( uri ?: Uri ) => Promise < void > ;
267267 "codeQL.runVariantAnalysisContextEditor" : ( uri ?: Uri ) => Promise < void > ;
268+ "codeQLQueries.runVariantAnalysisContextMenu" : TreeViewContextSingleSelectionCommandFunction < QueryTreeViewItem > ;
268269} ;
269270
270271export type DatabasePanelCommands = {
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ import {
7676 showAndLogInformationMessage ,
7777 showAndLogWarningMessage ,
7878} from "../common/logging" ;
79+ import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item" ;
7980
8081const maxRetryCount = 3 ;
8182
@@ -163,6 +164,8 @@ export class VariantAnalysisManager
163164 // Since we are tracking extension usage through commands, this command mirrors the "codeQL.runVariantAnalysis" command
164165 "codeQL.runVariantAnalysisContextEditor" :
165166 this . runVariantAnalysisFromCommand . bind ( this ) ,
167+ "codeQLQueries.runVariantAnalysisContextMenu" :
168+ this . runVariantAnalysisFromQueriesPanel . bind ( this ) ,
166169 } ;
167170 }
168171
@@ -185,6 +188,12 @@ export class VariantAnalysisManager
185188 ) ;
186189 }
187190
191+ private async runVariantAnalysisFromQueriesPanel (
192+ queryTreeViewItem : QueryTreeViewItem ,
193+ ) : Promise < void > {
194+ await this . runVariantAnalysisFromCommand ( Uri . file ( queryTreeViewItem . path ) ) ;
195+ }
196+
188197 public async runVariantAnalysis (
189198 uri : Uri | undefined ,
190199 progress : ProgressCallback ,
You can’t perform that action at this time.
0 commit comments