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 hover for global variables #2691

Merged
merged 5 commits into from
Oct 16, 2024

Conversation

snutij
Copy link
Contributor

@snutij snutij commented Oct 8, 2024

Motivation

Iteration of #2644
Handle global variables in hover requests.

Implementation

Handle each kind of global variable node in the listener pattern, then search for entries in the index with the variable name, and finally, push the documentation for entries to the response_builder.

Automated Tests

  • Added a test with assertions for each kind of global variable
  • Added a test with assertions to ensure the target is unset if the hover is not exactly on the variable name

Manual Tests

  • Write $DEBUG within a file, then hover over it. You should see documentation from the RBS declaration.
  • Write a custom $foo variable with a comment, hover over it, you should see the hover.
  • You should not see documentation when hovering not exactly on variable name
Kapture.2024-10-16.at.09.42.12.mp4

@snutij snutij requested a review from a team as a code owner October 8, 2024 19:51
@andyw8 andyw8 added enhancement New feature or request server This pull request should be included in the server gem's release notes labels Oct 8, 2024
@st0012 st0012 removed their request for review October 14, 2024 11:30
@snutij snutij requested a review from andyw8 October 16, 2024 08:09
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for the contribution 🚀

@vinistock vinistock merged commit 5ec5b4b into Shopify:main Oct 16, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants