-
Notifications
You must be signed in to change notification settings - Fork 239
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:
PowerShellEditorServices/src/PowerShellEditorServices.Host/EditorServicesHost.cs
Line 341 in 4716b7f
this.serverCompletedTask = new TaskCompletionSource<bool>(); |
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! 😄