diff --git a/client/src/extension.ts b/client/src/extension.ts index 45c9b40..2a25e3d 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -18,7 +18,8 @@ import { CodeActionContext, ProgressLocation, TextDocument, - languages + languages, + env } from "vscode"; import { LanguageClient, @@ -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); diff --git a/server/src/language/code_lens.ts b/server/src/language/code_lens.ts index 7d1a912..66120bf 100644 --- a/server/src/language/code_lens.ts +++ b/server/src/language/code_lens.ts @@ -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] } } ];