drzoom
Ketchup Master
Switzerland
57 Posts |
Posted - Dec 21 2006 : 07:23:05 AM
|
Preface: It's very common in c++ that the files are named after the class which is defined in the files. If I rename a class, I used to rename the files in which this class is defined. This is a very time consuming task, because there are #include statements to change.
Topic: There should be a refactoring option to rename the files of a unit. Not only the files of the unit are renamed, also the correct(!) #include statements which are pointing to this file.
Your objections: It's hard to find the correct #include statements which are affected by the rename action.
My opinion: While parsing the files, the relation between the files with #include statements should also be part of the parsed model.
Pitfalls: If the code is using namespaces, the developer are used to organise the files in directory structures which representing the namespaces. Two classes, which are defined in two different namespaces can have the same name. The same name of two classes results in files with the same name. Many tools have problems with this situation, because the developers of these tools only working with one flat list of files (c programmers...).
Like the parser has to understand the correct solving of names in a namespace structure, it has to understand the correct solving of the search in the include search paths. Like the preprocessor does.
Bonus Features: If the user is changing the name of a class, he should have the option to rename the files of the compiling unit too in one step.
|
best regards Tobias
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Dec 21 2006 : 07:34:23 AM
|
This has been requested before, but it is unlikely we will try and do this any time soon. There are already edge cases without even thinking about renaming all of the #include statements.
case=1463 |
zen is the art of being at one with the two'ness |
|
|