-
Notifications
You must be signed in to change notification settings - Fork 172
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 find references support for constants #2632
Conversation
Do we need any safeguards for someone running Find References on a large codebase for some constant with a high number of occurrences? |
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.
Very exciting to have this.
8d1136c
to
6b96c8c
Compare
I found one issue: Create a new file, but don't save it: class Widget2
def bar
end
end
Widget2 Right-click on The LSP will error with:
|
b706ba9
to
39d4757
Compare
f15a0af
to
ae8a87a
Compare
39d4757
to
933a025
Compare
The issue was related to not finding a target. I fixed it in the latest push. |
21f56af
to
377e988
Compare
933a025
to
4274afd
Compare
Motivation
Closes #202
With the same infrastructure added in #2626, we can easily support finding constant references. Instead of building an array of text edits, we just return an array of locations.
Implementation
The idea is to use the same reference finder implementation and then return all of the hits back as locations.
I also had to fix a small duplication issue to be able to respect the LSP spec's
includeDeclaration
parameter.Automated Tests
Added tests.