Fix rename of a variable

Authored by hmitonneau on Dec 28 2019, 9:16 AM.

Description

Fix rename of a variable

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)

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

BUG: 317879
FIXED-IN: 5.5.0

Reviewers: pprkut

Reviewed By: pprkut

Subscribers: pprkut, kdevelop-devel

Tags: KDevelop

Differential Revision: https://phabricator.kde.org/D25587

Details

Committed
pprkutDec 28 2019, 9:24 AM
Reviewer
pprkut
Differential Revision
D25587: [KDevelop/PHP] fix rename of a variable
Parents
R52:53f30e5b9b2b: Add support for "array of type"
Branches
Unknown
Tags
Unknown