Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Line Reference VSCodeNew to Visual Studio Code? Get it now.
Copy Line Reference VSCode

Copy Line Reference VSCode

Rune Aspvik

|
4 installs
| (0) | Free
Copy relative file path with line or line range (e.g., src/app.js:12 or src/app.js:12-20).
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Line Reference (minimal extension)

Context

Usage

Right‑click in the editor → Copy Line Reference to copy:

  • relative/path/to/file.js:12 for a cursor or single-line selection
  • relative/path/to/file.js:12-20 for a multi-line selection

Notes

  • Uses workspace-relative paths (asRelativePath). If the file is outside your workspace, it falls back to an absolute path.
  • Path separators are normalized to /.

Development

Quick try (no packaging)

  1. Open this folder in VS Code.
  2. Press F5 (Run Extension) to launch an Extension Development Host.
  3. Open any file, right‑click → Copy Line Reference.

Package a VSIX

Run npm run build to create dist/copy-line-reference-vscode.vsix.

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