Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Line RefNew to Visual Studio Code? Get it now.
Copy Line Ref

Copy Line Ref

copy-line-ref

|
1 install
| (0) | Free
Right-click to copy file relative path with selected line numbers (e.g. src/app.ts:10-20)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Line Reference

Select code in VS Code, right-click → Copy Line Reference to copy the file's relative path with line numbers to your clipboard.

Output Format

  • Single line selected: src/app.ts:10
  • Multiple lines selected: src/app.ts:10-20

Usage

  1. Select code in the editor
  2. Right-click → Copy Line Reference
  3. Paste anywhere — chat, PR description, issue, etc.

Use Case

When discussing code with AI tools (Claude Code, etc.) or teammates, quickly reference exact code locations without manually typing file paths and line numbers.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft