Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364218 - Rename on a class should usually also change filename and fix the include guard
Summary: Rename on a class should usually also change filename and fix the include guard
Status: CLOSED WORKSFORME
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Sergey Prigogin CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-19 09:00 EST by Tomasz Wesolowski CLA
Modified: 2020-01-19 05:05 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Wesolowski CLA 2011-11-19 09:00:38 EST
Build Identifier: 

- Create a class A using Class Wizard and default settings
- rename this class to B

The class is renamed properly, but the filename and (even worse) the include guard remain the same.

Proposed:
- if the filename of the file with definition is the same as the old class name, change it to the new class name
- additionally, if there is an implementation file with the same name, rename it too
- if any of the above is done, also fix includes in other files
- if any of the above is done and the header contains an include guard which has  the class name as substring, replace it by new class name

Reproducible: Always
Comment 1 Mengjiao Lu CLA 2012-11-14 20:15:23 EST
I also have the same problem. Each time I renamed a class, I have to rename the file and the include line manually. 

I hope that there could be an option that we can choose to refract those simultaneously.
Comment 2 Marco Stornelli CLA 2020-01-19 05:05:26 EST
Already implemented in CDT 9.10