Open zlogic opened 7 months ago
I don't think this is a bug of Vim or the LSP plugin, just wanted to share my (quick) solution to a problem.
Since it's possible that a specific LSP might be be compiled as a MinGW or regular Windows executable, it might make sense to have a way to override initparams.processId
per-LSP.
Most LSP servers (like Eclipse JDT LS) use initparams' processId to check if the parent process is still running.
In MinGW versions of vim (for example, vim shipped with the Windows installer for Git), the
getpid()
call returns a MinGW-specific PID that doesn't match Windows PIDs.If the LSP is a Windows executable that's not using MinGW and expects a Windows PID (like Eclipse JDT), it will try to search for a MinGW PID in the Windows process tree and almost always fail. In my case, Eclipse LSP shuts down after ≈ 30 seconds of inactivity, with a Parent process stopped running, forcing server exit message in the logs.
This can be fixed by:
getpid()
would return a Windows PIDgetpid()
in https://github.com/yegappan/lsp/blob/8255965e345c0628036ac7f635cf5784cddec5dd/autoload/lsp/lspserver.vim#L162 with a function that returns a Windows PID, something like this: