microsoft / vscode-anycode

MIT License
334 stars 38 forks source link

Many anycodes in Output panel #45

Closed alexr00 closed 2 years ago

alexr00 commented 2 years ago

Found while testing https://github.com/microsoft/vscode-jupyter/issues/9768.

This only happened once. I wasn't able to make it happen again.

Requirement: Use insiders.vscode.dev in a browser that can access the local file system.

  1. Open an empty local folder in insiders.vscode.dev
  2. Install the Jupyter extension
  3. Create a new Jupyter notebook
  4. Open the output and see many anycode entries in the drop down.

I opened a couple of the entries and saw that the anycode server had stopped in each one.

jrieken commented 2 years ago

@dbaeumer Can this been an LSP thing? I doing this and I assume that LSP client libs clean up the output channel. Is that a false assumption?

dbaeumer commented 2 years ago

@jrieken yes, if you create n clients this might create n channels. I think we will not dedupe them by name. If you want to only have one channel you can use this property https://github.com/microsoft/vscode-languageserver-node/blob/e94895c70deb1b2ddf582f3ecc04adedd1029fb0/client/src/common/client.ts#L314 and create the channel yourself.

jrieken commented 2 years ago

@dbaeumer is there a way to stop/dispose a client so that the output channel is cleaned up by the LSP client?

dbaeumer commented 2 years ago

Yes, when you call stop and the client created the channel the channel will be disposed.

jrieken commented 2 years ago

It's now the extension creating the channel, not LSP anymore