php-language-server icon indicating copy to clipboard operation
php-language-server copied to clipboard

Rename support

Open rummatee opened this issue 6 years ago • 2 comments
trafficstars

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.

rummatee avatar Nov 12 '19 19:11 rummatee

Codecov Report

Merging #768 into master will decrease coverage by 1.05%. The diff coverage is 52.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)

codecov[bot] avatar Nov 15 '19 16:11 codecov[bot]

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.

rummatee avatar Nov 28 '19 00:11 rummatee