Skip to content

Commit 6deb04b

Browse files
committed
Split codeQL.previewQueryHelp command
1 parent b6df591 commit 6deb04b

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

extensions/ql-vscode/package.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,14 @@
476476
"command": "codeQL.previewQueryHelp",
477477
"title": "CodeQL: Preview Query Help"
478478
},
479+
{
480+
"command": "codeQL.previewQueryHelpContextExplorer",
481+
"title": "CodeQL: Preview Query Help"
482+
},
483+
{
484+
"command": "codeQL.previewQueryHelpContextEditor",
485+
"title": "CodeQL: Preview Query Help"
486+
},
479487
{
480488
"command": "codeQL.quickQuery",
481489
"title": "CodeQL: Quick Query"
@@ -1122,7 +1130,7 @@
11221130
"when": "resourceExtname == .qlref"
11231131
},
11241132
{
1125-
"command": "codeQL.previewQueryHelp",
1133+
"command": "codeQL.previewQueryHelpContextExplorer",
11261134
"group": "9_qlCommands",
11271135
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
11281136
}
@@ -1208,6 +1216,14 @@
12081216
"command": "codeQL.previewQueryHelp",
12091217
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
12101218
},
1219+
{
1220+
"command": "codeQL.previewQueryHelpContextEditor",
1221+
"when": "false"
1222+
},
1223+
{
1224+
"command": "codeQL.previewQueryHelpContextExplorer",
1225+
"when": "false"
1226+
},
12111227
{
12121228
"command": "codeQL.setCurrentDatabase",
12131229
"when": "false"
@@ -1519,7 +1535,7 @@
15191535
"when": "resourceExtname == .qlref"
15201536
},
15211537
{
1522-
"command": "codeQL.previewQueryHelp",
1538+
"command": "codeQL.previewQueryHelpContextEditor",
15231539
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
15241540
},
15251541
{

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ export type QueryEditorCommands = {
115115
selectedQuery: Uri,
116116
) => Promise<void>;
117117
"codeQL.previewQueryHelp": (selectedQuery: Uri) => Promise<void>;
118+
"codeQL.previewQueryHelpContextEditor": (selectedQuery: Uri) => Promise<void>;
119+
"codeQL.previewQueryHelpContextExplorer": (
120+
selectedQuery: Uri,
121+
) => Promise<void>;
118122
};
119123

120124
// Commands used for running local queries

extensions/ql-vscode/src/language-support/query-editor.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ export function getQueryEditorCommands({
3838
qhelpTmpDir,
3939
selectedQuery,
4040
),
41+
"codeQL.previewQueryHelpContextEditor": async (selectedQuery: Uri) =>
42+
await previewQueryHelp(
43+
commandManager,
44+
cliServer,
45+
qhelpTmpDir,
46+
selectedQuery,
47+
),
48+
"codeQL.previewQueryHelpContextExplorer": async (selectedQuery: Uri) =>
49+
await previewQueryHelp(
50+
commandManager,
51+
cliServer,
52+
qhelpTmpDir,
53+
selectedQuery,
54+
),
4155
};
4256
}
4357

0 commit comments

Comments
 (0)