mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Update to finalized api
This commit is contained in:
@ -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
document-paste/package-lock.json
generated
15
document-paste/package-lock.json
generated
@ -13,14 +13,13 @@
|
||||
"@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",
|
||||
"typescript-eslint": "^8.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.88.0"
|
||||
"vscode": "^1.97.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
@ -274,12 +273,6 @@
|
||||
"undici-types": "~6.19.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/vscode": {
|
||||
"version": "1.94.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz",
|
||||
"integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz",
|
||||
@ -1840,12 +1833,6 @@
|
||||
"undici-types": "~6.19.2"
|
||||
}
|
||||
},
|
||||
"@types/vscode": {
|
||||
"version": "1.94.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz",
|
||||
"integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==",
|
||||
"dev": true
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz",
|
||||
|
||||
@ -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"
|
||||
@ -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",
|
||||
|
||||
Reference in New Issue
Block a user