Add run icon to file tab

This commit is contained in:
Nora
2023-06-23 14:32:05 +00:00
parent 13a5b7854f
commit 10d8bbfe63
4 changed files with 24 additions and 1 deletions

View File

@@ -503,7 +503,11 @@
},
{
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
"title": "Run local query",
"title": "Run local query"
},
{
"command": "codeQL.runLocalQueryFromFileTab",
"title": "CodeQL: Run local query",
"icon": "$(run)"
},
{
@@ -877,6 +881,13 @@
}
],
"menus": {
"editor/title": [
{
"command": "codeQL.runLocalQueryFromFileTab",
"group": "navigation",
"when": "config.codeQL.queriesPanel && resourceExtname == .ql && codeQL.currentDatabaseItem"
}
],
"view/title": [
{
"command": "codeQLDatabases.sortByName",
@@ -1168,6 +1179,10 @@
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
"when": "false"
},
{
"command": "codeQL.runLocalQueryFromFileTab",
"when": "false"
},
{
"command": "codeQL.runQueryContextEditor",
"when": "false"

View File

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

View File

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

View File

@@ -66,6 +66,12 @@ describe("commands declared in package.json", () => {
contribContextMenuCmds.add(command);
});
menus["editor/title"].forEach((commandDecl: CmdDecl) => {
const { command } = commandDecl;
paletteCmds.delete(command);
contribContextMenuCmds.add(command);
});
debuggers.forEach((debuggerDecl: DebuggerDecl) => {
if (debuggerDecl.variables !== undefined) {
for (const command of Object.values(debuggerDecl.variables)) {