-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Adding copy/paste provider API proposal #107283
Conversation
9401beb
to
7806751
Compare
94ca340
to
13d6df2
Compare
For #30066 This adds a new `documentPaste` api proposal that lets extensions hook into copy and paste. This can be used to do things such as: - Create link when pasting an image - Bring along imports when copy and pasting code
a43762b
to
da6ea9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes from discussions:
-
Right now we always apply the first edit from a paste provider. In the future we may instead want to show UI on paste that lets users select which edit to use
-
Instead of returning a
WorkspaceEdit
directly, we may want to return a new type such asPasteAction
that has aWorkspaceEdit
. This would let extensions provide names if we show the action in the UI, and also potentially let us split the paste into two phases: provide and resolve -
The current implementation does not apply data transfer contributed by extensions to the global clipboard
This means that you cannot copy and paste data that comes from a provider in VS Code into out into another application. This is likely something we can fix, but means we would need permissions to access the clipboard api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, but API proposals need to be enforced 👮🏼♂️
For #30066
This adds a new
documentCopyPaste
api proposal that lets extensions hook into copy and pasteThis can be used to do things such as: