Skip to content

Commit 95ea7e9

Browse files
trackdscsholmq
authored andcommitted
Fix Remote Workspace unable to get clipboard data
1 parent ac75c5d commit 95ea7e9

File tree

3 files changed

+4
-74
lines changed

3 files changed

+4
-74
lines changed

package-lock.json

Lines changed: 0 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
"typescript": "^3.9.10",
5050
"vscode-test": "^1.6.1"
5151
},
52-
"dependencies": {
53-
"copy-paste": "^1.1.3"
54-
},
52+
"dependencies": {},
5553
"nyc": {
5654
"extension": [
5755
".ts",

src/extension.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ import {excelToMarkdown} from './excel-markdown-tables'
1414
* @param context
1515
*/
1616
export function activate(context: vscode.ExtensionContext) {
17-
var disposable = vscode.commands.registerCommand('extension.excelToMarkdown', () => {
18-
let clipboard = require('copy-paste');
19-
20-
clipboard.paste(function(err, val) {
21-
pasteText(val);
22-
});
17+
var disposable = vscode.commands.registerCommand('extension.excelToMarkdown', async () => {
18+
const text = await vscode.env.clipboard.readText();
19+
pasteText(text);
2320
});
2421

2522
context.subscriptions.push(disposable);
@@ -37,7 +34,6 @@ export function deactivate() {
3734
* @param rawData The raw clipboard contents containing the excel table to convert
3835
*/
3936
function pasteText(rawData: string) {
40-
let clipboard = require('copy-paste');
4137

4238
let paste = excelToMarkdown(rawData);
4339

0 commit comments

Comments
 (0)