-
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 rename support for constants #2626
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
16b741b
to
f15a0af
Compare
f15a0af
to
ae8a87a
Compare
❌ Deploy Preview for ruby-lsp failed.
|
ae8a87a
to
a40caf8
Compare
Should we allow people to change namespaces with this? e.g. renaming It 'works' but does complicate some things. |
a40caf8
to
f0cbd0d
Compare
f0cbd0d
to
c60e050
Compare
🤔 If a constant is already defined, should we prevent someone to renaming to that constant? |
c60e050
to
21f56af
Compare
Added a check for this. Great catch. |
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.
I still prefer assigning attributes to ivars. But it's a small detail that can be discussed later.
21f56af
to
377e988
Compare
Motivation
Closes #57
This PR adds rename support for constants, modules and classes.
Implementation
ReferenceFinder
. This is essentially a simplified copy of our declaration listener. I believe that either the declaration listener can be modified to support collecting references or we can extract some abstraction for both to use. However, I would like to start with a copy, so that we can see the patterns emerge as we add support for more renamesAutomated Tests
Added tests.