cmake-language-server
cmake-language-server copied to clipboard
self._api is None during completion request
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
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?