Open compyman opened 2 years ago
Perhaps this is two separate issues:
I think so! both would be great.
A way to throttle requests would be great, I'm currently hitting the same issue with zls
This is quite easily reproducible with lsp-mode
and python-lsp/python-lsp-server
, and makes the combination unusable.
Is there a temporary workaround/configuration for lsp-mode
that can make it usable until we address the root cause mentioned by @svenssonaxel ?
Collecting all related issues to this slowdown here:
This is quite a widespread issue.
I am facing the same issue in neovim, every keypress produces error and in a few minutes lsp commands turn to be veeery slow
I tried using lsp-jedi
with jedi-language-server
, and I see exactly the same behaviour as with pylsp
: CPU pinned to 100%, auto-complete taking >8 seconds
I see very similar messages in *jedi::stderr*
:
WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "501"
WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "503"
WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "505"
WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "506"
WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "507"
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
I'm having issues with python-lsp-server (pylsp) - I am able to configure/connect to a pylsp server in my virtualenvironment - but - it often times will use 100%+ of my CPU (as reported by top) and crucially - totally freeze emacs!
There's an issue in the python-lsp-server repo here: https://github.com/python-lsp/python-lsp-server/issues/227
It looks like - lsp-mode is sending over signature requests or other commands on every keypress, and then cancelling the previous request. However it looks like python-lsp-server does not support cancel requests, so all of those requests bring everything to a halt unless I type very very slowly.
Is there any configuration to... only send requests after a certain amount of time has passed from a keypress? (maybe only on servers that don't support canceling?) or any other advice for configuration or other python servers that don't have this issue?
Steps to reproduce
(I think a somewhat large project is required)
Expected behavior
lsp-mode to not flood the language server with requests if the server is unable to cancel them
Which Language Server did you use?
pylsp
OS
Linux
Error callstack
No response
Anything else?
mentioned in the discord here: https://discord.com/channels/789885435026604033/789890622424219658/1018883658226085970