Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 6 additions & 54 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,16 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"label": "compile",
"type": "shell",
"command": "yarn",
"args": ["compile"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
"problemMatcher": ["$tsc"]
}
]
}
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## Unreleased

## 1.5.0

- Remove clipboardy dependency in favour of native VSCode clipboard API
- Fix import issues

## 1.4.0

- Convert package to ES module
Expand Down
File renamed without changes.
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
"name": "copy-ruby-member-reference",
"displayName": "Copy Ruby Member Reference",
"description": "Copies full namespace path for references under the cursor",
"version": "1.4.0",
"version": "1.5.0",
"author": "Enrico Luz",
"publisher": "ricobl",
"repository": "https://github.com/ricobl/copy-ruby-member-reference.git",
"license": "MIT",
"type": "module",
"icon": "images/icon.png",
"engines": {
"vscode": "^1.95.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:copy-ruby-member-reference.copyReference"
],
"activationEvents": [],
"main": "./dist/extension.js",
"contributes": {
"commands": [
Expand All @@ -29,11 +26,11 @@
},
"scripts": {
"vscode:prepublish": "yarn run package",
"compile": "yarn run check-types && yarn run lint && node esbuild.js",
"compile": "yarn run check-types && yarn run lint && node esbuild.mjs",
"watch": "npm-run-all -p watch:*",
"watch:esbuild": "node esbuild.js --watch",
"watch:esbuild": "node esbuild.mjs --watch",
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
"package": "yarn run check-types && yarn run lint && node esbuild.js --production",
"package": "yarn run check-types && yarn run lint && node esbuild.mjs --production",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "yarn run compile-tests && yarn run compile && yarn run lint",
Expand All @@ -54,9 +51,6 @@
"npm-run-all": "^4.1.5",
"typescript": "^6.0.2"
},
"dependencies": {
"clipboardy": "^5.3.1"
},
"resolutions": {
"serialize-javascript": "^7.0.5"
}
Expand Down
5 changes: 2 additions & 3 deletions src/copy-member-reference.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import * as vscode from 'vscode';
import clipboard from 'clipboardy';

import getMemberReference from './get-member-reference.js';

export default function copyMemberReference() {
export default async function copyMemberReference() {
const memberReference = getMemberReference();
if (!memberReference) {
vscode.window.showInformationMessage('Failed to find member reference', {modal: true});
return;
}

clipboard.writeSync(memberReference);
await vscode.env.clipboard.writeText(memberReference);

vscode.window.showInformationMessage(`${memberReference} copied to clipboard`, {modal: true});
}
Loading
Loading