Skip to content

Commit e722bf3

Browse files
authored
Merge branch 'main' into github-action/bump-cli
2 parents 5084b32 + a4f1f49 commit e722bf3

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

extensions/ql-vscode/package.json

Lines changed: 28 additions & 3 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"
@@ -828,6 +836,11 @@
828836
"title": "CodeQL: Go to QL Code",
829837
"enablement": "codeql.hasQLSource"
830838
},
839+
{
840+
"command": "codeQL.gotoQLContextEditor",
841+
"title": "CodeQL: Go to QL Code",
842+
"enablement": "codeql.hasQLSource"
843+
},
831844
{
832845
"command": "codeQL.openDataExtensionsEditor",
833846
"title": "CodeQL: Open Data Extensions Editor"
@@ -1117,7 +1130,7 @@
11171130
"when": "resourceExtname == .qlref"
11181131
},
11191132
{
1120-
"command": "codeQL.previewQueryHelp",
1133+
"command": "codeQL.previewQueryHelpContextExplorer",
11211134
"group": "9_qlCommands",
11221135
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
11231136
}
@@ -1203,6 +1216,14 @@
12031216
"command": "codeQL.previewQueryHelp",
12041217
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
12051218
},
1219+
{
1220+
"command": "codeQL.previewQueryHelpContextEditor",
1221+
"when": "false"
1222+
},
1223+
{
1224+
"command": "codeQL.previewQueryHelpContextExplorer",
1225+
"when": "false"
1226+
},
12061227
{
12071228
"command": "codeQL.setCurrentDatabase",
12081229
"when": "false"
@@ -1466,6 +1487,10 @@
14661487
{
14671488
"command": "codeQLTests.acceptOutputContextTestItem",
14681489
"when": "false"
1490+
},
1491+
{
1492+
"command": "codeQL.gotoQLContextEditor",
1493+
"when": "false"
14691494
}
14701495
],
14711496
"editor/context": [
@@ -1510,11 +1535,11 @@
15101535
"when": "resourceExtname == .qlref"
15111536
},
15121537
{
1513-
"command": "codeQL.previewQueryHelp",
1538+
"command": "codeQL.previewQueryHelpContextEditor",
15141539
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
15151540
},
15161541
{
1517-
"command": "codeQL.gotoQL",
1542+
"command": "codeQL.gotoQLContextEditor",
15181543
"when": "editorLangId == ql-summary && config.codeQL.canary"
15191544
}
15201545
]

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

Lines changed: 5 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
@@ -299,6 +303,7 @@ export type EvalLogViewerCommands = {
299303

300304
export type SummaryLanguageSupportCommands = {
301305
"codeQL.gotoQL": () => Promise<void>;
306+
"codeQL.gotoQLContextEditor": () => Promise<void>;
302307
};
303308

304309
export type TestUICommands = {

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

extensions/ql-vscode/src/log-insights/summary-language-support.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export class SummaryLanguageSupport extends DisposableObject {
7878
public getCommands(): SummaryLanguageSupportCommands {
7979
return {
8080
"codeQL.gotoQL": this.handleGotoQL.bind(this),
81+
"codeQL.gotoQLContextEditor": this.handleGotoQL.bind(this),
8182
};
8283
}
8384

0 commit comments

Comments
 (0)