microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.74k stars 28.44k forks source link

Enable extension menu contributions to chat codeblocks #217287

Open roblourens opened 1 month ago

roblourens commented 1 month ago

An extension should be able to contribute a menu button to the floating toolbar on chat codeblock editors. There should be a context key for the language of the codeblock and it should be able to get the URI of that editor. eg- Live Preview previewing 'html' codeblocks

bhavyaus commented 1 month ago

This should also support scenarios such as contributing a button to help insert suggested settings into the user's settings.json file.

roblourens commented 1 month ago

Yeah, but I wonder how we would differentiate between that and other json codeblocks. Maybe the extension needs to be able to set a custom context key on the codeblock.

bhavyaus commented 1 month ago

Yeah, but I wonder how we would differentiate between that and other json codeblocks. Maybe the extension needs to be able to set a custom context key on the codeblock.

The extension would be aware of the codeblocks being streamed and could set the context key on the codeblock at that point?

roblourens commented 1 month ago

Yeah, but we don't have a mechanism to set a context key that is scoped to a codeblock.