saem / vscode-nim

Other
180 stars 23 forks source link

Request: add the possibility to choose between nimlsp and nimlangserver #131

Open arkanoid87 opened 8 months ago

arkanoid87 commented 8 months ago

There are pro and cons using nimlangserver vs nimlsp. The main difference is that the first runs nimsuggest processes and controls them, just like this extension does internally when selecting "nimsuggest" option, while nimlsp is compiled with parts of nimsuggest inside, and runs without spawning extra nimsuggest processes.

According to my experience, both solutions that spawn nimsuggest happens fail to keep child processes lifetime under control, and sometimes nimsuggest processes accumulates until OOM is triggered on host.

I'm not blaming any solution here, just trying to point out that currently by selecting "lsp" option nimlangserver is executed, and seems that there is no option to switch to nimlsp, which is a good "plan B".

Considering that nimlagserver and numlsp should naturally speak the same protocol, would it be possible to add a selection to pick the desired LSP executable?

Thanks

saem commented 8 months ago

That's a relatively straightforward PR and it should work, only issue might be one LSP is more feature complete than the other, but over time capability testing could be added to address that. I don't have time to work on it, however.