-
Notifications
You must be signed in to change notification settings - Fork 185
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
Rename support #768
base: master
Are you sure you want to change the base?
Rename support #768
Conversation
Codecov Report
@@ Coverage Diff @@
## master #768 +/- ##
============================================
- Coverage 82.12% 81.07% -1.06%
- Complexity 935 955 +20
============================================
Files 44 44
Lines 2154 2219 +65
============================================
+ Hits 1769 1799 +30
- Misses 385 420 +35
|
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.
Thanks for taking a stab at this! However, the issues in the description seem like blockers before merging this.
I rewrote the definition finding and added code to update the index after the rename. The issues I described earlier should be solved with this. |
@@ -423,6 +426,9 @@ private function indexDefinition(int $level, array $parts, array &$storage, Defi | |||
*/ | |||
private function removeIndexedDefinition(int $level, array $parts, array &$storage, array &$rootStorage) | |||
{ | |||
if (empty($parts)) { |
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 don't really understand this function well enough to be confident about this code, but it fixes an exception that I got before and it seems intuitively right to have a base case for the recursion.
This PR attempts to implement the rename function. Therefore it implements #21 .
There are however still some limitations:
If there isn't a reference in the same file, as the definition, the definition doesn't get changed.
Also at least in my editor (nvim) it is only possible to do one rename and it's necessary to restart before doing the next rename.
I would appreciate any help with these issues or any further comments.