diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index c9e6516a441..26a2c6a5f25 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -3,6 +3,7 @@ ## [UNRELEASED] - Fix a bug where quick queries cannot be compiled if the core libraries are not in the workspace. [#1411](https://github.com/github/vscode-codeql/pull/1411) +- Fix a bug where quick evaluation of library files would display an error message when using CodeQL CLI v2.10.0. [#1412](https://github.com/github/vscode-codeql/pull/1412) ## 1.6.7 - 15 June 2022 diff --git a/extensions/ql-vscode/src/run-queries.ts b/extensions/ql-vscode/src/run-queries.ts index 9aaa3c2bc19..2520cd1e9b7 100644 --- a/extensions/ql-vscode/src/run-queries.ts +++ b/extensions/ql-vscode/src/run-queries.ts @@ -789,7 +789,11 @@ export async function compileAndRunQueryAgainstDatabase( const metadata = await tryGetQueryMetadata(cliServer, qlProgram.queryPath); let availableMlModels: cli.MlModelInfo[] = []; - if (await cliServer.cliConstraints.supportsResolveMlModels()) { + if (!initialInfo.queryPath.endsWith('.ql')) { + void logger.log('Quick evaluation within a query library does not currently support using ML models. Continuing without any ML models.'); + } else if (!await cliServer.cliConstraints.supportsResolveMlModels()) { + void logger.log('Resolving ML models is unsupported by this version of the CLI. Running the query without any ML models.'); + } else { try { availableMlModels = (await cliServer.resolveMlModels(diskWorkspaceFolders, initialInfo.queryPath)).models; if (availableMlModels.length) {