Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid showing an error when query has not @kind metadata #801

Merged
merged 1 commit into from
Mar 22, 2021
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]

- 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)
Expand Down
7 changes: 6 additions & 1 deletion extensions/ql-vscode/src/run-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,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;
}

/**
Expand Down