vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Provide a nice way for webviews to hook into editor features

Open alexr00 opened this issue 2 years ago • 2 comments

The GitHub Pull Request Extension makes use of webviews to show a PR description:

image

As you can see, there's an input box for a comment. That comment box would greatly benefit from being able to show editor completions. Link detection and hovers would also be nice to have.

Currently, the best way to get editor completions would be to embed a monaco editor in the webview; however, this could provide a strange experience for the user since it will look like a VS Code editor, but behave differently. It's also a lot of work for an extension author.

Ideally, there'd be a simple way to embed a VS Code editor within a webview. Then, all the user's shortcuts, completions, hovers, etc. would work exactly the same as they do in any VS Code editor.

alexr00 avatar Oct 26 '23 12:10 alexr00

YES PLEASE! 😁

At some point in the past @joaomoreno and I talked about maybe creating a web component type model where VS Code would register an "editor" web component that webview's could use -- which would inject a VS Code editor

eamodio avatar Oct 31 '23 16:10 eamodio

becomes more relevant with the rise of co-pilot - not working in the current text editor

AmosG avatar Feb 18 '24 18:02 AmosG