-
Notifications
You must be signed in to change notification settings - Fork 175
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
Support Hover, Completion, Go to definition for Class Variables #2944
Support Hover, Completion, Go to definition for Class Variables #2944
Conversation
…on receiver similiar to instance variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great. Just a small gotcha about class variables that we need to be careful about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very close. Just a couple of other things and we can finally ship. I appreciate the effort on this addition!
Completion resolve
The definitions documentation is missing.
This is happening because we're missing the new entry type in this check.
Completion trigger
I also noticed that we don't get any completion suggestions until entering the second @
symbol. This happens because, until you add the second one, you have an instance variable node, rather than a class variable node.
I think it would be nice to show class variables as part of the completion when you add a single @
symbol, since there's a chance that the user is looking for those.
That said, I just wanted to document this for a future PR. Please don't worry about it in this one.
Good catch on completion resolve. I completely forgot to check the definition during completion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this. Thanks for sticking with it and pushing an entire full set of features over the finish line 🚀
Regarding the completion when inserting a single @
, it seems that it's a bit more nuanced. It works as expected inside instance methods, but whenever we're inside any level of singleton contexts then we only get completion after the second @
is inserted.
Screen.Recording.2025-01-03.at.10.20.36.AM.mov
I also checked and inheritance doesn't seem to be playing a role in it, so it's likely there's some tiny difference in how singleton contexts are being handled. I think writing a completion test for this specific example and then debugging will reveal where the issue is.
I'll ship the PR to avoid delaying it any further. Let me know if you want to take a stab at the completion thing, otherwise I can create an issue for it
Sure, I'll work on it. |
Motivation
closes #2897
Implementation
I’ve made separate commits for each feature, hoping it makes the review process easier.
Automated Tests
Added new tests
Manual Tests
Screencast.from.01-12-24.07.46.01.PM.IST.webm