D25587: [KDevelop/PHP] fix rename of a variable

Hugues Mitonneau <noreply-Buy57tU0AsCGxO/ty/[email protected]>
Newsgroups gmane.comp.kde.devel.kdevelop
Message-ID <[email protected]>
hmitonneau created this revision.
hmitonneau added a project: KDevelop.
Herald added a subscriber: kdevelop-devel.
hmitonneau requested review of this revision.

REVISION SUMMARY
  Renaming a variable doesn't work.
  This is because in `KDevelop::DocumentChangeSetPrivate::generateNewText`, `rangeText(change.m_range, textLines)` return the value `$oldname` and `change.m_oldText` has the value `oldname`
  
  This patch modify the parser to remove the "$" in the range of variable identifiers. As a result, we can now rename a variable, but as a side effect, the "$" is no more highlighted with the variable (the "$" are always blue, and do not take color of the variable)
  
  F7788333: Screenshot_20191128_110431.png <https://phabricator.kde.org/F7788333>
  
  F7788334: Screenshot_20191128_110516.png <https://phabricator.kde.org/F7788334>
  
  F7788335: Screenshot_20191128_110534.png <https://phabricator.kde.org/F7788335>

TEST PLAN
  Right-click on a variable
  Select "Rename xxx..."
  Choose a new name and click "Rename"
  
  All the occurrences of the variable must be renamed

REPOSITORY
  R52 KDevelop: PHP Support

REVISION DETAIL
  https://phabricator.kde.org/D25587

AFFECTED FILES
  duchain/builders/contextbuilder.cpp
  duchain/tests/duchain.cpp
  duchain/tests/duchain_multiplefiles.cpp
  duchain/tests/uses.cpp

To: hmitonneau
Cc: kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.