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

Fix ast view and command registration #1113

Merged
merged 3 commits into from
Feb 4, 2022
Merged

Conversation

aeisenberg
Copy link
Contributor

@aeisenberg aeisenberg commented Feb 2, 2022

Two small bugs:

  1. The AST view command was viewing the wrong ast when the command was
    selected from the context menu. It was always selecting the active
    editor instead of the item selected in the file menu.
  2. The codeql.showLogs command was not being registered properly.
    With this change, there is uniform error handling, telemetry,
    and disposal.

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.

Two small bugs:

1. The AST view command was viewing the wrong ast when the command was
   selected from the context menu. It was always selecting the active
   editor instead of the item selected in the file menu.
2. The `codeql.showLogs` command was not being registered properly.
   With this change, there is uniform error handling, telemetry,
   and disposal.
@aeisenberg aeisenberg requested a review from a team as a code owner February 2, 2022 21:31
@aeisenberg aeisenberg requested a review from a team February 3, 2022 16:14
Copy link
Contributor

@shati-patel shati-patel 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! 🙌🏽

Just a minor comment/question: I accidentally selected "View AST" on a folder, which then showed up in the AST view (but doesn't have anything useful) 😅 Should this throw the error Cannot view the AST. Please select a valid source file...?

755FEBDC-F392-4787-9444-68869B795EA9

extensions/ql-vscode/CHANGELOG.md Outdated Show resolved Hide resolved
@aeisenberg
Copy link
Contributor Author

Thanks for finding that bug. I hadn't even thought of trying to run on a directory.

When a directory is selected or there are multiple selections, do not
show the command.
@aeisenberg aeisenberg force-pushed the aeisenberg/small-fixes branch from 271d168 to c046d3b Compare February 4, 2022 19:04
Copy link
Contributor

@shati-patel shati-patel left a comment

Choose a reason for hiding this comment

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

🎉 Thanks for fixing this! 💖

@aeisenberg aeisenberg merged commit b237baf into main Feb 4, 2022
@aeisenberg aeisenberg deleted the aeisenberg/small-fixes branch February 4, 2022 19:54
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.

2 participants