provideDocumentPasteEdits
abstract var provideDocumentPasteEdits: (document: TextDocument, ReadonlyArray<Range>, dataTransfer: DataTransfer, context: DocumentPasteEditContext, token: CancellationToken) -> ProviderResult<ReadonlyArray<T>>?(source)
Invoked before the user pastes into a text editor.
Returned edits can replace the standard pasting behavior.
Return
Set of potential edits that can apply the paste. Only a single returned {@linkcode DocumentPasteEdit} is applied at a time. If multiple edits are returned from all providers, then the first is automatically applied and a widget is shown that lets the user switch to the other edits.
Parameters
document
Document being pasted into
ranges
Range in the {@linkcode document} to paste into.
dataTransfer
The data transfer associated with the paste. This object is only valid for the duration of the paste operation.
context
Additional context for the paste.
token
A cancellation token.