cancel
Showing results for 
Search instead for 
Did you mean: 

Refactor ignores header files. Why?

AT38
Associate III

When I refactor a global variable or function from its definition in a source file, all instances are replaced except the declarations in the header files.

Attempting to refactor from the header file achieves nothing. The new name is immediately replaced with the original name.

This is not ideal.

Does anyone know why this might be happening? A bug, or a project configuration error?

Cheers.

4 REPLIES 4
RDemb.1
Associate

Where this header files are located, in source folder or normal? indexer see this files?

Radosław
Senior

Where this header files are located, in source folder or normal? indexer see this files?

Sources are in `/module_name/src/`, headers are in `/module_name/inc/`

If I Ctrl-Click on a definition, it takes me to the corresponding declaration in the header file. Likewise, Ctrl-Tab will take me to the header file for that source file.

Checking Project>Properties>C/C++ General>Paths and Symbols>Includes I see all the project's include directories.

Ok, I've just gone out on a limb and added an `inc/` folder to the Source Location tab in the same properties page, and that seems to have fixed it. Refactoring in the header file works, and refactoring the source file updates the header file.

That's a little counter intuitive to me, though, as I now have a folder in my project marked as 'C', but it contains '.h' files. Am I missing something here?

Cheers

Radosław
Senior

Exacly about this i was thinking, eclipse any source code operation do only on files in this type folders, this can be usefull.