Bug 537176 - allow rename of file without any refactoring
Summary: allow rename of file without any refactoring
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 9.5.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 9.6.0   Edit
Assignee: Baha Elkassaby CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-19 06:12 EDT by Jonah Graham CLA
Modified: 2018-08-21 18:55 EDT (History)
1 user (show)

See Also:


Attachments
renames in different languages (65.51 KB, image/png)
2018-07-19 06:12 EDT, Jonah Graham CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonah Graham CLA 2018-07-19 06:12:46 EDT
Created attachment 275049 [details]
renames in different languages

At the moment when you rename a header file in the Project Explorer it always triggers a refactor as part of that rename. For example if you have:

main.c:

#include "hello.h"
#include <stdio.h>

...

and in the same folder you have hello.h. Then if you select hello.h in the Project Explorer, choose Rename (context menu or F2), type a new name (like "hello2.h") the main.c becomes this:

#include <stdio.h>
#include "hello2.h"

...

This happens because various preferences kick in affecting the rename. For example, the reordering that happens above is Preferences -> C/C++ -> Code Style -> Organize Imports -> Allow reordering of includes.

This bug is to allow you to rename files in C projects without anything other than the rename happening.

For example, the JDT has a checkbox when you rename a Java file that says "Update references" and a few other options. 

What I would like is the rename dialog to have a new checkbox "Update references" like JDT/PyDev (see attachment) and a link to the C/C++ -> Code Style preferences pages to help users discover what may happen as a result of the rename.
Comment 1 Eclipse Genie CLA 2018-08-21 04:32:20 EDT
New Gerrit change created: https://git.eclipse.org/r/127738
Comment 2 Jonah Graham CLA 2018-08-21 04:39:15 EDT
After further consideration, a few changes to the spec:

1) Only have one checkbox, "Update references", like the first checkbox in JDT
2) Have the link directly to Organize Includes preference page to emphasize them, they are the most relevant.
3) Have the dialog apply to IFiles and IContainers (projects/folders), not just to files in a project. This is because renaming a folder/project can also cause reference changes to affect source files
Comment 4 Jonah Graham CLA 2018-08-21 14:56:54 EDT
Baha, Can you create an New and Noteworthy for this (With screenshot): https://wiki.eclipse.org/CDT/User/NewIn96
Comment 5 Jonah Graham CLA 2018-08-21 15:00:29 EDT
https://wiki.eclipse.org/CDT/User/NewIn94 has some screenshot examples.
Comment 6 Baha Elkassaby CLA 2018-08-21 18:41:41 EDT
Hi Jonah, I added a refactoring part in N&NW with two screenshots.