Skip to content

Commit a913ed0

Browse files
committed
Add run icon to file tab
1 parent a76bd46 commit a913ed0

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

extensions/ql-vscode/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@
501501
"command": "codeQL.copyVersion",
502502
"title": "CodeQL: Copy Version Information"
503503
},
504+
{
505+
"command": "codeQL.runLocalQueryFromFileTab",
506+
"title": "CodeQL: Run local query",
507+
"icon": "$(run)"
508+
},
504509
{
505510
"command": "codeQLVariantAnalysisRepositories.openConfigFile",
506511
"title": "Open database configuration file",
@@ -872,6 +877,13 @@
872877
}
873878
],
874879
"menus": {
880+
"editor/title": [
881+
{
882+
"command": "codeQL.runLocalQueryFromFileTab",
883+
"group": "navigation",
884+
"when": "config.codeQL.queriesPanel && resourceExtname == .ql"
885+
}
886+
],
875887
"view/title": [
876888
{
877889
"command": "codeQLDatabases.sortByName",
@@ -1154,6 +1166,10 @@
11541166
"command": "codeQL.runQuery",
11551167
"when": "resourceLangId == ql && resourceExtname == .ql"
11561168
},
1169+
{
1170+
"command": "codeQL.runLocalQueryFromFileTab",
1171+
"when": "false"
1172+
},
11571173
{
11581174
"command": "codeQL.runQueryContextEditor",
11591175
"when": "false"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export type LocalQueryCommands = {
129129
"codeQL.runQueryOnMultipleDatabasesContextEditor": (
130130
uri?: Uri,
131131
) => Promise<void>;
132+
"codeQL.runLocalQueryFromFileTab": (uri: Uri) => Promise<void>;
132133
"codeQL.runQueries": ExplorerSelectionCommandFunction<Uri>;
133134
"codeQL.quickEval": (uri: Uri) => Promise<void>;
134135
"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
@@ -100,6 +100,7 @@ export class LocalQueries extends DisposableObject {
100100
this.runQueryOnMultipleDatabases.bind(this),
101101
"codeQL.runQueryOnMultipleDatabasesContextEditor":
102102
this.runQueryOnMultipleDatabases.bind(this),
103+
"codeQL.runLocalQueryFromFileTab": this.runQuery.bind(this),
103104
"codeQL.runQueries": createMultiSelectionCommand(
104105
this.runQueries.bind(this),
105106
),

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

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

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

0 commit comments

Comments
 (0)