Closed plemarquand closed 4 weeks ago
This is kind of dodgy, in that we are assuming the VSCode language client never calls the dispose
on the outputChannel. Looking through the language client code it should be calling it, so I am a little confused as to why this call is needed.
https://github.com/microsoft/vscode-languageserver-node/blob/0226f6cd925d279dda2b777d25c5b69518ac0035/client/src/common/client.ts#L1414
After some digging I understand what is happening here, and it does seem to be a bug in vscode-languageclient. The flow is:
client
is created, client's output channel ("OC1") is created.client.stop
is called, "OC1" is disposed, client._outputChannel is set to undefined
0
, which is then logged here.outputChannel
getter, seeing that this._outputChannel
is undefined due to previous disposal, creates a new output channel ("OC2") that replaces the one that was disposed.
This leaves us with one more output channel than we started with.
After some digging I understand what is happening here, and it does seem to be a bug in vscode-languageclient. The flow is:
Do you want to add an issue for the vscode language client? Oh and add a comment here detailing the issue and that it should be reverted once a fix is in vscode-language-server
Sounds good, I'll create that issue once I have received internal approval and link it back to here.
Created https://github.com/microsoft/vscode-languageserver-node/issues/1496 to track the root cause in vscode-language-server-node.
When restarting SourceKit-LSP its output channel was not disposed, which caused a new entry to be added to the output channel list without removing the old one.
Fixes #839