Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Code TraceNew to Visual Studio Code? Get it now.
Code Trace

Code Trace

Anas Shakil

| (0) | Free
⚡ Copy code snippets bundled with their file paths and line numbers for easy sharing.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code Trace

Copy a workspace-relative file path with an optional line range to the clipboard — formatted for pasting into coding agents, PR comments, or docs.

Usage

With cursor or selection in any editor file:

Action Result
No selection src/utils/parser.ts
Cursor on line 42 (single line selected) src/utils/parser.ts:42
Lines 10–25 selected src/utils/parser.ts:10-25
Multiple selections (perSelection mode) one reference per line
Multiple selections (span mode) single range min→max

Trigger

  • Keybinding: Ctrl+Alt+C / Cmd+Alt+C
  • Command Palette: Code Trace: Copy Code Reference
  • Editor context menu: right-click → Copy Code Reference

Ctrl+Alt+C conflict note: this binding may overlap with some "Copy Path" bindings in certain environments. It ships enabled by default and is freely rebindable via keybindings.json.

Settings

Setting Type Default Description
codeTrace.multiSelection "primary" | "perSelection" | "span" "primary" How to handle multiple cursors/selections
  • primary — use the first selection only.
  • perSelection — one reference per non-empty selection, sorted ascending, newline-joined.
  • span — single range from the lowest start to the highest end.

Install

  • VS Code Marketplace
  • Open VSX (Cursor, Codium, etc.)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft