How hediet/vscode-debug-visualizer works
Main Components
• VS Code Extension Core – This is housed under the “extension” directory. It contains most of the integration logic with VS Code (e.g., activation, command registration, proxy classes like DebugSessionProxy, DebuggerProxy, and DebuggerViewProxy).
• Data Extraction Library – Found in the “data-extraction” directory. This module defines interfaces, default data extractors (e.g., AsIsDataExtractor, GridExtractor, etc.), and supports extracting and formatting debugging data. It serves as the “engine” that collects and standardizes debug information.
• Webview Front-End – Under the “webview” directory, you have React-based components (e.g., App.tsx, ExpressionInput.tsx, Visualizer.tsx) and styling files that display the processed debug data in an interactive UI.
• Visualization Backend – Within the “extension/src/VisualizationBackend” folder, this component ties together different visualization supports (JS, Py, Ruby, etc.) and manages the configuration for rendering debug data.
• Demos – The “demos” directory showcases multiple language-specific examples (C++, C#, Dart, Go, Java, JavaScript, Nim, PHP, Python, Ruby, Rust, Swift). Though not part of the runtime system, these folders illustrate how the visualization works across diverse environments.
• Support & Documentation – Additional files (docs, CONTRIBUTING.md, READMEs, CI configuration in .github) provide context, guides, and build instructions for the project.
Relationships and Data Flow
• The Extension Core interacts with the VS Code API and uses proxy classes to communicate with the debugger.
• Debug data is sent to the Data Extraction Library, which uses various “extractor” modules (default and custom) to format data.
• Once data is extracted and standardized, it moves to the Visualization Backend, where it may be further processed or configured.
• The processed data is then passed to the Webview Front-End, where interactive visual components (built with React) render the visualization.
• In parallel, the Demos demonstrate integration and usage examples across multiple language environments.
Architectural Patterns and Technologies
• Modularity: The separation of concerns is clear with distinct directories for the data extraction engine, extension activation logic, and UI rendering.
• API and Proxy Patterns: Used within the extension (see proxies under “extension/src/proxies”) to facilitate communication between different parts of the system and possibly abstract the VS Code debugger interactions.
• Front-End Framework: The webview uses React and SCSS instead of raw HTML/CSS to offer a modern and maintainable UI.
• Build and Configuration: Webpack is used (both in data-extraction and webview directories), and TypeScript is the common programming language across many parts of the project.