Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Swift Declaration ReferencesNew to Visual Studio Code? Get it now.
Swift Declaration References

Swift Declaration References

Curtis Liong

| (0) | Free
Cmd+Click a Swift declaration to peek its references when SourceKit has no definition jump target.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Swift Declaration References

Cmd+Click a Swift declaration to list its references — the same muscle memory as TypeScript in VS Code / Cursor.

Why

With SourceKit-LSP, Cmd+Click on a usage jumps to the definition. On the declaration itself, Go to Definition often returns nothing, so Cmd+Click does nothing. TypeScript returns the current location and the editor falls through to Find All References.

This extension fills that gap for Swift: at declaration sites it surfaces reference locations through the normal Cmd+Click gesture.

Requirements

  • Swift extension (SourceKit-LSP) so Find All References works
  • A built / indexed SwiftPM (or build-server) project

Usage

  1. Install this extension and the official Swift extension
  2. Open a .swift file
  3. Cmd+Click (macOS) / Ctrl+Click (Windows/Linux) on a declaration name (func, enum, struct, …)

Usages still Cmd+Click to definition via SourceKit as usual.

Notes

  • Declaration detection is line-based (fast, no nested definition queries)
  • Heavy overloads / generated code may miss or over-match; use Shift+F12 as fallback
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft