MCPcopy Index your code
hub / github.com/VSpaceCode/VSpaceCode / copyWrapper

Function copyWrapper

src/pathCommands.ts:7–18  ·  view source on GitHub ↗
(fn: (activeEditor: TextEditor) => string)

Source from the content-addressed store, hash-verified

5import { UriScheme } from "./uriScheme";
6
7export function copyWrapper(fn: (activeEditor: TextEditor) => string) {
8 return async () => {
9 const activeEditor = window.activeTextEditor;
10 if (activeEditor) {
11 const fsPath = fn(activeEditor);
12 await env.clipboard.writeText(fsPath);
13 window.setStatusBarMessage(fsPath, defaultStatusBarTimeout);
14 return fsPath;
15 }
16 return undefined;
17 };
18}
19
20export function getPath(activeEditor: TextEditor) {
21 return _getPath(activeEditor, false).fsPath;

Callers 1

activateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected