Skip to content

Commit 9db40c2

Browse files
angelapwenedoardopirovano
authored andcommitted
Gate show eval log and summary commands behind CLI v2.8.4 (#1243)
1 parent ce86ec1 commit 9db40c2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

extensions/ql-vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,12 +736,12 @@
736736
{
737737
"command": "codeQLQueryHistory.showEvalLog",
738738
"group": "9_qlCommands",
739-
"when": "viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem"
739+
"when": "codeql.supportsEvalLog && (viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem)"
740740
},
741741
{
742742
"command": "codeQLQueryHistory.showEvalLogSummary",
743743
"group": "9_qlCommands",
744-
"when": "viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem"
744+
"when": "codeql.supportsEvalLog && (viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem)"
745745
},
746746
{
747747
"command": "codeQLQueryHistory.showQueryText",

extensions/ql-vscode/src/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Readable } from 'stream';
88
import { StringDecoder } from 'string_decoder';
99
import * as tk from 'tree-kill';
1010
import { promisify } from 'util';
11-
import { CancellationToken, Disposable, Uri } from 'vscode';
11+
import { CancellationToken, commands, Disposable, Uri } from 'vscode';
1212

1313
import { BQRSInfo, DecodedBqrsChunk } from './pure/bqrs-cli-types';
1414
import { CliConfig } from './config';
@@ -957,6 +957,10 @@ export class CodeQLCliServer implements Disposable {
957957
public async getVersion() {
958958
if (!this._version) {
959959
this._version = await this.refreshVersion();
960+
// this._version is only undefined upon config change, so we reset CLI-based context key only when necessary.
961+
await commands.executeCommand(
962+
'setContext', 'codeql.supportsEvalLog', await this.cliConstraints.supportsPerQueryEvalLog()
963+
);
960964
}
961965
return this._version;
962966
}

0 commit comments

Comments
 (0)