ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.36k stars 2.8k forks source link

[READY] Implement type/call hierarchy handling #4221

Closed bstaletic closed 1 week ago

bstaletic commented 4 months ago

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:

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.


This change is Reviewable

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 92.54499% with 29 lines in your changes missing coverage. Please review.

Project coverage is 89.78%. Comparing base (4556062) to head (25ec3c9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4221 +/- ## ========================================== + Coverage 89.67% 89.78% +0.11% ========================================== Files 34 37 +3 Lines 4445 4779 +334 ========================================== + Hits 3986 4291 +305 - Misses 459 488 +29 ```
mergify[bot] commented 1 week ago

Thanks for sending a PR!