Is there a way in Eclipse CDT to do the following automatic refactorings?
If there is no such feature in CDT, is there another tool for Linux that would easily let me do this?
Thank you very much.
In Project Explorer view, right-click file to be renamed and select Refactor | Rename -or- select it and go to Refactor | Rename from the Menu Bar. A Rename File dialog will appear. Enter the file's new name.
To rename the project, simply right-click the project and select "Refactor/Rename...". Fill in the new name and click OK.
In the text editor, double-click on the class name to select it. Now do Alt-Shift-R (or right-click on selected text and select Refactor>Rename in the context menu) and rename the class, then click Enter/Return. The STS Refactor/Renaming wizard should take over and rename both the class and the file from there.
I have not been able to find either of these features in CDT 8.0. I would suggest putting in a feature request at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT.
I just did a bunch of your item 2. (header file renaming, #include renaming, include-guard renaming). This took about 3 minutes using eclipse's Search and Replace. Not bad considering I've never done it before. Presumably this might have taken under a minute if "header file rename" was implemented in CDT. Not a big savings, in my book, esp when you consider how infrequently this is done. But then, I had to rename ~20 files. The semi-manual approach I used wouldn't scale as well as CDT refactor impl probably would.
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