c++ cannot jump to location
xiedeacc opened this issue · 2 comments
xiedeacc commented
ycmd.completers.language_server.language_server_completer.ResponseFailedException: Request failed: -32001: invalid AST
xiedeacc commented
Traceback (most recent call last):
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 876, in _handle
return route.call(**args)
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1756, in wrapper
rv = callback(*a, **ka)
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/watchdog_plugin.py", line 97, in wrapper
return callback( *args, **kwargs )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/hmac_plugin.py", line 62, in wrapper
body = callback( *args, **kwargs )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/handlers.py", line 93, in RunCompleterCommand
return _JsonResponse( completer.OnUserCommand(
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/completer.py", line 481, in OnUserCommand
return command( self, request_data, arguments[ 1: ] )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1758, in <lambda>
lambda self, request_data, args: self.GetDoc( request_data )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/cpp/clangd_completer.py", line 274, in GetDoc
self.GetHoverResponse( request_data )[ 'value' ] )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 2490, in GetHoverResponse
response = self.GetConnection().GetResponse(
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 442, in GetResponse
return response.AwaitResponse( timeout )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 219, in AwaitResponse
raise ResponseFailedException( error )
ycmd.completers.language_server.language_server_completer.ResponseFailedException: Request failed: -32001: invalid AST
127.0.0.1 - - [26/Jul/2023 16:42:40] "POST /run_completer_command HTTP/1.1" 500 2212
bstaletic commented
This usually happens when clangd is unable to parse your source. Can you even compile your source with clang? If clang can not understand your code, there's nothing ycmd can do.