extensions/markdown-language-features/src/languageFeatures/copyPaste.ts/registerPasteSupport
export function registerPasteSupport(selector: vscode.DocumentSelector) {
	return vscode.languages.registerDocumentPasteEditProvider(selector, new class implements vscode.DocumentPasteEditProvider {

		async provideDocumentPasteEdits(
			document: vscode.TextDocument,
			_ranges: readonly vscode.Range[],
			dataTransfer: vscode.DataTransfer,
			token: vscode.CancellationToken,
		): Promise<vscode.DocumentPasteEdit | undefined> {
			const enabled = vscode.workspace.getConfiguration('markdown', document).get('experimental.editor.pasteLinks.enabled', true);
			if (!enabled) {
				return;
			}

			const snippet = await tryGetUriListSnippet(document, dataTransfer, token);
			return snippet ? new vscode.DocumentPasteEdit(snippet) : undefined;
		}
	}, {
		pasteMimeTypes: ['text/uri-list']
	});
}