improve call hierarchy
add commands for call hierarchy:
- reopen hierarchy window.
- Add a caller to current node manually.
- PageUp and PageDown.
- Close callers.
- Remove callers.
PR Prelude
Thank you for working on YCM! :)
Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your PR:
- [x] I have read and understood YCM's CONTRIBUTING document.
- [x] I have read and understood YCM's CODE_OF_CONDUCT document.
- [x] I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't.
- [x] I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.
Why this change is necessary and useful
When you need to navigate back and forth among many functions in the call stack, the ability to reopen the call stack window will be very useful. When the call stack is large and complex, you can simplify things by closing and deleting call nodes.
The benefits of adding a call stack are as follows: When YCMCallHierarchy cannot find the actual caller, '<Plug>(YCMAddCallHierarchy)' will be very useful. For example, when tracking the caller of callback functions in C language, YCMCallHierarchy may not be able to find the true caller; instead, it may trace related registration functions or initialization functions. The relevant code passes the callback function to a function pointer, resulting in a call stack that may not be what you are looking for. In this case, you can manually find the function that calls the function pointer, which is the true caller, and use '<Plug>(YCMAddCallHierarchy)' to manually add the true caller to the call stack, thus extending the call stack.
Wow, I am pleasantly surprised by a non-maintainer working on this!
I am not able to review this today, but some initial thoughts:
Reopening could indeed be very useful. Adding and removing, I do need to look more carefully into.
I will do a proper review tomorrow.
Wow, I am pleasantly surprised by a non-maintainer working on this!
I am not able to review this today, but some initial thoughts:
Reopening could indeed be very useful. Adding and removing, I do need to look more carefully into.
I will do a proper review tomorrow.
Hello, I just fixed several bugs related to reopen and remove. I am looking forward to your review.
@wenbodong2015 Sorry for the delay. I had some personal stuff that I had to take care off. I swear I have not forgotten about this! I'll have time to review this pull request when I come home from work. In the mean time, I'll let CI run tests with your changes.
Hi, thanks for sending a PR!
I haven't reviewed this in a lot of detail, but one thing I would say is that I think it is trying to do too much in one PR.
Could we split the various functionalities out into individual pieces so that we can take each on their merit?
On the face of it it's not obvious why you would want to do some of the things that this adds and how much of a burden the current limitations really are. it would be easier to discuss and understand that in 5 smaller PRs than one multi-faceted PR