python-jsonrpc-server
python-jsonrpc-server copied to clipboard
Received cancel notification for unknown message
While using python-jsonrpc-server if I start typing fast in the monaco editor (which I am using coupled with monaco-languageclient), I get a flurry of warnings
WARNING - pyls_jsonrpc.endpoint - Received cancel notification for unknown message
I do see that the jedi component that I use does get invoked, but the auto-completions, linting, signature help - everything simply stops working.
It was seen that the linting, completions stopped working when this error was seen previously. Changing the listen function in 'streams.py' to code below seems to have solved it for now. Is this the right issue and fix? I just added another "except AssertionError" handler
def listen(self, message_consumer):
"""Blocking call to listen for messages on the rfile.
Args:
message_consumer (fn): function that is passed each message as it is read off the socket.
"""
while not self._rfile.closed:
request_str = self._read_message()
if request_str is None:
break
try:
message_consumer(json.loads(request_str.decode('utf-8')))
except ValueError:
log.exception("Failed to parse JSON message %s", request_str)
continue
except AssertionError:
log.exception("AssertionError encountered while consuming message in stream reader. %s", request_str)
continue
Even typing slowly, I got the same error when using emacs and lsp-mode.
Can confirm that this issue exists for spacemacs with pyls and lsp-mode
yup, facing the same issue. any temporary fixes..?
Edit- I just switched to the Microsoft python server. For emacs, it's lsp-python-ms and that works pretty well.
Getting this as well in spacemacs
Any news on this ?
I think the issue is with the kind of request the client is sending for which we are getting this response. If I'm not wrong, you guys might be using @TypeFox/monaco-languageclient which is the one i used and faced the same issue.
Later I changed the editor and shifted to codemirror (for unknown reasons) and I never faced this issue again with the code-mirror language client.