Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopped client can recreate its OutputChannel #1496

Open
plemarquand opened this issue Jun 12, 2024 · 1 comment
Open

Stopped client can recreate its OutputChannel #1496

plemarquand opened this issue Jun 12, 2024 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@plemarquand
Copy link

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.stop is 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 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.
  • 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.

@dbaeumer
Copy link
Member

Great analysis. Will look into fixing it.

@dbaeumer dbaeumer added this to the June 2024 milestone Jun 13, 2024
@dbaeumer dbaeumer self-assigned this Jun 13, 2024
@dbaeumer dbaeumer modified the milestones: June 2024, On Deck Dec 12, 2024
@dbaeumer dbaeumer added the bug Issue identified by VS Code Team member as probable bug label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants