Navigate through usages in Hierarchy View and opening the Hierarchy View for fields and constructors
Hi there
I'm having some troubles when using the hierarchy view (ctrl + alt + H) in CLion 2020.2.3 for a C++ project. I could not figure out the following two things, even after searching the web:
- Navigating between different usages: In the hierarchy view for a method
X, there is sometimes a methodYthat callsXfrom multiple places within the same method. It shows this by having "(3 usages)", for example, next to the methodY. When clicking on methodY, I get to the first usage ofX. How can I navigate to the next usage ofXwithin methodY(the remaining 2 usages)? I intuitively double clicked on it but that does not work. - Opening the hierarchy view does not seem to work on constructors and fields. Why? When following a call chain in the hierarchy view, it stops to load once a constructor is opened. This is a little bit annoying. This worked perfectly fine in Eclipse IDE for C++, for example.
Coming from Eclipse (using ctrl + alt + G/H), this is a pain point as I used the hierarchy view a lot there. Going over the usages window shows me the direct usages but not the hierarchy. Can anybody help on these two points or provide some suitable alternatives?
Thanks a lot!
Best regards,
Christian
请先登录再写评论。
I have been using CLion for the better parts of a year now, coming from Eclipse too. While CLion is much better than Eclipse overall, there are a few places where Eclipse is much better. and this is one of them.
I partly work with legacy code that has several thousand lines long methods, and it is really a bother seeing that the function in question is called 4 times in a method, but me then having to go to search within that file instead of stepping through the places it has been called. CLion has found those places (counting them), but will just not step to them.
I am aware that I can step through the callers with ctrl-alt-arrow up/down, but whenever a function has two or more hits, it steps to the top of the function instead of to each hit. Changing this should be really simple, and improve the call hierarchy functionality a lot.
Thanks for your answer! Exactly the same problem that I am facing, having legacy code with huge methods that often have multiple uses. I was just confused that CLion is somehow counting the usages but does not provide a way to jump to them. I was sure that I was missing something. But it seems like this is indeed a missing feature. Would be great to see this being improved!
Do you also experience that it hangs once you open the call hierarchy for a constructor?