Create new runQuery command for the queries panel
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user