You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched YCM's issue tracker to find issues similar to the one I'm
about to report and couldn't find an answer to my problem. (Example Google
search.)
If filing a bug report, I have included the output of vim --version.
If filing a bug report, I have included the output of :YcmDebugInfo.
If filing a bug report, I have attached the contents of the logfiles using
the :YcmToggleLogs command.
If filing a bug report, I have included which OS (including specific OS
version) I am using.
If filing a bug report, I have included a minimal test case that reproduces
my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I
expected to happen and what actually happened.
If filing a installation failure report, I have included the entire output
of install.py (or cmake/make/ninja) including its invocation
I understand this is an open-source project staffed by volunteers and
that 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.
I understand my issue may be closed if it becomes obvious I didn't
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
Provide a clear description of the problem, including the following key
questions:
What did you do?
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
Include steps to reproduce here.
Open a cpp file with eg 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)
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_qx58cxjy.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.8.0
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found and loaded
-- Extra configuration path: /data2/me/gits/project/.ycm_extra_conf.py
-- C-family completer debug information:
-- Clangd running
-- Clangd process ID: 5129
-- Clangd executable: ['~/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir=~/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/15.0.1', '-limit-results=500']
-- Clangd logfiles:
-- /tmp/clangd_stderre7mxo6hr.log
-- Clangd Server State: Initialized
-- Clangd Project Directory: /data2/me/gits/project
-- Clangd Settings: {}
-- Clangd Compilation Command: False
-- Server running at: http://127.0.0.1:57249
-- Server process ID: 5115
-- Server logfiles:
-- /tmp/ycmd_57249_stdout_2c5trxz_.log
-- /tmp/ycmd_57249_stderr_9t1ciev2.log
-- Semantic highlighting supported: True
-- Virtual text supported: True
-- Popup windows supported: True
Output of YcmDiags
No warnings or errors detected.
Output of git rev-parse HEAD in YouCompleteMe installation directory
508b8c64bfbc2ad3106ae67b7828936035b3095e
Contents of YCM, ycmd and completion engine logfiles
Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a gist containing all of the log files listed by :YcmToggleLogs.
logs contain a lot of sensitive info, pls advise if needed
from ycmd stderr log:
2022-12-12 16:28:21,693 - INFO - Found executeCommandProvider support for command ExecuteCommand in cfamily
2022-12-12 16:28:21,693 - INFO - Found codeActionProvider support for command FixIt in cfamily
2022-12-12 16:28:21,693 - INFO - Found definitionProvider support for command GoToDefinition in cfamily
2022-12-12 16:28:21,693 - INFO - Found declarationProvider support for command GoToDeclaration in cfamily
2022-12-12 16:28:21,693 - INFO - Found ('definitionProvider', 'declarationProvider') support for command GoTo in cfamily
2022-12-12 16:28:21,693 - INFO - Found typeDefinitionProvider support for command GoToType in cfamily
2022-12-12 16:28:21,693 - INFO - Found implementationProvider support for command GoToImplementation in cfamily
2022-12-12 16:28:21,694 - INFO - Found referencesProvider support for command GoToReferences in cfamily
2022-12-12 16:28:21,694 - INFO - Found renameProvider support for command RefactorRename in cfamily
2022-12-12 16:28:21,694 - INFO - Found documentFormattingProvider support for command Format in cfamily
2022-12-12 16:28:21,694 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in cfamily
2022-12-12 16:28:21,694 - INFO - Found documentSymbolProvider support for command GoToDocumentOutline in cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting StopServer for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting RestartServer for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GetDoc for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GetType for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GoToCallees for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GoToCallers for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GetTypeImprecise for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GoToImprecise for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GoToInclude for cfamily
2022-12-12 16:28:21,694 - INFO - Always supporting GetDocImprecise for cfamily
2022-12-12 16:28:21,694 - INFO - Found executeCommandProvider support for command ExecuteCommand in cfamily
2022-12-12 16:28:21,694 - INFO - Found codeActionProvider support for command FixIt in cfamily
2022-12-12 16:28:21,694 - INFO - Found definitionProvider support for command GoToDefinition in cfamily
2022-12-12 16:28:21,694 - INFO - Found declarationProvider support for command GoToDeclaration in cfamily
2022-12-12 16:28:21,695 - INFO - Found ('definitionProvider', 'declarationProvider') support for command GoTo in cfamily
2022-12-12 16:28:21,695 - INFO - Found typeDefinitionProvider support for command GoToType in cfamily
2022-12-12 16:28:21,695 - INFO - Found implementationProvider support for command GoToImplementation in cfamily
2022-12-12 16:28:21,695 - INFO - Found referencesProvider support for command GoToReferences in cfamily
2022-12-12 16:28:21,695 - INFO - Found renameProvider support for command RefactorRename in cfamily
2022-12-12 16:28:21,695 - INFO - Found documentFormattingProvider support for command Format in cfamily
2022-12-12 16:28:21,695 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in cfamily
2022-12-12 16:28:21,695 - INFO - Found documentSymbolProvider support for command GoToDocumentOutline in cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting StopServer for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting RestartServer for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GetDoc for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GetType for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GoToCallees for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GoToCallers for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GetTypeImprecise for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GoToImprecise for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GoToInclude for cfamily
2022-12-12 16:28:21,695 - INFO - Always supporting GetDocImprecise for cfamily
Traceback (most recent call last):
File "~/vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/completer.py", line 477, in OnUserCommand
command = command_map[ arguments[ 0 ] ]
KeyError: 'GetParent'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "~/vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 876, in _handle
return route.call(**args)
File "~/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1756, in wrapper
rv = callback(*a, **ka)
File "~/vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/watchdog_plugin.py", line 97, in wrapper
return callback( *args, **kwargs )
File "~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/hmac_plugin.py", line 62, in wrapper
body = callback( *args, **kwargs )
File "~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/handlers.py", line 93, in RunCompleterCommand
return _JsonResponse( completer.OnUserCommand(
File "~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/completer.py", line 479, in OnUserCommand
raise ValueError( self.UserCommandsHelpMessage() )
ValueError: Supported commands are:
ExecuteCommand
FixIt
Format
GetDoc
GetDocImprecise
GetType
GetTypeImprecise
GoTo
GoToCallees
GoToCallers
GoToDeclaration
GoToDefinition
GoToDocumentOutline
GoToImplementation
GoToImprecise
GoToInclude
GoToReferences
GoToSymbol
GoToType
RefactorRename
RestartServer
See the docs for information on what they do.
OS version, distribution, etc.
Include system information here.
Ubuntu server 18.04
Output of build/install commands
Include link to a gist containing the invocation and entire output of install.py if reporting an installation issue.
Thank you for taking a look 😃
The text was updated successfully, but these errors were encountered:
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.
puremourning
changed the title
GetParent not supported in cpp file
[Feature request]: Display current context, e.g. add GetType or some sort of GetBreadcrumbs support for LSP completes
Dec 13, 2022
puremourning
changed the title
[Feature request]: Display current context, e.g. add GetType or some sort of GetBreadcrumbs support for LSP completes
[Feature request]: Display current context, e.g. add GetType or some sort of GetBreadcrumbs support for LSP completer
Dec 13, 2022
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: