Skip to content

Commit 76cd2fa

Browse files
authored
Gate show eval log and summary commands behind CLI v2.8.4 (#1243)
1 parent 45b32e9 commit 76cd2fa

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
@@ -717,12 +717,12 @@
717717
{
718718
"command": "codeQLQueryHistory.showEvalLog",
719719
"group": "9_qlCommands",
720-
"when": "viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem"
720+
"when": "codeql.supportsEvalLog && (viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem)"
721721
},
722722
{
723723
"command": "codeQLQueryHistory.showEvalLogSummary",
724724
"group": "9_qlCommands",
725-
"when": "viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem"
725+
"when": "codeql.supportsEvalLog && (viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem)"
726726
},
727727
{
728728
"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)