Create new runQuery command for the queries panel

This commit is contained in:
Nora
2023-06-21 13:51:08 +00:00
parent 12c0c57c25
commit 3f1b619904
5 changed files with 13 additions and 3 deletions

View File

@@ -405,6 +405,10 @@
"command": "codeQL.runQueryContextEditor",
"title": "CodeQL: Run Query on Selected Database"
},
{
"command": "codeQL.runLocalQueryFromQueriesPanel",
"title": "CodeQL: Run Query on Selected Database"
},
{
"command": "codeQL.debugQuery",
"title": "CodeQL: Debug Query"
@@ -1164,6 +1168,10 @@
"command": "codeQL.runQuery",
"when": "resourceLangId == ql && resourceExtname == .ql"
},
{
"command": "codeQL.runLocalQueryFromQueriesPanel",
"when": "false"
},
{
"command": "codeQL.runQueryContextEditor",
"when": "false"

View File

@@ -130,6 +130,7 @@ export type LocalQueryCommands = {
"codeQL.runQueryOnMultipleDatabasesContextEditor": (
uri?: Uri,
) => Promise<void>;
"codeQL.runLocalQueryFromQueriesPanel": (uri?: Uri) => Promise<void>;
"codeQL.runQueries": ExplorerSelectionCommandFunction<Uri>;
"codeQL.quickEval": (uri: Uri) => Promise<void>;
"codeQL.quickEvalContextEditor": (uri: Uri) => Promise<void>;

View File

@@ -100,6 +100,7 @@ export class LocalQueries extends DisposableObject {
this.runQueryOnMultipleDatabases.bind(this),
"codeQL.runQueryOnMultipleDatabasesContextEditor":
this.runQueryOnMultipleDatabases.bind(this),
"codeQL.runLocalQueryFromQueriesPanel": this.runQuery.bind(this),
"codeQL.runQueries": createMultiSelectionCommand(
this.runQueries.bind(this),
),

View File

@@ -55,7 +55,7 @@ export class QueriesModule extends DisposableObject {
this.push(queryDiscovery);
void queryDiscovery.initialRefresh();
const queriesPanel = new QueriesPanel(app, queryDiscovery);
this.push(queriesPanel);
this.queriesPanel = new QueriesPanel(app, queryDiscovery);
this.push(this.queriesPanel);
}
}

View File

@@ -31,7 +31,7 @@ export class QueriesPanel extends DisposableObject {
queryTreeViewItem: QueryTreeViewItem,
): Promise<void> {
await this.app.commands.execute(
"codeQL.runQuery",
"codeQL.runLocalQueryFromQueriesPanel",
vscode.Uri.parse(queryTreeViewItem.path),
);
}