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
This is the client side pull request related to ycm-core/ycmd#1733
Again, tests and documentations are missing. Documentation is the easy part, but tests would be dreadful...
popup look
I have not paid much attention to the look of the popup.
The look is slightly off - for deep hierarchies the location of references in the file (foo.cpp:8 for example) becomes misaligned.
The context is is not right aligned either.
Basically, it's functional but ugly. If someone would be up for it, please send patches my way.
How to use this thing?
The only publicly available function here is youcompleteme#hierarchy#StartRequest( kind ). It takes 'call' or 'type' as the argyment. From there, YCM will fire a "prepare hierarchy" request and then open a popup with the results.
While the popup is open, the following keys are used:
<Tab> to resolve a hierarchy item in the "subtypes" / "incoming" direction.
<S-Tab> to resolve a hierarchy item in the "supertypes"/"outgoing" direction.
<Up>/<Down> to select items in the popup.
<CR> to jump to the selected item and close the popup.
<Esc> to close the popup without jumping.
Maybe we want more key bindings here? <C-n>/<C-p> and j/k come to mind...
Oh yes, there's also <plug>(YCMCallHierarchy) and <plug>(YCMTypeHierarchy) that just call youcompletem#hierarchy#StartRequest(). Users should be using these, instead of directly calling the function.
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:Why this change is necessary and useful
This is the client side pull request related to ycm-core/ycmd#1733
Again, tests and documentations are missing. Documentation is the easy part, but tests would be dreadful...
popup look
I have not paid much attention to the look of the popup. The look is slightly off - for deep hierarchies the location of references in the file (
foo.cpp:8
for example) becomes misaligned. The context is is not right aligned either.Basically, it's functional but ugly. If someone would be up for it, please send patches my way.
How to use this thing?
The only publicly available function here is
youcompleteme#hierarchy#StartRequest( kind )
. It takes'call'
or'type'
as the argyment. From there, YCM will fire a "prepare hierarchy" request and then open a popup with the results.While the popup is open, the following keys are used:
<Tab>
to resolve a hierarchy item in the "subtypes" / "incoming" direction.<S-Tab>
to resolve a hierarchy item in the "supertypes"/"outgoing" direction.<Up>
/<Down>
to select items in the popup.<CR>
to jump to the selected item and close the popup.<Esc>
to close the popup without jumping.Maybe we want more key bindings here?
<C-n>
/<C-p>
andj
/k
come to mind...Oh yes, there's also
<plug>(YCMCallHierarchy)
and<plug>(YCMTypeHierarchy)
that just callyoucompletem#hierarchy#StartRequest()
. Users should be using these, instead of directly calling the function.This change is![Reviewable](https://reviewable.io/review_button.svg)