vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

"Haskell: Restart LSP Server" command doesn't take changed extension settings into account

Open jhrcek opened this issue 4 years ago • 3 comments

When I change extension settings in vscode and then run "Haskell: Restart LSP Server" within vscode, the changed extension settings are not taken into account - it's still running haskell-language-server with the same flags as when I started vscode.

Steps to reproduce: In extension settings change "Haskell: Log File" from the default value (no value) to some valid path on your filesystem. Push Ctrl+Shift+P and select "Haskell: Restart LSP Server"

Actual: the server is restarted, but there's no logging to my file of choice. I have to to actually restart vscode itself for this setting to have and effect (to see some logs in the logging file). It works the same with other settings changes, e.g. when I change "Haskell > Trace Server" from the default (off) to "messages" and restart the lsp from within vscode, it again doesn't reflect the changes - I need to restart vscode itself for this to have an effect.

Expected: restarting HLS from vscode should use the currently selected extension settings.

jhrcek avatar Dec 10 '20 10:12 jhrcek

I think it is reasonable, pr's welcome :slightly_smiling_face:

jneira avatar Dec 10 '20 10:12 jneira

Given that VS Code now has "Restart Extension Host" I'd strongly recommend using that instead of any Plugin specific versions. Since it starts from a much lower level, it fixes all possible bugs that might be caused by the plugin state, giving a much more robust experience. I'd suggest removing the Haskell-specific Restart LSP Server in favour of that.

ndmitchell avatar Dec 10 '20 10:12 ndmitchell

Restart Extension Host restarts all extensions this interrupts workflows like using Github codespaces or using vscode liveshare. We frequently use Restart Haskell LSP Server in liveshare when the server gets stuck, even though it doesn't work reliably all the time it's good enough

pranaysashank avatar Sep 05 '21 11:09 pranaysashank