LanguageServer.jl icon indicating copy to clipboard operation
LanguageServer.jl copied to clipboard

Error when trying to run with Vim + YCM

Open pxl-th opened this issue 5 years ago • 1 comments

Hi! I get the following error when trying to run LanguageServer in Vim with YCM (as described in their official examples):

[ Info: Received new data from Julia Symbol Server.
ERROR: MethodNotFound: Method not found
Stacktrace:
 [1] send_request(::LanguageServer.JSONRPCEndpoints.JSONRPCEndpoint, ::String, ::LanguageServer.ConfigurationParams) at C:\Users\tonys\.julia\packages\LanguageServer\ZDdcC\src\jsonrpcendpoint.jl:161
 [2] request_julia_config(::LanguageServerInstance) at C:\Users\tonys\.julia\packages\LanguageServer\ZDdcC\src\requests\workspace.jl:77
 [3] process(::LanguageServer.JSONRPC.Request{Val{:initialized},Dict{String,Any}}, ::LanguageServerInstance) at C:\Users\tonys\.julia\packages\LanguageServer\ZDdcC\src\requests\init.jl:159
 [4] run(::LanguageServerInstance) at C:\Users\tonys\.julia\packages\LanguageServer\ZDdcC\src\languageserverinstance.jl:233
 [5] top-level scope at none:1

It seems this issue arises every time YCM sends "command_arguments": ["GetHover"]. Here's the log from YCM:

2020-05-05 10:33:47,763 - DEBUG - POST b'http://127.0.0.1:60195/run_completer_command'
{'content-type': 'application/json', 'x-ycm-hmac': b'TCb08qcVDyzxzwlP4dRfna1FpQV/yzoGUGKsUlIS3xA='}
b'{"filepath": "C:\\\\Users\\\\tonys\\\\projects\\\\julia\\\\kalman\\\\test.jl", "line_num": 3, "column_num": 1, "working_dir": "C:\\\\Users\\\\tonys\\\\projects\\\\julia\\\\kalman", "file_data": {"C:\\\\Users\\\\tonys\\\\projects\\\\julia\\\\kalman\\\\test.jl": {"contents": "using Pkg;\\nusing LanguageServer;\\nimport StaticLint;\\nimport SymbolServer;\\n\\nenv_path = pwd();\\nprintln(\\"Current project: $env_path\\");\\nserver = LanguageServer.LanguageServerInstance(stdin, stdout, false, env_path);\\nserver.runlinter = true;\\nrun(server);\\n", "filetypes": ["julia"]}}, "options": {"tab_size": 4, "insert_spaces": true}, "command_arguments": ["GetHover"]}'
2020-05-05 10:33:47,779 - DEBUG - RX: <Response [500]>
{"exception":{"TYPE":"RuntimeError"},"message":"Server is initializing. Please wait.","traceback":"Traceback (most recent call last):\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\third_party\\bottle\\bottle.py\", line 868, in _handle\n    return route.call(**args)\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\third_party\\bottle\\bottle.py\", line 1748, in wrapper\n    rv = callback(*a, **ka)\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\watchdog_plugin.py\", line 97, in wrapper\n    return callback( *args, **kwargs )\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\hmac_plugin.py\", line 62, in wrapper\n    body = callback( *args, **kwargs )\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\handlers.py\", line 93, in RunCompleterCommand\n    return _JsonResponse( completer.OnUserCommand(\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\completers\\completer.py\", line 414, in OnUserCommand\n    return command( self, request_data, arguments[ 1: ] )\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\completers\\language_server\\generic_lsp_completer.py\", line 50, in <lambda>\n    self._GetHover( request_data ) }\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\completers\\language_server\\generic_lsp_completer.py\", line 54, in _GetHover\n    raw_hover = self.GetHoverResponse( request_data )\n  File \"C:\\Users\\tonys\\vimfiles\\pluggins\\YouCompleteMe\\third_party\\ycmd\\ycmd\\completers\\language_server\\language_server_completer.py\", line 2099, in GetHoverResponse\n    raise RuntimeError( 'Server is initializing. Please wait.' )\nRuntimeError: Server is initializing. Please wait.\n"}
2020-05-05 10:33:47,779 - ERROR - Error while handling server response
Traceback (most recent call last):
  File "C:\Users\tonys\vimfiles\pluggins\YouCompleteMe\python\ycm\client\base_request.py", line 73, in HandleFuture
    return _JsonFromFuture( future )
  File "C:\Users\tonys\vimfiles\pluggins\YouCompleteMe\python\ycm\client\base_request.py", line 256, in _JsonFromFuture
    raise MakeServerException( response.json() )
ycmd.responses.ServerError: RuntimeError: Server is initializing. Please wait.

Status of my environment:

(kalman) pkg> st
Status `C:\Users\tonys\projects\julia\kalman\Project.toml`
  [2b0e0bc5] LanguageServer v2.0.1
  [b3cc710f] StaticLint v3.1.1
  [cf896787] SymbolServer v3.1.1

Tell me if you need some additional info. Hope this helps!

pxl-th avatar May 05 '20 07:05 pxl-th

This is a duplicate of #708

bstaletic avatar Jun 08 '20 14:06 bstaletic