python-lsp / pylsp-mypy

Mypy plugin for the Python LSP Server.
MIT License
127 stars 35 forks source link

Check dmypy status and kill hung daemons before run #10

Closed asford closed 3 years ago

asford commented 3 years ago

The dmypy daemon process can end up in a hung state for many reasons, and may persist in a hung state across lsp sessions.

dmypy run will block indefinitely the daemon process is unresponsive, blocking the lsp server and preventing diagnostics.

Add dmypy status check before dmypy run and kill the daemon if status is non-zero before diagnostic request. The subsequent run will then bring up a fresh daemon.