Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364218

Summary: Rename on a class should usually also change filename and fix the include guard
Product: [Tools] CDT Reporter: Tomasz Wesolowski <kosashi>
Component: cdt-refactoringAssignee: Project Inbox <cdt-refactoring-inbox>
Status: CLOSED WORKSFORME QA Contact: Sergey Prigogin <eclipse.sprigogin>
Severity: enhancement    
Priority: P3 CC: cdtdoug, Jesse.Weinstein, marco.stornelli, mengjiao.lu, yevshif
Version: 8.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

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