From 4d33e5143bf8913a17b2e326830d62817b271a96 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Mon, 22 Mar 2021 08:03:13 -0700 Subject: [PATCH] Avoid showing an error when query has not @kind metadata (#801) Fixes #800 --- extensions/ql-vscode/CHANGELOG.md | 2 ++ extensions/ql-vscode/src/run-queries.ts | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 72d0acbc4b5..d610c30667d 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Avoid showing an error popup when user runs a query without `@kind` metadata. [#801](https://github.com/github/vscode-codeql/pull/801) + ## 1.4.4 - 19 March 2021 - Introduce evaluator options for saving intermediate results to the disk cache (`codeQL.runningQueries.saveCache`) and for limiting the size of this cache (`codeQL.runningQueries.cacheSize`). [#778](https://github.com/github/vscode-codeql/pull/778) diff --git a/extensions/ql-vscode/src/run-queries.ts b/extensions/ql-vscode/src/run-queries.ts index ec7f084b5e8..f88901023f4 100644 --- a/extensions/ql-vscode/src/run-queries.ts +++ b/extensions/ql-vscode/src/run-queries.ts @@ -170,7 +170,12 @@ export class QueryInfo { if (!hasMetadataFile) { logger.log('Cannot produce interpreted results since the database does not have a .dbinfo or codeql-database.yml file.'); } - return hasMetadataFile; + + const hasKind = !!this.metadata?.kind; + if (!hasKind) { + logger.log('Cannot produce interpreted results since the query does not have @kind metadata.'); + } + return hasMetadataFile && hasKind; } /**