Go Usage Finder
Find read/write references for Go symbols (fields, functions, variables) in VS Code.
Current documented version: 0.1.1
Features
- 🔍 Multi-source reference search:
- Workspace/project
- GOROOT (Go standard library)
- External modules
- ⚡ Workspace-only fast path:
- If the selected symbol is inside the current workspace, search is limited to workspace references only.
- GOROOT/external scanning is skipped in this case for better speed.
- 📖 Read/write classification (heuristic)
- 🎯 Bottom panel tree view with grouped categories and file hierarchy
- 👁️ Peek references command for quick navigation
- 🧭 Click-to-preview side-by-side navigation
Requirements
- VS Code
>= 1.85.0
- Go installed and available in
PATH
- Go extension for VS Code (recommended)
gopls installed (recommended for full cross-package coverage)
Install gopls if needed:
go install golang.org/x/tools/gopls@latest
Installation
Marketplace
- Open VS Code
- Open Extensions (
Cmd+Shift+X / Ctrl+Shift+X)
- Search for Go Usage Finder
- Click Install
From source
- Clone this repository
- Open it in VS Code
- Run:
npm install
npm run compile
- Press
F5 to launch the extension development host
Usage
Find references (tree view)
- Open a
.go file
- Put cursor on a symbol
- Run Go: Find All References (Read/Write) from right-click menu or command palette
- View results in Go References panel
Find references (peek view)
- Put cursor on a symbol
- Run Show References in Peek View
- Navigate with arrows,
Enter to jump, Esc to close
Result groups
- 📖 Read References
- ✏️ Write References
- 📁 Workspace
- 🔧 GOROOT
- 📦 External Libraries
Each reference item displays line number and snippet. Clicking an item opens side preview.
How search works
- VS Code reference provider for primary results
- Optional
gopls references fallback/enrichment
- Scope detection (workspace/goroot/external)
- Read/write inference from line context
- Performance optimizations:
- Go environment caching
- Document open caching
- Batched concurrent reference processing
- Workspace-only short-circuit mode
Known limitations
- Read/write classification is heuristic and may miss edge cases
- Very large repositories can still be slow
- External library coverage depends on
gopls availability
Development
npm install
npm run compile
npm run lint
Changelog
0.1.1
- Added workspace-only search optimization for symbols inside current project
- Reduced repeated I/O with Go env and document caching
- Improved large-result processing with batched concurrency
- Improved documentation for latest behavior
0.1.0
- Initial release
- Reference search across workspace, GOROOT and external modules
- Read/write distinction
- Bottom panel tree view and peek navigation
| |