<table><tr><td style="">hmitonneau created this revision.<br />hmitonneau added a project: KDevelop.<br />Herald added a subscriber: kdevelop-devel.<br />hmitonneau requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D25587">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Renaming a variable doesn't work.<br />
This is because in <tt style="background: #ebebeb; font-size: 13px;">KDevelop::DocumentChangeSetPrivate::generateNewText</tt>, <tt style="background: #ebebeb; font-size: 13px;">rangeText(change.m_range, textLines)</tt> return the value <tt style="background: #ebebeb; font-size: 13px;">$oldname</tt> and <tt style="background: #ebebeb; font-size: 13px;">change.m_oldText</tt> has the value <tt style="background: #ebebeb; font-size: 13px;">oldname</tt></p>

<p>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)</p>

<p><a href="https://phabricator.kde.org/F7788333" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F7788333: Screenshot_20191128_110431.png</a></p>

<p><a href="https://phabricator.kde.org/F7788334" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F7788334: Screenshot_20191128_110516.png</a></p>

<p><a href="https://phabricator.kde.org/F7788335" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F7788335: Screenshot_20191128_110534.png</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Right-click on a variable<br />
Select "Rename xxx..."<br />
Choose a new name and click "Rename"</p>

<p>All the occurrences of the variable must be renamed</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R52 KDevelop: PHP Support</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25587">https://phabricator.kde.org/D25587</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>duchain/builders/contextbuilder.cpp<br />
duchain/tests/duchain.cpp<br />
duchain/tests/duchain_multiplefiles.cpp<br />
duchain/tests/uses.cpp</div></div></div><br /><div><strong>To: </strong>hmitonneau<br /><strong>Cc: </strong>kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>