You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Optional method invoked after the user copies text in a file.
32
63
*
33
-
* During {@link prepareDocumentPaste}, an extension can compute metadata that is attached to
34
-
* a {@link DataTransfer} and is passed back to the provider in {@link provideDocumentPasteEdits}.
64
+
* This allows the provider to attach copy metadata to the {@link DataTransfer}
65
+
* which is then passed back to providers in {@linkcode provideDocumentPasteEdits}.
66
+
*
67
+
* Note that currently any changes to the {@linkcode DataTransfer} are isolated to the current editor session.
68
+
* This means that added metadata cannot be seen by other applications.
35
69
*
36
70
* @param document Document where the copy took place.
37
-
* @param ranges Ranges being copied in the `document`.
38
-
* @param dataTransfer The data transfer associated with the copy. You can store additional values on this for later use in {@link provideDocumentPasteEdits}.
71
+
* @param ranges Ranges being copied in {@linkcode document}.
72
+
* @param dataTransfer The data transfer associated with the copy. You can store additional values on this for later use in {@linkcode provideDocumentPasteEdits}.
73
+
* This object is only valid for the duration of this method.
39
74
* @param token A cancellation token.
75
+
*
76
+
* @return Optional thenable that resolves when all changes to the `dataTransfer` are complete.
* In this method, extensions can return a workspace edit that replaces the standard pasting behavior.
83
+
* Returned edits can replace the standard pasting behavior.
47
84
*
48
85
* @param document Document being pasted into
49
-
* @param ranges Currently selected ranges in the document.
50
-
* @param dataTransfer The data transfer associated with the paste.
86
+
* @param ranges Range in the {@linkcode document} to paste into.
87
+
* @param dataTransfer The {@link DataTransfer data transfer} associated with the paste. This object is only valid for the duration of the paste operation.
88
+
* @param context Additional context for the paste.
51
89
* @param token A cancellation token.
52
90
*
53
-
* @returnOptional workspace edit that applies the paste. Return undefined to use standard pasting.
91
+
* @returnSet of potential {@link DocumentPasteEdit edits} that apply the paste. Return `undefined` to use standard pasting.
* This id is used when users configure the default provider for paste.
174
+
* List of {@link DocumentPasteEditKind kinds} that the provider may return in {@linkcode DocumentPasteEditProvider.provideDocumentPasteEdits provideDocumentPasteEdits}.
98
175
*
99
-
* This id should be unique within the extension but does not need to be unique across extensions.
176
+
* The provider will only be invoked when one of these kinds is being requested. For normal pasting, all providers will be invoked.
0 commit comments