Example code: void NewClass::someFuction() { int var = 0; var++; } When I modifies declaration of a variable then shows me additional menu: "1 - Rename "var" to "var1" 0 - Hide". When I use 1 (Alt+1) then next occurrence of variable (var++) doesn't renamed.
Below a practical example. We have code like below: QStringList infoList; infoList << "aa" << "bb" << "cc"; for (int row = 0; row < infoList.count(); ++row) { // do something QString str = infoList.at(row); } Try rename "row" in "for" expression using "renamer assistant". Unfortunately, we can't do it. Below result after rename operation: for (int id = 0; row < infoList.count(); ++row) { // do something QString str = infoList.at(id); }
I can confirm.
Git commit e434ac2f621bf918c45e7df15888ef85aa246936 by Milian Wolff. Committed on 24/05/2013 at 13:07. Pushed by mwolff into branch 'master'. Transform ranges properly using the revision they actually belong to. This is imo basically a hack to circumvent the bad RangeInRevision API without rewriting everything... The RangeInRevision is actually just blindly assuming that it belongs to the revision the file was parsed in the last time. But if the file is reparsed in between (due to changes) the ranges might be wrong. Due to that we must store the ranges and their actual revision... Stupid! Imo an API called RangeInRevision should _know_ which revision it belongs to... Meh! M +32 -15 languages/cpp/codegen/renameaction.cpp M +25 -5 languages/cpp/codegen/renameaction.h M +13 -12 languages/cpp/codegen/renameassistant.cpp M +2 -1 languages/cpp/codegen/renameassistant.h M +8 -3 languages/cpp/codegen/signatureassistant.cpp http://commits.kde.org/kdevelop/e434ac2f621bf918c45e7df15888ef85aa246936