vscode-codeql
vscode-codeql copied to clipboard
Support for query suites
Is your feature request related to a problem? Please describe. It'd be great to have the extension understend CodeQL query suites. This would ideally cover both authoring them and executing query suites on the currently-selected database.
Describe the solution you'd like
The *.qls
format is effectively YAML with a particular schema, so switching to YAML mode at least gives syntax highlighting at the moment. Having the schema used automatically for auto-complete suggestions and error checking would be great, though.
For bulk query execution, selecting a *.qls
file would be more flexible than the current "run all queries in this folder" approach. There's a slight UI challenge around how to make well-known query suites discoverable.
Describe alternatives you've considered
The current workaround is to edit *.qls
files after manually selecting YAML mode, and to use the CodeQL CLI to run query suites, though that doesn't insert them into the query history view.
It sounds like you are asking for 3 separate and related features here:
- [ ] Ability to run query suite files from inside the IDE. This will require a change to the query server. Ideally, the IDE would receive incremental updates as each query is complete, so the results view can be populated incrementally. However, that's not how the query server works and the only solution may be to wait until all queries are complete before displaying any results.
- [ ] Ability to edit
qls
files. For this, we may just need to create a json schema file for query suites, submit the schema to https://www.schemastore.org/json/ and ensure this extension has a dependency on the vscode-yaml extension. - [ ] Ability to run well-known query suites. We will need to do some sort of discovery process for this, similar to how we implement discovery for ql tests.
Has the team started implementing it yet?
Not yet. To run query suites, I suggest using the cli directly.
On a similar note for query suites, is there a way to run query suites on the selected variant analysis repositories? Either a way through the CLI or the directly through the extension interface?
No. Variant analysis runs one query at a time.