Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [UNRELEASED]

- Remove support for CodeQL CLI versions older than 2.14.6. [#3562](https://github.com/github/vscode-codeql/pull/3562)

## 1.12.5 - 9 April 2024

- Add new supported source and sink kinds in the CodeQL Model Editor [#3511](https://github.com/github/vscode-codeql/pull/3511)
Expand Down
29 changes: 1 addition & 28 deletions extensions/ql-vscode/src/codeql-cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1912,22 +1912,7 @@ function shouldDebugCliServer() {
export class CliVersionConstraint {
// The oldest version of the CLI that we support. This is used to determine
// whether to show a warning about the CLI being too old on startup.
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.13.5");

/**
* CLI version where the `generate extensible-predicate-metadata`
* command was implemented.
*/
public static CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA = new SemVer(
"2.14.3",
);

/**
* CLI version where the langauge server supports visisbility change notifications.
*/
public static CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS = new SemVer(
"2.14.0",
);
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.14.6");

/**
* CLI version where the query server supports the `evaluation/trimCache` method
Expand All @@ -1952,18 +1937,6 @@ export class CliVersionConstraint {
return (await this.cli.getVersion()).compare(v) >= 0;
}

async supportsVisibilityNotifications() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS,
);
}

async supportsGenerateExtensiblePredicateMetadata() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA,
);
}

async preservesExtensiblePredicatesInMrvaPack() {
// Negated, because we _stopped_ preserving these in 2.16.1.
return !(await this.isVersionAtLeast(
Expand Down
14 changes: 6 additions & 8 deletions extensions/ql-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1078,14 +1078,12 @@ async function activateWithInstalledDistribution(
});

// Handle visibility changes in the CodeQL language client.
if (await cliServer.cliConstraints.supportsVisibilityNotifications()) {
Window.onDidChangeVisibleTextEditors((editors) => {
languageClient.notifyVisibilityChange(editors);
});
// Send an inital notification to the language server
// to set the initial state of the visible editors.
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
}
Window.onDidChangeVisibleTextEditors((editors) => {
languageClient.notifyVisibilityChange(editors);
});
// Send an inital notification to the language server
// to set the initial state of the visible editors.
languageClient.notifyVisibilityChange(Window.visibleTextEditors);

// Jump-to-definition and find-references
void extLogger.log("Registering jump-to-definition handlers.");
Expand Down
20 changes: 8 additions & 12 deletions extensions/ql-vscode/src/variant-analysis/run-remote-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,14 @@ async function copyExistingQueryPack(
// Also include query files that contain extensible predicates. These query files are not
// needed for the query to run, but they are needed for the query pack to pass deep validation
// of data extensions.
if (
await cliServer.cliConstraints.supportsGenerateExtensiblePredicateMetadata()
) {
const metadata = await cliServer.generateExtensiblePredicateMetadata(
qlPackDetails.qlPackRootPath,
);
metadata.extensible_predicates.forEach((predicate) => {
if (predicate.path.endsWith(".ql")) {
toCopy.push(join(qlPackDetails.qlPackRootPath, predicate.path));
}
});
}
const metadata = await cliServer.generateExtensiblePredicateMetadata(
qlPackDetails.qlPackRootPath,
);
metadata.extensible_predicates.forEach((predicate) => {
if (predicate.path.endsWith(".ql")) {
toCopy.push(join(qlPackDetails.qlPackRootPath, predicate.path));
}
});

[
// also copy the lock file (either new name or old name) and the query file itself. These are not included in the packlist.
Expand Down
1 change: 0 additions & 1 deletion extensions/ql-vscode/supported_cli_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"v2.16.6",
"v2.15.5",
"v2.14.6",
"v2.13.5",
"nightly"
]
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,6 @@ describe("Variant Analysis Manager", () => {
// Test running core java queries to ensure that we can compile queries in packs
// that contain queries with extensible predicates
it("should run a remote query that is part of the java pack", async () => {
if (
!(await cli.cliConstraints.supportsGenerateExtensiblePredicateMetadata())
) {
console.log(
`Skipping test because generating extensible predicate metadata was only introduced in CLI version ${CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA}.`,
);
return;
}

if (!process.env.TEST_CODEQL_PATH) {
fail(
"TEST_CODEQL_PATH environment variable not set. It should point to the absolute path to a checkout of the codeql repository.",
Expand Down