After downloading YouCompleteMe from ubuntu repositories and installing it I have used this script as extra config. I suppose this config may help me with in-headers functions auto-completion.
:YcmDebugInfo shows
Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_mdq0n_kl.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.9.5
-- Server has Clang support compiled in: True
-- Clang version: Ubuntu clang version 11.0.1-2ubuntu4
-- Extra configuration file found and loaded
-- Extra configuration path: /project/.ycm_extra_conf.py
-- C-family completer debug information:
-- Clangd running
-- Clangd process ID: 3823704
-- Clangd executable: ['/usr/bin/clangd', '-header-insertion-decorators=0', '-limit-results=500']
-- Clangd logfiles:
-- /tmp/clangd_stderrg57o740a.log
-- Clangd Server State: Initialized
-- Clangd Project Directory: /project/sources/examples/hello
-- Clangd Settings: {}
-- Clangd Compilation Command: ['clang-tool', '-Wall', '-Wextra', '-Werror', '-fexceptions', '-std=c89', '-xc', '-I./sources/drivers', '-I
./os/core', '/project/examples/hello/hello.c']
-- Server running at: http://127.0.0.1:37731
-- Server process ID: 3823664
-- Server logfiles:
-- /tmp/ycmd_37731_stdout_wl6kpb5o.log
-- /tmp/ycmd_37731_stderr_qxt4yeoa.log
/tmp/ycmd_37731_stderr_qxt4yeoa.log contains some errors:
2021-07-27 15:10:48,825 - INFO - Completion config: 50, detailing -1 candiates
2021-07-27 15:10:48,825 - INFO - Completion config: 50, detailing -1 candiates
2021-07-27 15:10:48,825 - INFO - Completion config: 50, detailing -1 candiates
2021-07-27 15:10:48,825 - INFO - Completion config: 50, detailing -1 candiates
2021-07-27 15:10:48,853 - INFO - Received ready request
2021-07-27 15:10:48,855 - INFO - Received signature help available request
2021-07-27 15:10:48,856 - INFO - Received event notification
2021-07-27 15:10:48,858 - INFO - Received event notification
2021-07-27 15:10:48,858 - INFO - Adding buffer identifiers for file: /project/sources/examples/hello/hello.c
2021-07-27 15:10:48,894 - INFO - Using Clangd from /usr/bin/clangd
2021-07-27 15:10:48,894 - INFO - Computed Clangd command: ['/usr/bin/clangd', '-header-insertion-decorators=0', '-limit-results=500']
2021-07-27 15:10:48,894 - INFO - Completion config: 50, detailing -1 candiates
2021-07-27 15:10:48,894 - INFO - Returning cached Clangd command: ['/usr/bin/clangd', '-header-insertion-decorators=0', '-limit-results=500']
2021-07-27 15:10:48,895 - INFO - Starting Clangd: ['/usr/bin/clangd', '-header-insertion-decorators=0', '-limit-results=500']
2021-07-27 15:10:48,899 - INFO - Clangd started with PID 3823704
2021-07-27 15:10:48,928 - INFO - None: Language server does not require resolve request
2021-07-27 15:10:48,929 - INFO - None: Language server requires sync type of Incremental
2021-07-27 15:10:48,929 - INFO - cfamily: Using characters for signature triggers: (,,
2021-07-27 15:10:48,957 - INFO - Received filetype completion available request
2021-07-27 15:10:51,764 - INFO - Received debug info request
2021-07-27 15:10:54,096 - INFO - Received completion request
2021-07-27 15:10:54,101 - INFO - Received signature help available request
2021-07-27 15:10:54,214 - INFO - Received event notification
2021-07-27 15:10:54,219 - INFO - Received completion request
2021-07-27 15:10:54,226 - INFO - Received signature help request
2021-07-27 15:10:55,229 - INFO - Received event notification
2021-07-27 15:10:55,230 - INFO - Adding buffer identifiers for file: /project/sources/examples/hello/hello.c
2021-07-27 15:10:55,234 - INFO - Received event notification
2021-07-27 15:10:55,235 - INFO - Adding ONE buffer identifier for file: /project/sources/examples/hello/hello.c
2021-07-27 15:10:56,590 - INFO - Received debug info request
2021-07-27 15:11:09,495 - INFO - Received completion request
2021-07-27 15:11:09,500 - INFO - Received signature help request
2021-07-27 15:11:10,027 - INFO - Received completion request
2021-07-27 15:11:10,030 - INFO - Received signature help request
2021-07-27 15:11:10,813 - INFO - Received event notification
2021-07-27 15:11:10,814 - INFO - Adding buffer identifiers for file: /project/sources/examples/hello/hello.c
2021-07-27 15:11:10,818 - INFO - Received event notification
2021-07-27 15:11:10,818 - INFO - Adding ONE buffer identifier for file: /project/sources/examples/hello/hello.c
2021-07-27 15:11:11,176 - INFO - Received event notification
2021-07-27 15:11:13,795 - INFO - Received event notification
2021-07-27 15:11:15,105 - INFO - Received completion request
2021-07-27 15:11:15,110 - INFO - Received signature help request
2021-07-27 15:11:15,534 - INFO - Received completion request
2021-07-27 15:11:15,536 - INFO - Received signature help request
2021-07-27 15:11:15,745 - INFO - Received completion request
2021-07-27 15:11:15,751 - INFO - Received signature help request
2021-07-27 15:11:15,937 - INFO - Received completion request
2021-07-27 15:11:15,941 - INFO - Received signature help request
2021-07-27 15:11:16,670 - INFO - Received completion request
2021-07-27 15:11:16,671 - INFO - Received signature help request
2021-07-27 15:11:17,385 - INFO - Received event notification
2021-07-27 15:11:17,386 - INFO - Received event notification
2021-07-27 15:11:17,386 - INFO - Adding buffer identifiers for file: /project/sources/examples/hello/hello.c
2021-07-27 15:11:20,134 - INFO - Received completion request
2021-07-27 15:11:20,135 - INFO - Received signature help request
2021-07-27 15:11:20,243 - INFO - Received completion request
2021-07-27 15:11:20,249 - INFO - Received signature help request
2021-07-27 15:11:20,547 - INFO - Received completion request
2021-07-27 15:11:20,552 - INFO - Received signature help request
2021-07-27 15:11:21,246 - INFO - Received event notification
2021-07-27 15:11:21,247 - INFO - Adding buffer identifiers for file: /project/sources/examples/hello/hello.c
2021-07-27 15:11:21,250 - INFO - Received event notification
2021-07-27 15:11:21,251 - INFO - Adding ONE buffer identifier for file: /project/sources/examples/hello/hello.c
2021-07-27 15:11:26,612 - INFO - Received defined subcommands request
2021-07-27 15:11:26,612 - INFO - Found executeCommandProvider support for command ExecuteCommand in cfamily
2021-07-27 15:11:26,613 - INFO - Found codeActionProvider support for command FixIt in cfamily
2021-07-27 15:11:26,613 - INFO - Found definitionProvider support for command GoToDefinition in cfamily
2021-07-27 15:11:26,613 - INFO - Found declarationProvider support for command GoToDeclaration in cfamily
2021-07-27 15:11:26,613 - INFO - Found ('definitionProvider', 'declarationProvider') support for command GoTo in cfamily
2021-07-27 15:11:26,613 - INFO - No support for GoToType command in server for cfamily
2021-07-27 15:11:26,613 - INFO - Found implementationProvider support for command GoToImplementation in cfamily
2021-07-27 15:11:26,613 - INFO - Found referencesProvider support for command GoToReferences in cfamily
2021-07-27 15:11:26,614 - INFO - Found renameProvider support for command RefactorRename in cfamily
2021-07-27 15:11:26,614 - INFO - Found documentFormattingProvider support for command Format in cfamily
2021-07-27 15:11:26,614 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting StopServer for cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting RestartServer for cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting GetDoc for cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting GetType for cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting GetTypeImprecise for cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting GoToImprecise for cfamily
2021-07-27 15:11:26,614 - INFO - Always supporting GoToInclude for cfamily
2021-07-27 15:11:26,615 - INFO - Always supporting GetDocImprecise for cfamily
2021-07-27 15:11:26,622 - INFO - Received command request
2021-07-27 15:11:26,623 - INFO - Found executeCommandProvider support for command ExecuteCommand in cfamily
2021-07-27 15:11:26,623 - INFO - Found codeActionProvider support for command FixIt in cfamily
2021-07-27 15:11:26,623 - INFO - Found definitionProvider support for command GoToDefinition in cfamily
2021-07-27 15:11:26,623 - INFO - Found declarationProvider support for command GoToDeclaration in cfamily
2021-07-27 15:11:26,623 - INFO - Found ('definitionProvider', 'declarationProvider') support for command GoTo in cfamily
2021-07-27 15:11:26,623 - INFO - No support for GoToType command in server for cfamily
2021-07-27 15:11:26,623 - INFO - Found implementationProvider support for command GoToImplementation in cfamily
2021-07-27 15:11:26,624 - INFO - Found referencesProvider support for command GoToReferences in cfamily
2021-07-27 15:11:26,624 - INFO - Found renameProvider support for command RefactorRename in cfamily
2021-07-27 15:11:26,624 - INFO - Found documentFormattingProvider support for command Format in cfamily
2021-07-27 15:11:26,624 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in cfamily
2021-07-27 15:11:26,624 - INFO - Always supporting StopServer for cfamily
2021-07-27 15:11:26,624 - INFO - Always supporting RestartServer for cfamily
2021-07-27 15:11:26,624 - INFO - Always supporting GetDoc for cfamily
2021-07-27 15:11:26,624 - INFO - Always supporting GetType for cfamily
2021-07-27 15:11:26,624 - INFO - Always supporting GetTypeImprecise for cfamily
2021-07-27 15:11:26,624 - INFO - Always supporting GoToImprecise for cfamily
2021-07-27 15:11:26,625 - INFO - Always supporting GoToInclude for cfamily
2021-07-27 15:11:26,625 - INFO - Always supporting GetDocImprecise for cfamily
Traceback (most recent call last):
File "/usr/lib/ycmd/ycmd/completers/cpp/clangd_completer.py", line 227, in GetDoc
self.GetHoverResponse( request_data )[ 'value' ] )
File "/usr/lib/ycmd/ycmd/completers/language_server/language_server_completer.py", line 2343, in GetHoverResponse
raise NoHoverInfoException( NO_HOVER_INFORMATION )
ycmd.completers.language_server.language_server_completer.NoHoverInfoException: No hover information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/bottle.py", line 868, in _handle
return route.call(**args)
File "/usr/lib/python3/dist-packages/bottle.py", line 1748, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/ycmd/ycmd/watchdog_plugin.py", line 97, in wrapper
return callback( *args, **kwargs )
File "/usr/lib/ycmd/ycmd/hmac_plugin.py", line 62, in wrapper
body = callback( *args, **kwargs )
File "/usr/lib/ycmd/ycmd/handlers.py", line 94, in RunCompleterCommand
return _JsonResponse( completer.OnUserCommand(
File "/usr/lib/ycmd/ycmd/completers/completer.py", line 472, in OnUserCommand
return command( self, request_data, arguments[ 1: ] )
File "/usr/lib/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1648, in <lambda>
lambda self, request_data, args: self.GetDoc( request_data )
File "/usr/lib/ycmd/ycmd/completers/cpp/clangd_completer.py", line 229, in GetDoc
raise RuntimeError( 'No documentation available.' )
RuntimeError: No documentation available.
2021-07-27 15:11:39,026 - INFO - Received command request
2021-07-27 15:11:39,027 - INFO - Found executeCommandProvider support for command ExecuteCommand in cfamily
2021-07-27 15:11:39,027 - INFO - Found codeActionProvider support for command FixIt in cfamily
2021-07-27 15:11:39,027 - INFO - Found definitionProvider support for command GoToDefinition in cfamily
2021-07-27 15:11:39,027 - INFO - Found declarationProvider support for command GoToDeclaration in cfamily
2021-07-27 15:11:39,027 - INFO - Found ('definitionProvider', 'declarationProvider') support for command GoTo in cfamily
2021-07-27 15:11:39,027 - INFO - No support for GoToType command in server for cfamily
2021-07-27 15:11:39,027 - INFO - Found implementationProvider support for command GoToImplementation in cfamily
2021-07-27 15:11:39,027 - INFO - Found referencesProvider support for command GoToReferences in cfamily
2021-07-27 15:11:39,027 - INFO - Found renameProvider support for command RefactorRename in cfamily
2021-07-27 15:11:39,027 - INFO - Found documentFormattingProvider support for command Format in cfamily
2021-07-27 15:11:39,027 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in cfamily
2021-07-27 15:11:39,027 - INFO - Always supporting StopServer for cfamily
2021-07-27 15:11:39,027 - INFO - Always supporting RestartServer for cfamily
2021-07-27 15:11:39,027 - INFO - Always supporting GetDoc for cfamily
2021-07-27 15:11:39,027 - INFO - Always supporting GetType for cfamily
2021-07-27 15:11:39,028 - INFO - Always supporting GetTypeImprecise for cfamily
2021-07-27 15:11:39,028 - INFO - Always supporting GoToImprecise for cfamily
2021-07-27 15:11:39,028 - INFO - Always supporting GoToInclude for cfamily
2021-07-27 15:11:39,028 - INFO - Always supporting GetDocImprecise for cfamily
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/bottle.py", line 868, in _handle
return route.call(**args)
File "/usr/lib/python3/dist-packages/bottle.py", line 1748, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/ycmd/ycmd/watchdog_plugin.py", line 97, in wrapper
return callback( *args, **kwargs )
File "/usr/lib/ycmd/ycmd/hmac_plugin.py", line 62, in wrapper
body = callback( *args, **kwargs )
File "/usr/lib/ycmd/ycmd/handlers.py", line 94, in RunCompleterCommand
return _JsonResponse( completer.OnUserCommand(
File "/usr/lib/ycmd/ycmd/completers/completer.py", line 463, in OnUserCommand
raise ValueError( self.UserCommandsHelpMessage() )
ValueError: Supported commands are:
ExecuteCommand
FixIt
Format
GetDoc
GetDocImprecise
GetType
GetTypeImprecise
GoTo
GoToDeclaration
GoToDefinition
GoToImplementation
GoToImprecise
GoToInclude
GoToReferences
GoToSymbol
RefactorRename
RestartServer
See the docs for information on what they do.
2021-07-27 15:11:52,516 - INFO - Received debug info request
2021-07-27 15:16:38,416 - INFO - Received command request
2021-07-27 15:16:38,417 - INFO - Found executeCommandProvider support for command ExecuteCommand in cfamily
2021-07-27 15:16:38,417 - INFO - Found codeActionProvider support for command FixIt in cfamily
2021-07-27 15:16:38,417 - INFO - Found definitionProvider support for command GoToDefinition in cfamily
2021-07-27 15:16:38,417 - INFO - Found declarationProvider support for command GoToDeclaration in cfamily
2021-07-27 15:16:38,417 - INFO - Found ('definitionProvider', 'declarationProvider') support for command GoTo in cfamily
2021-07-27 15:16:38,417 - INFO - No support for GoToType command in server for cfamily
2021-07-27 15:16:38,417 - INFO - Found implementationProvider support for command GoToImplementation in cfamily
2021-07-27 15:16:38,418 - INFO - Found referencesProvider support for command GoToReferences in cfamily
2021-07-27 15:16:38,418 - INFO - Found renameProvider support for command RefactorRename in cfamily
2021-07-27 15:16:38,418 - INFO - Found documentFormattingProvider support for command Format in cfamily
2021-07-27 15:16:38,418 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in cfamily
2021-07-27 15:16:38,418 - INFO - Always supporting StopServer for cfamily
2021-07-27 15:16:38,418 - INFO - Always supporting RestartServer for cfamily
2021-07-27 15:16:38,418 - INFO - Always supporting GetDoc for cfamily
2021-07-27 15:16:38,418 - INFO - Always supporting GetType for cfamily
2021-07-27 15:16:38,418 - INFO - Always supporting GetTypeImprecise for cfamily
2021-07-27 15:16:38,418 - INFO - Always supporting GoToImprecise for cfamily
2021-07-27 15:16:38,419 - INFO - Always supporting GoToInclude for cfamily
2021-07-27 15:16:38,419 - INFO - Always supporting GetDocImprecise for cfamily
Traceback (most recent call last):
File "/usr/lib/ycmd/ycmd/completers/cpp/clangd_completer.py", line 227, in GetDoc
self.GetHoverResponse( request_data )[ 'value' ] )
File "/usr/lib/ycmd/ycmd/completers/language_server/language_server_completer.py", line 2343, in GetHoverResponse
raise NoHoverInfoException( NO_HOVER_INFORMATION )
ycmd.completers.language_server.language_server_completer.NoHoverInfoException: No hover information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/bottle.py", line 868, in _handle
return route.call(**args)
File "/usr/lib/python3/dist-packages/bottle.py", line 1748, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/ycmd/ycmd/watchdog_plugin.py", line 97, in wrapper
return callback( *args, **kwargs )
File "/usr/lib/ycmd/ycmd/hmac_plugin.py", line 62, in wrapper
body = callback( *args, **kwargs )
File "/usr/lib/ycmd/ycmd/handlers.py", line 94, in RunCompleterCommand
return _JsonResponse( completer.OnUserCommand(
File "/usr/lib/ycmd/ycmd/completers/completer.py", line 472, in OnUserCommand
return command( self, request_data, arguments[ 1: ] )
File "/usr/lib/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1648, in <lambda>
lambda self, request_data, args: self.GetDoc( request_data )
File "/usr/lib/ycmd/ycmd/completers/cpp/clangd_completer.py", line 229, in GetDoc
raise RuntimeError( 'No documentation available.' )
RuntimeError: No documentation available.
Currently the problem is that plugin doesn't complete functions from headers, only from current file. I spent several hours but still have no idea how to fix this, need help.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
<C-x><C-I>
see:help compl-keyword
if configured to detect and find includes correctly.)