Skip to content

Commit

Permalink
Merge pull request #1139 from mjbvz/finalize-paste
Browse files Browse the repository at this point in the history
Update to finalized api
  • Loading branch information
mjbvz authored Jan 10, 2025
2 parents 5ddd30f + 91b52f8 commit 0d2044e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
12 changes: 10 additions & 2 deletions document-paste/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Document Paste Edit Sample

This sample shows usage of the [document paste edit proposal](https://github.com/microsoft/vscode/issues/30066).
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.

Requires VS Code 1.88+.
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+.
15 changes: 1 addition & 14 deletions document-paste/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions document-paste/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
"type": "git",
"url": "https://github.com/Microsoft/vscode-extension-samples"
},
"enabledApiProposals": [
"documentPaste"
],
"engines": {
"vscode": "^1.88.0"
"vscode": "^1.97.0"
},
"categories": [
"Other"
Expand All @@ -29,14 +26,13 @@
"compile": "tsc -p ./",
"lint": "eslint",
"watch": "tsc -watch -p ./",
"download-api": "dts dev",
"download-api": "dts main",
"postinstall": "npm run download-api"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/node": "^20",
"@types/vscode": "^1.93.0",
"@vscode/dts": "^0.4.0",
"eslint": "^9.13.0",
"typescript": "^5.7.2",
Expand Down

0 comments on commit 0d2044e

Please sign in to comment.