Skip to content

Commit 4fda4f7

Browse files
committed
Split quickEval command
1 parent 6356149 commit 4fda4f7

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

extensions/ql-vscode/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@
338338
"command": "codeQL.quickEval",
339339
"title": "CodeQL: Quick Evaluation"
340340
},
341+
{
342+
"command": "codeQL.quickEvalContextEditor",
343+
"title": "CodeQL: Quick Evaluation"
344+
},
341345
{
342346
"command": "codeQL.openReferencedFile",
343347
"title": "CodeQL: Open Referenced File"
@@ -1012,6 +1016,10 @@
10121016
"command": "codeQL.quickEval",
10131017
"when": "editorLangId == ql"
10141018
},
1019+
{
1020+
"command": "codeQL.quickEvalContextEditor",
1021+
"when": "false"
1022+
},
10151023
{
10161024
"command": "codeQL.openReferencedFile",
10171025
"when": "resourceExtname == .qlref"
@@ -1283,7 +1291,7 @@
12831291
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
12841292
},
12851293
{
1286-
"command": "codeQL.quickEval",
1294+
"command": "codeQL.quickEvalContextEditor",
12871295
"when": "editorLangId == ql"
12881296
},
12891297
{

extensions/ql-vscode/src/extension.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ async function activateWithInstalledDistribution(
10741074
queryServerLogger,
10751075
),
10761076
);
1077+
10771078
ctx.subscriptions.push(
10781079
commandRunnerWithProgress(
10791080
"codeQL.quickEval",
@@ -1091,6 +1092,24 @@ async function activateWithInstalledDistribution(
10911092
),
10921093
);
10931094

1095+
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.quickEval" command
1096+
ctx.subscriptions.push(
1097+
commandRunnerWithProgress(
1098+
"codeQL.quickEvalContextEditor",
1099+
async (
1100+
progress: ProgressCallback,
1101+
token: CancellationToken,
1102+
uri: Uri | undefined,
1103+
) => await compileAndRunQuery(true, uri, progress, token, undefined),
1104+
{
1105+
title: "Running query",
1106+
cancellable: true,
1107+
},
1108+
// Open the query server logger on error since that's usually where the interesting errors appear.
1109+
queryServerLogger,
1110+
),
1111+
);
1112+
10941113
ctx.subscriptions.push(
10951114
commandRunnerWithProgress(
10961115
"codeQL.codeLensQuickEval",

0 commit comments

Comments
 (0)