Add run all on folders
This commit is contained in:
@@ -510,6 +510,11 @@
|
||||
"title": "Run local query",
|
||||
"icon": "$(run)"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueries.runLocalQueriesFromPanel",
|
||||
"title": "Run local queries",
|
||||
"icon": "$(run-all)"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.runLocalQueryFromFileTab",
|
||||
"title": "CodeQL: Run local query",
|
||||
@@ -1139,6 +1144,11 @@
|
||||
"group": "queriesPanel@1",
|
||||
"when": "view == codeQLQueries && viewItem == queryFile"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueries.runLocalQueriesFromPanel",
|
||||
"group": "inline",
|
||||
"when": "view == codeQLQueries && viewItem == queryFolder && codeQL.currentDatabaseItem"
|
||||
},
|
||||
{
|
||||
"command": "codeQLTests.showOutputDifferences",
|
||||
"group": "qltest@1",
|
||||
@@ -1202,6 +1212,10 @@
|
||||
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueries.runLocalQueriesFromPanel",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.runLocalQueryFromFileTab",
|
||||
"when": "false"
|
||||
|
||||
@@ -132,6 +132,7 @@ export type LocalQueryCommands = {
|
||||
) => Promise<void>;
|
||||
"codeQLQueries.runLocalQueryFromQueriesPanel": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
|
||||
"codeQLQueries.runLocalQueryContextMenu": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
|
||||
"codeQLQueries.runLocalQueriesFromPanel": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
|
||||
"codeQL.runLocalQueryFromFileTab": (uri: Uri) => Promise<void>;
|
||||
"codeQL.runQueries": ExplorerSelectionCommandFunction<Uri>;
|
||||
"codeQL.quickEval": (uri: Uri) => Promise<void>;
|
||||
|
||||
@@ -105,6 +105,8 @@ export class LocalQueries extends DisposableObject {
|
||||
this.runQueryFromQueriesPanel.bind(this),
|
||||
"codeQLQueries.runLocalQueryContextMenu":
|
||||
this.runQueryFromQueriesPanel.bind(this),
|
||||
"codeQLQueries.runLocalQueriesFromPanel":
|
||||
this.runQueriesFromQueriesPanel.bind(this),
|
||||
"codeQL.runLocalQueryFromFileTab": this.runQuery.bind(this),
|
||||
"codeQL.runQueries": createMultiSelectionCommand(
|
||||
this.runQueries.bind(this),
|
||||
@@ -131,6 +133,15 @@ export class LocalQueries extends DisposableObject {
|
||||
await this.runQuery(Uri.file(queryTreeViewItem.path));
|
||||
}
|
||||
|
||||
private async runQueriesFromQueriesPanel(
|
||||
queryTreeViewItem: QueryTreeViewItem,
|
||||
): Promise<void> {
|
||||
const uris = queryTreeViewItem.children.map((child) =>
|
||||
Uri.file(child.path),
|
||||
);
|
||||
await this.runQueries(uris);
|
||||
}
|
||||
|
||||
private async runQuery(uri: Uri | undefined): Promise<void> {
|
||||
await withProgress(
|
||||
async (progress, token) => {
|
||||
|
||||
@@ -20,6 +20,7 @@ export class QueryTreeViewItem extends vscode.TreeItem {
|
||||
};
|
||||
} else {
|
||||
this.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
|
||||
this.contextValue = "queryFolder";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user