Skip to content

Commit 68f566d

Browse files
committed
Pass --old-eval-stats to query server
This is in preparation of supporting structured query logs. When passing this option, use the old format of query logs. Later, when we want to add support for structured query logs, we can add remove this option.
1 parent bf35077 commit 68f566d

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

extensions/ql-vscode/src/cli.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class CodeQLCliServer implements Disposable {
169169
/** Version of current cli, lazily computed by the `getVersion()` method */
170170
private _version: SemVer | undefined;
171171

172-
/**
172+
/**
173173
* The languages supported by the current version of the CLI, computed by `getSupportedLanguages()`.
174174
*/
175175
private _supportedLanguages: string[] | undefined;
@@ -806,7 +806,7 @@ export class CodeQLCliServer implements Disposable {
806806
/**
807807
* Gets the list of available languages. Refines the result of `resolveLanguages()`, by excluding
808808
* extra things like "xml" and "properties".
809-
*
809+
*
810810
* @returns An array of languages that are supported by the current version of the CodeQL CLI.
811811
*/
812812
public async getSupportedLanguages(): Promise<string[]> {
@@ -1186,6 +1186,11 @@ export class CliVersionConstraint {
11861186
*/
11871187
public static CLI_VERSION_WITH_RESOLVE_ML_MODELS = new SemVer('2.7.3');
11881188

1189+
/**
1190+
* CLI version where the `--old-eval-stats` option to the query server was introduced.
1191+
*/
1192+
public static CLI_VERSION_WITH_OLD_EVAL_STATS = new SemVer('2.7.4');
1193+
11891194
constructor(private readonly cli: CodeQLCliServer) {
11901195
/**/
11911196
}
@@ -1234,4 +1239,7 @@ export class CliVersionConstraint {
12341239
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_RESOLVE_ML_MODELS);
12351240
}
12361241

1242+
async supportsOldEvalStats() {
1243+
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_OLD_EVAL_STATS);
1244+
}
12371245
}

extensions/ql-vscode/src/queryserver-client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ export class QueryServerClient extends DisposableObject {
167167
args.push('--require-db-registration');
168168
}
169169

170+
if (await this.cliServer.cliConstraints.supportsOldEvalStats()) {
171+
args.push('--old-eval-stats');
172+
}
173+
170174
if (this.config.debug) {
171175
args.push('--debug', '--tuple-counting');
172176
}

0 commit comments

Comments
 (0)