vscode-codeql icon indicating copy to clipboard operation
vscode-codeql copied to clipboard

Support for query suites

Open p0 opened this issue 4 years ago • 5 comments

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.

p0 avatar Oct 12 '20 10:10 p0

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.

aeisenberg avatar Dec 21 '20 15:12 aeisenberg

Has the team started implementing it yet?

vovikhangcdv avatar Apr 13 '21 09:04 vovikhangcdv

Not yet. To run query suites, I suggest using the cli directly.

aeisenberg avatar Apr 13 '21 17:04 aeisenberg

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?

kwang1083 avatar Jul 19 '23 18:07 kwang1083

No. Variant analysis runs one query at a time.

aeisenberg avatar Jul 19 '23 20:07 aeisenberg