Closed tyoung-patreon closed 1 year ago
One duplicate value I see in the debug logs of the LSP server is:
[DEBUG][2022-10-26 17:37:28] .../vim/lsp/rpc.lua:285 "rpc.send" { jsonrpc = "2.0", method = "workspace/didChangeConfiguration", params = { settings = { pylsp = { plugins = { pylsp_mypy = { dmypy = true, enabled = true, live_mode = false } } } } }}
[DEBUG][2022-10-26 17:37:28] .../vim/lsp/rpc.lua:285 "rpc.send" { jsonrpc = "2.0", method = "workspace/didChangeConfiguration", params = { settings = { pylsp = { plugins = { pylsp_mypy = { dmypy = true, enabled = true, live_mode = false } } } } }}
On save it just has the following:
[DEBUG][2022-10-26 17:45:53] .../vim/lsp/rpc.lua:285 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didSave", ....
[ERROR][2022-10-26 17:45:53] .../vim/lsp/rpc.lua:733 "rpc" "pylsp" "stderr" "Daemon has died\n"
And that is when two dmypy instances are invoked, so I'm not sure why that would be happening. It looks like only a single "didSave" rpc is sent, but perhaps two receivers are set up a the beginning? There's only a single instance of pylsp running.
I also don't know what the "Daemon has died" is from, any ideas?
Additionally it looks like when I run dmypy start
beforehand that server instance is killed by the newly created invocations. Only one of them is left in .dmypy.json
and when I run dmypy status
it outputs Daemon is stuck;
Looking into the code more it looks like a few things are going wrong. It could be that my dmypy version is off from what this codebase expects (if so my bad).
It should probably status check using dmypy status
instead of just "dmypy", *apply_overrides
. I think because the existing dmypy
is created with run
it then kills that daemon and starts a new one. I'll see if I can make a reasonable PR to fix this if it isn't intended behavior.
I know it gets invoked a more often than it should, but did not have the time to figure out why. Thank you for investigating. Did you test if this PR fixes your problem?
I'm using pylsp-mypy with neovim native lsp in dmypy mode, and when I save a file I don't get any of the speedup from using dmypy, so it takes 10s of seconds for type checking to load. When I use dmypy on the command line individually it runs instantaneously after edits (outside of neovim). If I edit within neovim (and therefore run dmypy through this plugin), then the mypy cache appears to get entirely recalculated and no caching happens.
After editing a file and running
ps aux | grep mypy
I get two identical looking commands as output: