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 519519 "command" : " codeQLQueries.runLocalQueryContextMenu" ,
520520 "title" : " Run against local database"
521521 },
522+ {
523+ "command" : " codeQLQueries.runVariantAnalysisContextMenu" ,
524+ "title" : " Run against variant analysis repositories"
525+ },
522526 {
523527 "command" : " codeQLVariantAnalysisRepositories.openConfigFile" ,
524528 "title" : " Open database configuration file" ,
11301134 "group" : " queriesPanel@1" ,
11311135 "when" : " view == codeQLQueries && viewItem == queryFile && codeQL.currentDatabaseItem"
11321136 },
1137+ {
1138+ "command" : " codeQLQueries.runVariantAnalysisContextMenu" ,
1139+ "group" : " queriesPanel@1" ,
1140+ "when" : " view == codeQLQueries && viewItem == queryFile"
1141+ },
11331142 {
11341143 "command" : " codeQLTests.showOutputDifferences" ,
11351144 "group" : " qltest@1" ,
13251334 "command" : " codeQLQueries.runLocalQueryContextMenu" ,
13261335 "when" : " false"
13271336 },
1337+ {
1338+ "command" : " codeQLQueries.runVariantAnalysisContextMenu" ,
1339+ "when" : " false"
1340+ },
13281341 {
13291342 "command" : " codeQLVariantAnalysisRepositories.openConfigFile" ,
13301343 "when" : " false"
Original file line number Diff line number Diff line change @@ -267,6 +267,7 @@ export type VariantAnalysisCommands = {
267267 ) => Promise < void > ;
268268 "codeQL.runVariantAnalysis" : ( uri ?: Uri ) => Promise < void > ;
269269 "codeQL.runVariantAnalysisContextEditor" : ( uri ?: Uri ) => Promise < void > ;
270+ "codeQLQueries.runVariantAnalysisContextMenu" : TreeViewContextSingleSelectionCommandFunction < QueryTreeViewItem > ;
270271} ;
271272
272273export 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