@@ -41,6 +41,12 @@ import { ExitCodeError, getCliError } from "./cli-errors";
4141import { UserCancellationException } from "../common/vscode/progress" ;
4242import type { LanguageClient } from "vscode-languageclient/node" ;
4343
44+ /**
45+ * The oldest version of the CLI that we support. This is used to determine
46+ * whether to show a warning about the CLI being too old on startup.
47+ */
48+ export const OLDEST_SUPPORTED_CLI_VERSION = new SemVer ( "2.20.7" ) ;
49+
4450/**
4551 * The version of the SARIF format that we are using.
4652 */
@@ -273,8 +279,6 @@ export class CodeQLCliServer implements Disposable {
273279 /** Path to current codeQL executable, or undefined if not running yet. */
274280 codeQlPath : string | undefined ;
275281
276- cliConstraints = new CliVersionConstraint ( this ) ;
277-
278282 /**
279283 * When set to true, ignore some modal popups and assume user has clicked "yes".
280284 */
@@ -1816,6 +1820,11 @@ export class CodeQLCliServer implements Disposable {
18161820 public async setUseExtensionPacks ( useExtensionPacks : boolean ) {
18171821 await this . cliConfig . setUseExtensionPacks ( useExtensionPacks ) ;
18181822 }
1823+
1824+ /** Checks if the CLI supports a specific feature. */
1825+ public async supportsFeature ( feature : keyof CliFeatures ) : Promise < boolean > {
1826+ return ( await this . getFeatures ( ) ) [ feature ] === true ;
1827+ }
18191828}
18201829
18211830/**
@@ -1922,17 +1931,3 @@ export function shouldDebugQueryServer() {
19221931function shouldDebugCliServer ( ) {
19231932 return isEnvTrue ( "CLI_SERVER_JAVA_DEBUG" ) ;
19241933}
1925-
1926- export class CliVersionConstraint {
1927- // The oldest version of the CLI that we support. This is used to determine
1928- // whether to show a warning about the CLI being too old on startup.
1929- public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer ( "2.20.7" ) ;
1930-
1931- constructor ( private readonly cli : CodeQLCliServer ) {
1932- /**/
1933- }
1934-
1935- async supportsQueryServerRunQueries ( ) : Promise < boolean > {
1936- return ( await this . cli . getFeatures ( ) ) . queryServerRunQueries === true ;
1937- }
1938- }
0 commit comments