RightClick Code Link
Copy local code locations from VS Code context menus.
Commands
- Copy Link to File
- Available in Explorer context menu.
- Copies file path only.
- Copy Link to Current File
- Available in editor context menu and editor title.
- Copies current file path only.
- Copy Link to Selection
- Available in editor context menu.
- Copies
path:line or path:line:col.
- If selection is empty, copies cursor location.
- For multi-line selection, output is
path:startLine [Lstart-Lend].
Settings
copyLinkToCode.pathMode
relative (default): workspace-relative path.
absolute: absolute filesystem path.
copyLinkToCode.includeColumn
- Include column in single-line output.
copyLinkToCode.appendRangeHint
- Append range hint for multi-line selections.
Notes
- This extension is local-only and does not generate GitHub/GitLab links.
- No keyboard shortcuts are contributed.
Package VSIX
- Install dependencies:
npm install
- Build:
npm run compile
- Package:
npm run package:vsix
Publish Checklist
- Update
publisher in package.json to your Marketplace publisher ID.
- Replace repository placeholders in
package.json:
repository.url
homepage
bugs.url
- Keep
version as 0.0.1 for first publish, then increment for future updates.
- Login and publish:
npx vsce login <publisher>
npx vsce publish 0.0.1
Install VSIX
- In VS Code: Extensions view →
... menu → Install from VSIX...
- Or command line:
code --install-extension rightclick-code-link-0.0.1.vsix
| |