AI-powered code analysis with graph database integration, directly in your IDE.
- Search: Quickly find functions, classes, and files across your codebase
- Go to Definition: Navigate to any code element with a single click
- Call Graph: Visualize function call relationships with interactive graphs
- Call Analysis: See who calls what, and trace execution flows
- Complexity Analysis: Identify complex functions that need refactoring
- Dead Code Detection: Find unused functions and classes
- Dependency Tracking: Understand file dependencies and imports
- Projects: Browse all indexed projects
- Functions: Explore functions grouped by file
- Classes: Navigate class hierarchies
- Call Graph: Interactive caller/callee exploration
- Dependencies: View file dependencies in real-time
- Inline caller/callee counts above function definitions
- Quick access to call graph visualization
- One-click navigation to related code
- Real-time warnings for dead code
- Complexity warnings for functions exceeding thresholds
- Integrated with VS Code's Problems panel
- Load pre-indexed bundles for popular libraries (numpy, pandas, etc.)
- Instant code understanding without indexing
- cgc CLI: Install CodeGraphContext CLI tool
pip install codegraphcontext
- VS Code: Version 1.85.0 or higher
The extension automatically detects cgc from Python virtual environments! Just install cgc in your project's virtual environment (.venv, venv, etc.) and the extension will find it.
Quick setup:
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/Mac
# or .venv\Scripts\activate on Windows
# Install cgc
pip install codegraphcontext
# Open in VS Code - extension auto-detects cgc!
code .For detailed setup instructions, see VENV_SETUP.md.
This extension contributes the following settings:
cgc.databasePath: Path to the CGC database (default:~/.cgc/db)cgc.autoIndex: Automatically index workspace on startup (default:true)cgc.indexSource: Index full source code for search (default:false)cgc.maxDepth: Maximum depth for call graph traversal (default:3)cgc.cgcPath: Path to cgc CLI executable (default:cgc)cgc.enableCodeLens: Show code lens for callers/callees (default:true)cgc.enableDiagnostics: Show diagnostics for dead code (default:true)cgc.complexityThreshold: Complexity threshold for warnings (default:10)cgc.databaseType: Database backend -falkordborneo4j(default:falkordb)
CGC: Index Current Workspace- Index the current workspaceCGC: Re-index Current Workspace- Force re-indexCGC: Load Bundle- Load a pre-indexed bundle
CGC: Search Code- Search for functions, classes, filesCGC: Show Call Graph- Visualize call graph for a functionCGC: Show Callers- List all callers of a functionCGC: Show Callees- List all callees of a functionCGC: Find Dependencies- Show file dependencies
CGC: Analyze Calls- Analyze all function callsCGC: Analyze Complexity- Find complex functionsCGC: Find Dead Code- Detect unused codeCGC: Show Statistics- Display project statisticsCGC: Show Inheritance Tree- Visualize class inheritance
CGC: Open Settings- Open extension settings
- Install the extension from the VS Code marketplace
- Install cgc CLI:
pip install codegraphcontext - Open a workspace in VS Code
- Index your code: Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux), then type "CGC: Index Current Workspace"
- Browse Projects: Click the CGC icon in the Activity Bar
- Search: Use
CGC: Search Codeto find any code element - View Call Graph: Right-click on a function and select "CGC: Show Call Graph"
- Check Dependencies: Open a file and view the Dependencies panel
When enabled, you'll see inline information above function definitions:
← 3 callers | → 5 callees | Show Call Graph
def process_data(data):
...Click on any code lens to navigate or visualize.
The call graph visualization is fully interactive:
- Zoom: Mouse wheel or pinch gesture
- Pan: Click and drag on empty space
- Move nodes: Drag individual nodes
- Hover: See detailed information
- Controls: Use Reset Zoom and Center buttons
- Large codebases (>10,000 files) may take time to index
- Code lens may be slow on very large files
- Graph visualization performance depends on graph size
Initial release of CodeGraphContext VS Code Extension
Features:
- Complete CGC integration
- Tree views for projects, functions, classes, call graphs, and dependencies
- Interactive graph visualization with D3.js
- Code lens for caller/callee information
- Diagnostics for dead code and complexity
- Bundle loading support
- Comprehensive command palette integration
Found a bug or have a feature request? Please open an issue on GitHub.
MIT License - see LICENSE for details.
Enjoy using CodeGraphContext! 🚀