vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Disable code lens for output channels

Open jrieken opened this issue 1 year ago • 1 comments

Extensions that register a code lens provider for all documents/editors can trigger an endless loop which goes like this

  • editor makes request for code lens
  • logging for that request occurs
  • output channel scrolls to reveal last log
  • another code lens request is issued
  • 🔁

jrieken avatar Aug 28 '24 07:08 jrieken

fyi @ulugbekna

jrieken avatar Aug 28 '24 07:08 jrieken

Just fyi, some extensions make extensive use of output channels, so I wonder if codelense was ever used for them, e.g. https://wallabyjs.com/

bpasero avatar Aug 28 '24 15:08 bpasero

so I wonder if codelense was ever used for them, e.g. https://wallabyjs.com/

🤞 not but lets check with @ArtemGovorov

jrieken avatar Aug 28 '24 15:08 jrieken

@bpasero @jrieken Thanks for bringing this up. We are indeed using code lens in output channels, very extensively in Quokka

Screenshot 2024-08-29 at 8 48 53 AM

Code lens are a great fit for our use case as they help with discoverability of features as well as provide a nice compact way to display context actions for rich output.

We do register and use our own language (quokka-output) for the output, is it perhaps possible to allow configuring code lens availability in output channels per language (with false as a default)?

ArtemGovorov avatar Aug 28 '24 23:08 ArtemGovorov

@ArtemGovorov thanks for the swift reply. I am reverting my change and I'll push something like https://github.com/microsoft/vscode/commit/a6965fbd4d0bcdf4b14111ce529eef9fbb13501a for code lens. That means our default logger will ignore code lense requests for output-documents. That should do it

@ulugbekna You might need some extra work, e.g no logging, no logging for output-scheme, only register for known languages etc pp.

jrieken avatar Aug 29 '24 09:08 jrieken

@jrieken Awesome, thanks a lot!

ArtemGovorov avatar Sep 02 '24 00:09 ArtemGovorov