php-language-server
php-language-server copied to clipboard
Rename support
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.
Codecov Report
Merging #768 into master will decrease coverage by
1.05%. The diff coverage is52.7%.
@@ 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
| Impacted Files | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| src/Definition.php | 100% <ø> (ø) |
6 <0> (ø) |
:arrow_down: |
| src/Index/Index.php | 75% <0%> (-2.42%) |
56 <0> (+2) |
|
| src/Factory/LocationFactory.php | 100% <100%> (ø) |
2 <1> (+1) |
:arrow_up: |
| src/DefinitionResolver.php | 87.58% <100%> (+0.12%) |
335 <0> (+3) |
:arrow_up: |
| src/Server/TextDocument.php | 64.83% <44.64%> (-10.73%) |
71 <36> (+14) |
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.