Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Goto Next/Previous ReferenceNew to Visual Studio Code? Get it now.
Goto Next/Previous Reference

Goto Next/Previous Reference

csmyx

|
1 install
| (0) | Free
Jump directly to the next or previous reference of the current symbol without opening the references peek panel.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Goto Next/Previous Reference

Jump directly to the next or previous reference of the symbol under the cursor — no peek panel, no side bar, just instant navigation.

Features

  • Alt+N / Alt+P to cycle through references of the current symbol
  • References are sorted (by file path → line → column) for deterministic order
  • Wraps around at the ends (configurable)
  • Caches the reference list while you stay within the same symbol — no repeated queries
  • Works across multiple files
  • Falls back to definition-based lookup when direct reference query returns 0 results (workaround for clangd's dependent-type limitation)

Keybindings

Key Command Description
Alt+N Goto Next Reference Jump to the next reference
Alt+P Goto Previous Reference Jump to the previous reference

You can change these in File > Preferences > Keyboard Shortcuts by searching for Goto Next Reference / Goto Previous Reference.

Configuration

Setting Default Description
gotoNextReference.enableDebugLog false Enable debug output to the Goto Reference channel in the Output panel
gotoNextReference.wrapAround true Wrap around to the first reference after the last one, and to the last reference before the first one

Known Issue: clangd & Dependent Types

When calling a member function through a dependent type (e.g. (*it)->method() inside a template), clangd's reference provider may return 0 results even though "Go to Definition" works. This is a known clangd limitation:

  • clangd/clangd#258 — Find references in dependent contexts
  • clangd/clangd#399 — Can't find reference nested in template
  • clangd/clangd#675 — find-refs missing references from dependent node
  • clangd/clangd#1628 — Find references does not work in templates and lambdas with auto

This extension works around the issue by falling back to definition-based lookup: when the reference provider returns 0 results, it queries vscode.executeDefinitionProvider to find the symbol's definition, then queries references at the definition location instead.

Installation

Install from VSIX (local)

npm install -g @vscode/vsce
npx vsce package

Install it in VS Code:

  1. Open Extensions (Ctrl+Shift+X)
  2. Click ... → Install from VSIX...
  3. Select the .vsix file

Install from source (dev mode)

npm install
npm run compile

Then press F5 to launch an Extension Development Host window.

Publishing to the Marketplace

  1. Create a Microsoft account and an Azure DevOps organization.
  2. Create a Personal Access Token with scope Marketplace (Publish).
  3. Install vsce: npm install -g @vscode/vsce.
  4. Create a publisher: npx vsce create-publisher <publisher-name>.
  5. Update "publisher" in package.json to match your publisher name.
  6. Run npx vsce publish.

See the official publishing guide for details.

Changelog

1.1.0

  • Definition-fallback lookup: when vscode.executeReferenceProvider returns 0 results (e.g. clangd on dependent types like (*it)->method() inside templates), the extension now falls back to querying vscode.executeDefinitionProvider first and re-querying references from the definition location (clangd#258, #399, #675, #1628)
  • Added gotoNextReference.wrapAround setting (default true)
  • Normalized cursor to word start before querying reference provider
  • Cache only invalidated when a referenced document changes (not on every file change)
  • Debug logging controlled by gotoNextReference.enableDebugLog

1.0.0

  • Initial release: Alt+N / Alt+P to jump between references without opening the peek panel
  • Reference caching while cycling within the same symbol
  • Wrap-around navigation (now configurable)

License

MIT

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