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

Add quick eval count to the command palette #2475

Merged
merged 7 commits into from
Jun 27, 2023
Merged

Conversation

alexet
Copy link
Contributor

@alexet alexet commented Jun 2, 2023

This allows using quick-eval-count via the command palette. Quick eval count generates column counts and overall count of the results instead of generating locations and strings. As generating locations and strings can be expensive and the number of results is often more useful this can shave time off debugging complex queries. As this is fairly advanced and to avoid cluttering the context menu I have not added a context menu. We can revisit this in future.

@dbartol I am leaving it to you to decide how to integrate this into the debugging workflow. This should probably be treated like a quick-eval option there.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@alexet alexet marked this pull request as ready for review June 2, 2023 14:27
@alexet alexet requested a review from a team as a code owner June 2, 2023 14:28
@alexet alexet requested a review from dbartol June 2, 2023 14:28
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 2 minor points inline.

@@ -7,6 +7,7 @@
- Fix bug where the `CodeQL: Compare Query` command did not work for comparing quick-eval queries. [#2422](https://github.com/github/vscode-codeql/pull/2422)
- Update text of copy and export buttons in variant analysis results view to clarify that they only copy/export the selected/filtered results. [#2427](https://github.com/github/vscode-codeql/pull/2427)
- Add warning when using unsupported CodeQL CLI version. [#2428](https://github.com/github/vscode-codeql/pull/2428)
- Add `CodeQL: Quick Evaluation Count` command to generate the count of the selected item without having to compute locations or strings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: do you think it would be better to include a reason why someone would want to use htis instead of standard quick eval (ie- to save computation time)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also some wording like "statistics" or "the number of results produced by the selected logic" so it's more obvious what the count is?

async (progress, token) => {
if (!(await this.cliServer.cliConstraints.supportsQuickEvalCount())) {
throw new Error(
"Quick evaluation counts is not supported by this version of CodeQL CLI.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Quick evaluation counts is not supported by this version of CodeQL CLI.",
`Quick evaluation counts is only supported by CodeQL CLI v${CliVersionConstraint.CLI_VERSION_WITH_QUICK_EVAL_COUNT} or later.",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"count is" or "counts are"

@alexet alexet merged commit b0699ee into main Jun 27, 2023
@alexet alexet deleted the alexet/quick-eval-count branch June 27, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants