Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
feat: copy url if click code_lens
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Mar 7, 2020
1 parent 1a2b7b6 commit e3829d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import {
CodeActionContext,
ProgressLocation,
TextDocument,
languages
languages,
env
} from "vscode";
import {
LanguageClient,
Expand Down Expand Up @@ -479,6 +480,10 @@ Executable ${this.denoInfo.executablePath}`;
this.StartDenoLanguageServer();
});

this.registerCommand("_copy_text", async (text: string) => {
await env.clipboard.writeText(text);
});

this.registerQuickFix({
_fetch_remote_module: async (editor, text) => {
const config = this.getConfiguration(editor.document.uri);
Expand Down
3 changes: 2 additions & 1 deletion server/src/language/code_lens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export class CodeLens {
range: Range.create(Position.create(0, 0), Position.create(0, 0)),
command: {
title: `Deno cached module \`${cache.url.href}\``,
command: ""
command: "deno._copy_text",
arguments: [cache.url.href]
}
}
];
Expand Down

0 comments on commit e3829d8

Please sign in to comment.