Split quickEval command

This commit is contained in:
Nora
2023-03-09 12:48:47 +00:00
parent 6356149e54
commit 4fda4f71dd
2 changed files with 28 additions and 1 deletions

View File

@@ -338,6 +338,10 @@
"command": "codeQL.quickEval",
"title": "CodeQL: Quick Evaluation"
},
{
"command": "codeQL.quickEvalContextEditor",
"title": "CodeQL: Quick Evaluation"
},
{
"command": "codeQL.openReferencedFile",
"title": "CodeQL: Open Referenced File"
@@ -1012,6 +1016,10 @@
"command": "codeQL.quickEval",
"when": "editorLangId == ql"
},
{
"command": "codeQL.quickEvalContextEditor",
"when": "false"
},
{
"command": "codeQL.openReferencedFile",
"when": "resourceExtname == .qlref"
@@ -1283,7 +1291,7 @@
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
},
{
"command": "codeQL.quickEval",
"command": "codeQL.quickEvalContextEditor",
"when": "editorLangId == ql"
},
{

View File

@@ -1074,6 +1074,7 @@ async function activateWithInstalledDistribution(
queryServerLogger,
),
);
ctx.subscriptions.push(
commandRunnerWithProgress(
"codeQL.quickEval",
@@ -1091,6 +1092,24 @@ async function activateWithInstalledDistribution(
),
);
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.quickEval" command
ctx.subscriptions.push(
commandRunnerWithProgress(
"codeQL.quickEvalContextEditor",
async (
progress: ProgressCallback,
token: CancellationToken,
uri: Uri | undefined,
) => await compileAndRunQuery(true, uri, progress, token, undefined),
{
title: "Running query",
cancellable: true,
},
// Open the query server logger on error since that's usually where the interesting errors appear.
queryServerLogger,
),
);
ctx.subscriptions.push(
commandRunnerWithProgress(
"codeQL.codeLensQuickEval",