Go Dependency Lens
Interactive VS Code extension for visualizing Go project dependency graphs with advanced features.
Features
🚀 Interactive Dependency Visualization
- Force-directed graph layout with D3.js
- Real-time node positioning and physics simulation
- Drag nodes to rearrange layout
📦 Smart Clustering
- Automatic clustering of external dependencies (when >5 packages)
- Standard library clustering (when >3 packages)
- Independent expand/collapse controls for each cluster type
🎯 Path Highlighting
- Click any node to highlight its dependency connections
- Visual emphasis on connected nodes and links
- Double-click to clear highlighting
🔍 Navigation Controls
- Zoom in/out with mouse wheel or buttons
- Pan in all directions by dragging
- Reset view to original position
📊 Comprehensive Analysis
- Package type classification (Main, Internal, External, Standard Library)
- Dependency metrics and statistics
- Cycle detection and compilation order analysis
Quick Start
- Install the extension from the VS Code Marketplace
- Open a Go project with a
go.mod file
- Access the extension via:
- Sidebar: "Go Dependencies" panel in Explorer
- Right-click: Any
.go file → "Show Dependency Graph"
- Command Palette:
Ctrl+Shift+P → "Go Dependency Lens"
- Keyboard shortcut:
Ctrl+Shift+G, Ctrl+D
Usage
Graph Interaction
- Click nodes: Highlight dependency paths
- Drag nodes: Rearrange layout
- Mouse wheel: Zoom in/out
- Drag background: Pan around
- Cluster buttons: Expand/collapse external deps and stdlib
- Double-click: Clear highlighting
Multiple Access Points
- Sidebar panel: Quick access from Explorer
- Context menus: Right-click on Go files
- Editor toolbar: Graph icon when viewing Go files
- Keyboard shortcuts: Fast access for power users
Requirements
- VS Code 1.105.0 or higher
- Go project with valid
go.mod file
- Go toolchain installed and accessible via PATH
Extension Settings
This extension doesn't currently contribute any VS Code settings, but future versions may include customization options for:
- Graph layout algorithms
- Color themes
- Performance settings
Known Issues
- Large projects (>100 packages) may experience slower rendering
- Complex circular dependencies might affect layout performance
Release Notes
0.0.1
- Initial release
- Interactive dependency graph visualization
- Smart clustering for external dependencies and standard library
- Path highlighting and navigation controls
- Multiple access points (sidebar, context menus, shortcuts)
Development
# Clone repository
git clone https://github.com/your-username/go-dependency-lens.git
cd go-dependency-lens
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch for changes during development
npm run watch
# Package extension
vsce package
Contributing
Contributions are welcome! Please feel free to:
- Submit bug reports and feature requests
- Create pull requests for improvements
- Share feedback and suggestions
License
This project is licensed under the MIT License - see the LICENSE file for details.
Enjoy analyzing your Go dependencies! 🚀
| |