prepareDocumentPaste

Optional method invoked after the user copies from a text editor.

This allows the provider to attach metadata about the copied text to the DataTransfer. This data transfer is then passed back to providers in provideDocumentPasteEdits.

Note that currently any changes to the DataTransfer are isolated to the current editor window. This means that any added metadata cannot be seen by other editor windows or by other applications.

Return

Optional thenable that resolves when all changes to the dataTransfer are complete.

Online Documentation

Parameters

document

Text document where the copy took place.

ranges

Ranges being copied in document.

dataTransfer

The data transfer associated with the copy. You can store additional values on this for later use in provideDocumentPasteEdits. This object is only valid for the duration of this method.

token

A cancellation token.