microsoft / microsoft/vscode-languageserver-node
Stopped client can recreate its OutputChannel
Open
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 404
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 14
Description
Our VS Code extension has a command to restart its language server. After a restart there are two identical OutputChannels in the Output dropdown. I did some digging and found the following steps were happening:
- The initial client is created, client's output channel ("OC1") is created.
- User runs the "Restart LSP Server" command in our extension
client.stopis called, "OC1" is disposed, client._outputChannel is set to undefined- Cleanup continues, and the spawned LSP process is terminated
- This finally block executes, listening for the LSP process to exit.
- LSP exits with code 0, which is then logged here.
- The
outputChannelgetter, seeing thatthis._outputChannelis undefined due to previous disposal, creates a new output channel ("OC2") that replaces the one that was disposed. - Finally, our command creates a new client, which creates a new output channel "OC3".
This leaves us with one more output channel than we started with.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.