Skip to content

Commit 10d8bbf

Browse files
committed
Add run icon to file tab
1 parent 13a5b78 commit 10d8bbf

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

extensions/ql-vscode/package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,11 @@
503503
},
504504
{
505505
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
506-
"title": "Run local query",
506+
"title": "Run local query"
507+
},
508+
{
509+
"command": "codeQL.runLocalQueryFromFileTab",
510+
"title": "CodeQL: Run local query",
507511
"icon": "$(run)"
508512
},
509513
{
@@ -877,6 +881,13 @@
877881
}
878882
],
879883
"menus": {
884+
"editor/title": [
885+
{
886+
"command": "codeQL.runLocalQueryFromFileTab",
887+
"group": "navigation",
888+
"when": "config.codeQL.queriesPanel && resourceExtname == .ql && codeQL.currentDatabaseItem"
889+
}
890+
],
880891
"view/title": [
881892
{
882893
"command": "codeQLDatabases.sortByName",
@@ -1168,6 +1179,10 @@
11681179
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
11691180
"when": "false"
11701181
},
1182+
{
1183+
"command": "codeQL.runLocalQueryFromFileTab",
1184+
"when": "false"
1185+
},
11711186
{
11721187
"command": "codeQL.runQueryContextEditor",
11731188
"when": "false"

extensions/ql-vscode/src/common/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export type LocalQueryCommands = {
131131
uri?: Uri,
132132
) => Promise<void>;
133133
"codeQLQueries.runLocalQueryFromQueriesPanel": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
134+
"codeQL.runLocalQueryFromFileTab": (uri: Uri) => Promise<void>;
134135
"codeQL.runQueries": ExplorerSelectionCommandFunction<Uri>;
135136
"codeQL.quickEval": (uri: Uri) => Promise<void>;
136137
"codeQL.quickEvalContextEditor": (uri: Uri) => Promise<void>;

extensions/ql-vscode/src/local-queries/local-queries.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export class LocalQueries extends DisposableObject {
103103
this.runQueryOnMultipleDatabases.bind(this),
104104
"codeQLQueries.runLocalQueryFromQueriesPanel":
105105
this.runQueryFromQueriesPanel.bind(this),
106+
"codeQL.runLocalQueryFromFileTab": this.runQuery.bind(this),
106107
"codeQL.runQueries": createMultiSelectionCommand(
107108
this.runQueries.bind(this),
108109
),

extensions/ql-vscode/test/unit-tests/command-lint.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ describe("commands declared in package.json", () => {
6666
contribContextMenuCmds.add(command);
6767
});
6868

69+
menus["editor/title"].forEach((commandDecl: CmdDecl) => {
70+
const { command } = commandDecl;
71+
paletteCmds.delete(command);
72+
contribContextMenuCmds.add(command);
73+
});
74+
6975
debuggers.forEach((debuggerDecl: DebuggerDecl) => {
7076
if (debuggerDecl.variables !== undefined) {
7177
for (const command of Object.values(debuggerDecl.variables)) {

0 commit comments

Comments
 (0)