Description
Ok everyone, I did some research and here's what I've found:
Right now, the client kills the server process.
The proof can be found here in the VSCode client: https://github.com/PowerShell/vscode-powershell/blob/master/src/process.ts#L145-L161
That said, this is not a good thing.
You might be wondering... The LSP has both a shutdown
and an exit
message, don't we implement those?
The answer is yes.......... but it's functionally a no-op 😢
You can see the TODO
comment here:
https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs#L148
which is referring to this TaskCompletionSource that is causing the process to stay open:
All we need to do is pass that TaskCompletionSource into the handler and complete the source when an exit
event is received (possibly when there are 0 connections)
P.s. big thanks to @SeeminglyScience for helping me investigate this! 😄