(fn: (activeEditor: TextEditor) => string)
| 5 | import { UriScheme } from "./uriScheme"; |
| 6 | |
| 7 | export 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 | |
| 20 | export function getPath(activeEditor: TextEditor) { |
| 21 | return _getPath(activeEditor, false).fsPath; |