Go DI Navigation Extension
VS Code extension for navigating Go Dependency Injection annotations.
Features
- Go to Definition: Click on
di:by_name(ServiceName) to jump to the service definition
- Find References: Find all places where a DI service is used
- Hover Information: Hover over DI annotations to see dependencies and dependents
- Code Lens: See dependency counts above service definitions
Usage
- Install the extension
- Open a Go project with DI annotations (
// di:new, // di:name, // di:by_name)
- The extension will automatically load the DI container from
internal/generated/container/init.json
- Use Ctrl+Click (Cmd+Click on Mac) on
di:by_name(ServiceName) to navigate to the service definition
Configuration
You can configure the path to the DI container JSON file in VS Code settings:
{
"goDiNavigation.containerPath": "internal/generated/container/init.json"
}
Development
npm install
npm run compile
npm run watch # For development
Press F5 to launch the extension in a new VS Code window.
Requirements
- VS Code 1.74.0 or higher
- Go project with DI annotations
| |