1

Can some tell me what I have to do to straighten out Eclipse CDT's Type Hierarchy display?

I have C++ classes that I've refactored, changed their names, and moved around in the same file and/or into different files. When I click on "Open Type Hierarchy", Eclipse open up the Type Hierarchy window but it shows me the old names and duplicates of existing classes. Clicking on the old names vectors me to a random location in what was once (I'm assuming) the original source file. I have to click on the duplicates one after the other until I find one that vectors me to the correct location.

Is there a way to rebuild whatever needs to be rebuilt to get the Type Hierarchy window to show accurate classes and navigate properly?

Something I should point out is that all my project use their own makefile. i.e. Eclipse does not manage them. Does that make a difference?

Thanks

DaveR
  • 1,295
  • 1
  • 13
  • 35
  • `Project -> C/C++ Index -> Rebuild` should do the trick. Also consider checking the settings in `Window -> Preferences -> C/C++ -> Indexer -> Indexing strategy` to automatically update the index. – HighCommander4 Feb 08 '18 at 17:14
  • Thanks but been there, tried that, didn't work. It was the first thing I tried but no luck :( – DaveR Feb 08 '18 at 17:31
  • Perhaps deleting the project's index file `/.metadata/.plugins/org.eclipse.cdt.core/..pdom` and then restarting/reindexing might help? – HighCommander4 Feb 08 '18 at 17:37
  • Well, that kinda-sorta worked. It cleaned up the old class names (i.e. they are no gone) but I still have some classes showing up twice. It's a big improvement over what I had before! – DaveR Feb 08 '18 at 19:00
  • In my experience, classes showing up twice is sometimes caused by the build system (assuming you have your own, rather than an eclipse Managed Build project) copying header files to another location in the project directory, and Eclipse indexing both copies. If that's the case, resource filters to exclude the second location can solve the problem. – HighCommander4 Feb 08 '18 at 21:34
  • My makefiles don't copy any header files. – DaveR Mar 13 '18 at 23:09

0 Answers0