cmake-language-server icon indicating copy to clipboard operation
cmake-language-server copied to clipboard

self._api is None during completion request

Open CharlesGueunet opened this issue 5 years ago • 1 comments

Hello,

I try to setup cmake-language-server for kakoune, and I am stuck with:

ERRO Error response from server: Failure { jsonrpc: Some(V2), error: Error { code: InvalidParams, message: "AttributeError: \'NoneType\' object has no attribute \'search_variable\'", data: Some(String("{\'traceback\': [\'  File \"/usr/lib/python3.8/site-packages/pygls/protocol.py\", line 324, in _handle_request\\n    self._execute_request(msg_id, handler, params)\\n\', \'  File \"/usr/lib/python3.8/site-packages/pygls/protocol.py\", line 249, in _execute_request\\n    self._send_response(msg_id, handler(params))\\n\', \'  File \"/usr/lib/python3.8/site-packages/cmake_language_server/server.py\", line 75, in completions\\n    variables = self._api.search_variable(token)\\n\']}")) }, id: Num(1) }

In short, it seems the variable _api in server.py line 67 is None and it should not. This variable is also used in the following parts of the method. I can help debugging this if you need more information.

Best, Charles

CharlesGueunet avatar Oct 26 '20 16:10 CharlesGueunet

The _api is initialized here upon receiving an initialize request from the LSP client (editor). So there seems to be a problem with the editor's initialization sequence. Can you show me more old logs?

regen100 avatar Oct 27 '20 02:10 regen100