Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,14 @@
"command": "codeQL.previewQueryHelp",
"title": "CodeQL: Preview Query Help"
},
{
"command": "codeQL.previewQueryHelpContextExplorer",
"title": "CodeQL: Preview Query Help"
},
{
"command": "codeQL.previewQueryHelpContextEditor",
"title": "CodeQL: Preview Query Help"
},
{
"command": "codeQL.quickQuery",
"title": "CodeQL: Quick Query"
Expand Down Expand Up @@ -828,6 +836,11 @@
"title": "CodeQL: Go to QL Code",
"enablement": "codeql.hasQLSource"
},
{
"command": "codeQL.gotoQLContextEditor",
"title": "CodeQL: Go to QL Code",
"enablement": "codeql.hasQLSource"
},
{
"command": "codeQL.openDataExtensionsEditor",
"title": "CodeQL: Open Data Extensions Editor"
Expand Down Expand Up @@ -1117,7 +1130,7 @@
"when": "resourceExtname == .qlref"
},
{
"command": "codeQL.previewQueryHelp",
"command": "codeQL.previewQueryHelpContextExplorer",
"group": "9_qlCommands",
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
}
Expand Down Expand Up @@ -1203,6 +1216,14 @@
"command": "codeQL.previewQueryHelp",
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
},
{
"command": "codeQL.previewQueryHelpContextEditor",
"when": "false"
},
{
"command": "codeQL.previewQueryHelpContextExplorer",
"when": "false"
},
{
"command": "codeQL.setCurrentDatabase",
"when": "false"
Expand Down Expand Up @@ -1466,6 +1487,10 @@
{
"command": "codeQLTests.acceptOutputContextTestItem",
"when": "false"
},
{
"command": "codeQL.gotoQLContextEditor",
"when": "false"
}
],
"editor/context": [
Expand Down Expand Up @@ -1510,11 +1535,11 @@
"when": "resourceExtname == .qlref"
},
{
"command": "codeQL.previewQueryHelp",
"command": "codeQL.previewQueryHelpContextEditor",
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
},
{
"command": "codeQL.gotoQL",
"command": "codeQL.gotoQLContextEditor",
"when": "editorLangId == ql-summary && config.codeQL.canary"
}
]
Expand Down
5 changes: 5 additions & 0 deletions extensions/ql-vscode/src/common/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export type QueryEditorCommands = {
selectedQuery: Uri,
) => Promise<void>;
"codeQL.previewQueryHelp": (selectedQuery: Uri) => Promise<void>;
"codeQL.previewQueryHelpContextEditor": (selectedQuery: Uri) => Promise<void>;
"codeQL.previewQueryHelpContextExplorer": (
selectedQuery: Uri,
) => Promise<void>;
};

// Commands used for running local queries
Expand Down Expand Up @@ -299,6 +303,7 @@ export type EvalLogViewerCommands = {

export type SummaryLanguageSupportCommands = {
"codeQL.gotoQL": () => Promise<void>;
"codeQL.gotoQLContextEditor": () => Promise<void>;
};

export type TestUICommands = {
Expand Down
14 changes: 14 additions & 0 deletions extensions/ql-vscode/src/language-support/query-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ export function getQueryEditorCommands({
qhelpTmpDir,
selectedQuery,
),
"codeQL.previewQueryHelpContextEditor": async (selectedQuery: Uri) =>
await previewQueryHelp(
commandManager,
cliServer,
qhelpTmpDir,
selectedQuery,
),
"codeQL.previewQueryHelpContextExplorer": async (selectedQuery: Uri) =>
await previewQueryHelp(
commandManager,
cliServer,
qhelpTmpDir,
selectedQuery,
),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class SummaryLanguageSupport extends DisposableObject {
public getCommands(): SummaryLanguageSupportCommands {
return {
"codeQL.gotoQL": this.handleGotoQL.bind(this),
"codeQL.gotoQLContextEditor": this.handleGotoQL.bind(this),
};
}

Expand Down