In the NetBeans IDE, changing a variable name in the parameters of a function also changes all occurrences of that name in the function. How can I get that behavior with Eclipse PDT? There is a Refactor → Rename item in the context menu, but it let me refactor only the file name.
This issue has been open since 2006 and you can vote for it in the PDT bug tracker #149818.
Solution. Select the element in the JDT editor and then select Refactor→ Rename, or right-click the element and select Refactor→ Rename. Enter the new name you want to give the item, and you're set.
In the Inspect and Transform dialog box, select the Configuration option and choose the Migrate to JDK 7 set of inspections from the drop-down list. Click Inspect. Changes that convert the code to JDK 7 syntax display in the preview panel. Click Do Refactoring to apply the changes if required.
Select the variable you with to change, right click, and select Refactor->Rename. This will highlight all instances of the variable. Changing the variable name is automatically propagated to all of the instances.
Code refactoring presence is the difference between PDT and Zend Studio as it is shown at the comparison page. So no, there is no way to do code refactoring in PDT.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With