Files
vscode-extension-samples/document-paste
Matt Bierner 2ee6b0b7b9 Update all of our samples to target VSCode 1.100 or newer
This makes sure that if folks get a relatively recent `vscode.d.ts`. It also lets us safely bump up the target to es2024 so you can use all the latest lib additions
2025-08-07 07:57:14 -07:00
..
2022-05-27 17:45:21 -07:00
2024-04-22 18:58:38 -07:00
2023-05-11 13:02:35 -07:00
2022-05-27 17:45:21 -07:00
2024-11-26 22:59:45 -08:00
2025-01-10 10:30:07 -08:00

Document Paste Edit Sample

This sample example shows how to use the document paste APIs. This api let's extension hook into VS Code's normal copy and paste operations in text documents.

With this API you can:

  • On copy, write data to the clipboard. This includes writing metadata that the can be picked up on paste.

  • On paste, generate a custom edit that applies the paste. This can change the content being pasted or make more complex workspace edits, such as creating new files.

  • Extensions can provide multiple ways that content can be pasted. Users can select how content should be pasted using the UI or with the editor.pasteAs.preferences setting.

Requires VS Code 1.97+.