Bug 187609

Summary: Add "rename file" refactoring
Product: [Developer tools] kdevplatform Reporter: Thomas McGuire <mcguire>
Component: languageAssignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: wishlist CC: aleixpol, b.gedzior, batyiev, codestruct
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Thomas McGuire 2009-03-19 16:45:25 UTC
Version:            (using Devel)
OS:                Linux

It would be cool if KDevelop had support for renaming files, ideally from right-clicking in the project tree.

Renaming a file should:
- Rename the .cpp and the .h file
- Tell the VCS system about it (in SVN, that would be 'svn mv')
- Update the CMakeLists.txt or whatever other project system is being used
- Update all #include statements
- Update header guards
- Maybe update the filename in the license comment, sometimes it is there.

Ideally, KDevelop would also trigger a optional file rename if a user tries to rename a class and KDevelop detects that the class has the same name as the file.

Currently, renaming a file in C++ is really cumbersome.
Comment 1 Andrey Batyiev 2011-03-17 10:56:55 UTC
Current state of things:

Works (= generic code is working, bugs (if any) should be filled per plugin):
- Tell the VCS system about it (in SVN, that would be 'svn mv')
- Update the CMakeLists.txt or whatever other project system is being used

Left to do (in *my* order of *significance*):
- Update all #include statements
- Update header guards
- Maybe update the filename in the license comment, sometimes it is there.
  (Probably it should search-n-replace in all comments, e.g. in cases of "See file somefile.cpp for examples/comments/other stuff")
- Rename the .cpp and the .h file
Comment 2 Aleix Pol 2011-03-17 14:45:23 UTC
*** Bug 265236 has been marked as a duplicate of this bug. ***
Comment 3 Aleix Pol 2012-11-21 02:08:23 UTC
Now the .cpp and .h files are renamed as well.

Left to happen, update include statements and header guards.
Here I'm unsure that this has to happen...