src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts/MainThreadLanguageFeatures/$registerPasteEditProvider
class MainThreadLanguageFeatures:	$registerPasteEditProvider(handle: number, selector: IDocumentFilterDto[], supportsCopy: boolean, pasteMimeTypes: readonly string[]): void {
		const provider: languages.DocumentPasteEditProvider = {
			pasteMimeTypes: pasteMimeTypes,

			prepareDocumentPaste: supportsCopy
				? async (model: ITextModel, selections: Selection[], dataTransfer: VSDataTransfer, token: CancellationToken): Promise<VSDataTransfer | undefined> => {
					const dataTransferDto = await typeConvert.DataTransfer.toDataTransferDTO(dataTransfer);
					if (token.isCancellationRequested) {
						return undefined;
					}

					const result = await this._proxy.$prepareDocumentPaste(handle, model.uri, selections, dataTransferDto, token);
					if (!result) {
						return undefined;
					}

					const dataTransferOut = new VSDataTransfer();
					result.items.forEach(([type, item]) => {
						dataTransferOut.replace(type, createStringDataTransferItem(item.asString));
					});
					return dataTransferOut;
				}
				: undefined,

			provideDocumentPasteEdits: async (model: ITextModel, selections: Selection[], dataTransfer: VSDataTransfer, token: CancellationToken) => {
				const d = await typeConvert.DataTransfer.toDataTransferDTO(dataTransfer);
				const result = await this._proxy.$providePasteEdits(handle, model.uri, selections, d, token);
				if (!result) {
					return undefined;
				}

				return {
					insertText: result.insertText,
					additionalEdit: result.additionalEdit ? reviveWorkspaceEditDto(result.additionalEdit) : undefined,
				};
			}
		};

		this._registrations.set(handle, this._languageFeaturesService.documentPasteEditProvider.register(selector, provider));
	}