-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request]: Display current context, e.g. add GetType or some sort of GetBreadcrumbs support for LSP completer #4096
Comments
GetParent was supported in the legacy libclang completer but cannot be provided by clangd. It’s essentially deprecated at this point. |
Roger, thank you. I ask bc I'm interested in adding a way to get "breadcrumbs" of the current function/method I'm in a la visual studio and others (see https://i.stack.imgur.com/wu4kP.png) using the LSP and GetParent seemed like a good entry point. @puremourning do you have any thoughts on how one could go about adding this feature? My vimscript fu is weak, but I was thinking of using YCM commands to update the status line, or if needed a separate plugin that talks LSP and maybe plugins into airline/lightline. I've seen some ppl implement this (eg vista + coc) but not with YCM integrated yet sadly |
I think it is possible to do using the document symbols data when supporting the "hierarchical" data response. the server provides a whole hierarchy and you can sort of walk that using the current cursor position. ycmd doesn't currently support that. Using it to implement a GetParent subcommand might be simple, but I suspect that it would be better to implement some sort of "GetBreadcrumbs" request. In a simple form it could just return the symbol names, but it could also return say a list of positions you can jump to. That would be a fair amount more work of course, though it might be worth it. I'll re-open this as a feat req. |
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
Frequently Asked Questions section.
about to report and couldn't find an answer to my problem. (Example Google
search.)
vim --version
.:YcmDebugInfo
.the
:YcmToggleLogs
command.version) I am using.
my issue, using
vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what Iexpected to happen and what actually happened.
of
install.py
(orcmake
/make
/ninja
) including its invocationthat any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
actually perform all of these steps.
Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Issue Details
When running :YcmCompleter GetParent within a cpp file, I am seeing "ValueError: Supported commands are:..." which doesn't include GetParent. According to the readme, GetParent should be supported for cpp files though. GoToDeclaration and the rest are working
vim -Nu /path/to/YCM/vimrc_ycm_minimal main.cpp
(I am using bazel + hedronvision compile commands generator to get a compile_commands.json, but the error will be present without any compile flags)Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Output of
YcmDiags
Output of
git rev-parse HEAD
in YouCompleteMe installation directoryContents of YCM, ycmd and completion engine logfiles
from ycmd stderr log:
OS version, distribution, etc.
Ubuntu server 18.04
Output of build/install commands
Thank you for taking a look 😃
The text was updated successfully, but these errors were encountered: