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

VSCode Copilot - Copy Code Reference

FuJinxiang

|
8 installs
| (0) | Free
Add a floating button near selected text to copy formatted file path with line numbers
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Copilot - Copy Code Reference

A VSCode extension that adds a floating button near selected text to copy formatted file path with line numbers.

Features

  • When you select text in any file, a CodeLens button appears
  • Click the button to copy a reference in the format: relative/path/to/file: startLine - endLine
  • Works with any file type
  • Uses relative path from workspace root

Usage

  1. Select some text in your editor
  2. Click the "Copy Reference" button that appears
  3. The formatted reference is copied to your clipboard

Example

If you select lines 10-15 in src/utils/helper.ts, the copied text will be:

src/utils/helper.ts: 10 - 15

Configuration

You can enable/disable the extension via settings:

  • vscodeCopilot.enable: Enable/disable the code reference button (default: true)

License

MIT

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