File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed
Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 510510 "title" : " Run local query" ,
511511 "icon" : " $(run)"
512512 },
513+ {
514+ "command" : " codeQLQueries.runLocalQueriesFromPanel" ,
515+ "title" : " Run local queries" ,
516+ "icon" : " $(run-all)"
517+ },
513518 {
514519 "command" : " codeQL.runLocalQueryFromFileTab" ,
515520 "title" : " CodeQL: Run local query" ,
11391144 "group" : " queriesPanel@1" ,
11401145 "when" : " view == codeQLQueries && viewItem == queryFile"
11411146 },
1147+ {
1148+ "command" : " codeQLQueries.runLocalQueriesFromPanel" ,
1149+ "group" : " inline" ,
1150+ "when" : " view == codeQLQueries && viewItem == queryFolder && codeQL.currentDatabaseItem"
1151+ },
11421152 {
11431153 "command" : " codeQLTests.showOutputDifferences" ,
11441154 "group" : " qltest@1" ,
12021212 "command" : " codeQLQueries.runLocalQueryFromQueriesPanel" ,
12031213 "when" : " false"
12041214 },
1215+ {
1216+ "command" : " codeQLQueries.runLocalQueriesFromPanel" ,
1217+ "when" : " false"
1218+ },
12051219 {
12061220 "command" : " codeQL.runLocalQueryFromFileTab" ,
12071221 "when" : " false"
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ export type LocalQueryCommands = {
132132 ) => Promise < void > ;
133133 "codeQLQueries.runLocalQueryFromQueriesPanel" : TreeViewContextSingleSelectionCommandFunction < QueryTreeViewItem > ;
134134 "codeQLQueries.runLocalQueryContextMenu" : TreeViewContextSingleSelectionCommandFunction < QueryTreeViewItem > ;
135+ "codeQLQueries.runLocalQueriesFromPanel" : TreeViewContextSingleSelectionCommandFunction < QueryTreeViewItem > ;
135136 "codeQL.runLocalQueryFromFileTab" : ( uri : Uri ) => Promise < void > ;
136137 "codeQL.runQueries" : ExplorerSelectionCommandFunction < Uri > ;
137138 "codeQL.quickEval" : ( uri : Uri ) => Promise < void > ;
Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ export class LocalQueries extends DisposableObject {
105105 this . runQueryFromQueriesPanel . bind ( this ) ,
106106 "codeQLQueries.runLocalQueryContextMenu" :
107107 this . runQueryFromQueriesPanel . bind ( this ) ,
108+ "codeQLQueries.runLocalQueriesFromPanel" :
109+ this . runQueriesFromQueriesPanel . bind ( this ) ,
108110 "codeQL.runLocalQueryFromFileTab" : this . runQuery . bind ( this ) ,
109111 "codeQL.runQueries" : createMultiSelectionCommand (
110112 this . runQueries . bind ( this ) ,
@@ -131,6 +133,15 @@ export class LocalQueries extends DisposableObject {
131133 await this . runQuery ( Uri . file ( queryTreeViewItem . path ) ) ;
132134 }
133135
136+ private async runQueriesFromQueriesPanel (
137+ queryTreeViewItem : QueryTreeViewItem ,
138+ ) : Promise < void > {
139+ const uris = queryTreeViewItem . children . map ( ( child ) =>
140+ Uri . file ( child . path ) ,
141+ ) ;
142+ await this . runQueries ( uris ) ;
143+ }
144+
134145 private async runQuery ( uri : Uri | undefined ) : Promise < void > {
135146 await withProgress (
136147 async ( progress , token ) => {
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export class QueryTreeViewItem extends vscode.TreeItem {
2020 } ;
2121 } else {
2222 this . collapsibleState = vscode . TreeItemCollapsibleState . Collapsed ;
23+ this . contextValue = "queryFolder" ;
2324 }
2425 }
2526}
You can’t perform that action at this time.
0 commit comments