Copy file, folder, and code location paths from VSCode in a format that works well in OpenCode prompts and commands.
What it does
Copies code block paths from the editor context menu.
Copies file and folder paths from the Explorer context menu.
Supports both absolute and workspace-relative output modes.
Normalizes path separators to / for OpenCode-friendly output.
Falls back to absolute output when a workspace-relative path is unavailable.
Editor usage
In an open local file, right-click in the editor and choose one of these commands:
Copy Code Block Path (Absolute)
Copy Code Block Path (Relative)
The copied value includes the file path plus the selection start line and column, or the current cursor position when nothing is selected.
Examples:
Absolute: /Users/me/project/src/extension.ts:12:3
Relative: src/extension.ts:12:3
Relative output is workspace-relative when the file belongs to an open workspace folder. If VSCode cannot determine a workspace-relative path, the extension copies the absolute path instead.
Explorer usage
In the Explorer, right-click a local file-scheme resource for a file or folder and choose one of these commands: