From 91b52f8ab785e9b5279385ec5e267bc547d8932e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 10 Jan 2025 10:30:07 -0800 Subject: [PATCH] Update to finalized api --- document-paste/README.md | 12 ++++++++++-- document-paste/package-lock.json | 15 +-------------- document-paste/package.json | 8 ++------ 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/document-paste/README.md b/document-paste/README.md index 729ef72a..db184d63 100644 --- a/document-paste/README.md +++ b/document-paste/README.md @@ -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+. \ No newline at end of file +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+. \ No newline at end of file diff --git a/document-paste/package-lock.json b/document-paste/package-lock.json index fec8b504..9fef9125 100644 --- a/document-paste/package-lock.json +++ b/document-paste/package-lock.json @@ -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", diff --git a/document-paste/package.json b/document-paste/package.json index ace3616d..53ce1976 100644 --- a/document-paste/package.json +++ b/document-paste/package.json @@ -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",