VS Code API
    Preparing search index...

    Interface DocumentPasteEditProvider<T>

    Provider invoked when the user copies or pastes in a TextDocument.

    interface DocumentPasteEditProvider<
        T extends DocumentPasteEdit = DocumentPasteEdit,
    > {
        prepareDocumentPaste?(
            document: TextDocument,
            ranges: readonly Range[],
            dataTransfer: DataTransfer,
            token: CancellationToken,
        ): void | Thenable<void>;
        provideDocumentPasteEdits?(
            document: TextDocument,
            ranges: readonly Range[],
            dataTransfer: DataTransfer,
            context: DocumentPasteEditContext,
            token: CancellationToken,
        ): ProviderResult<T[]>;
        resolveDocumentPasteEdit?(
            pasteEdit: T,
            token: CancellationToken,
        ): ProviderResult<T>;
    }

    Type Parameters

    Index

    Methods

    • 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.

      Parameters

      Returns void | Thenable<void>

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