Skip to content

Commit adb7072

Browse files
committed
Use CliConstraints consistently
1 parent eb9d12b commit adb7072

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

extensions/ql-vscode/src/codeql-cli/cli-version.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ interface VersionResult {
1010
}
1111

1212
export interface CliFeatures {
13-
featuresInVersionResult?: boolean;
1413
queryServerRunQueries?: boolean;
1514
}
1615

extensions/ql-vscode/src/codeql-cli/cli.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export class CodeQLCliServer implements Disposable {
269269
/** Path to current codeQL executable, or undefined if not running yet. */
270270
codeQlPath: string | undefined;
271271

272-
cliConstraints = new CliVersionConstraint();
272+
cliConstraints = new CliVersionConstraint(this);
273273

274274
/**
275275
* When set to true, ignore some modal popups and assume user has clicked "yes".
@@ -1902,4 +1902,12 @@ export class CliVersionConstraint {
19021902
// The oldest version of the CLI that we support. This is used to determine
19031903
// whether to show a warning about the CLI being too old on startup.
19041904
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.18.4");
1905+
1906+
constructor(private readonly cli: CodeQLCliServer) {
1907+
/**/
1908+
}
1909+
1910+
async supportsQueryServerRunQueries(): Promise<boolean> {
1911+
return (await this.cli.getFeatures()).queryServerRunQueries === true;
1912+
}
19051913
}

extensions/ql-vscode/src/query-server/query-server-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class QueryServerClient extends DisposableObject {
100100
* queries at once.
101101
*/
102102
async supportsRunQueriesMethod(): Promise<boolean> {
103-
return (await this.cliServer.getFeatures()).queryServerRunQueries === true;
103+
return await this.cliServer.cliConstraints.supportsQueryServerRunQueries();
104104
}
105105

106106
/** Stops the query server by disposing of the current server process. */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy