How mk668a/llm-codemap works
LLM Code Map is a VS Code extension that turns a TypeScript/JavaScript workspace—or an LLM-supplied graph—into an interactive dependency map. Users refresh the sidebar to scan and visualize a workspace, or an AI agent invokes the Language Model Tool with graph data or discovery hints. The runtime separates source parsing, graph construction/filtering, and graph presentation. The README documents symbol-level relationships, focused analysis, D3 rendering, and symbol navigation; sampled excerpts do not establish the implementation details of every webview interaction.
Main entry points: TypeScriptAnalyzer.ts TS Analyzer · extension.ts Extension Activation · codemapTool.ts Codemap Tool · CodemapViewProvider.ts Sidebar Provider
Components 15
Extension Runtime
- Extension Activation
src/extension.ts - Output Logger
src/utils/logger.ts
Code Analysis
- TS Analyzer
src/analyzer/TypeScriptAnalyzer.ts - File Utilities
src/utils/fileUtils.ts - Path Utilities
src/utils/pathUtils.ts - Graph Extractor
src/analyzer/DependencyExtractor.ts - Graph Types
src/analyzer/types.ts
Agent Tool
- Codemap Tool
src/tools/codemapTool.ts - Tool Parameters
src/tools/types.ts
Graph View
- Sidebar Provider
src/visualizer/CodemapViewProvider.ts - D3 Transformer
src/visualizer/graphDataTransformer.ts - Interactive D3 Graph
src/visualizer/CodemapViewProvider.ts
Other components
- VS Code User
- AI Agent
- Code Workspace
Connections 18
- VS Code User → Extension Activation: refresh command
- AI Agent → Codemap Tool: invoke analysis
- Extension Activation → TS Analyzer: analyze workspace
- Extension Activation → Graph Extractor: build graph
- Extension Activation → Sidebar Provider: update graph
- Codemap Tool → TS Analyzer: analyze workspace
- Codemap Tool → Graph Extractor: extract or create graph
- Codemap Tool → Sidebar Provider: update graph
- TS Analyzer → Code Workspace: scan source files
- TS Analyzer → File Utilities: find and read
- TS Analyzer → Path Utilities: normalize paths
- Graph Extractor → TS Analyzer: resolve source files
- Sidebar Provider → D3 Transformer: transform graph data
- Sidebar Provider → Interactive D3 Graph: render graph
- VS Code User → Interactive D3 Graph: inspect graph
- Extension Activation → Output Logger: log runtime
- Codemap Tool → Output Logger: log analysis
- Sidebar Provider → Output Logger: log rendering