Debug VisualizerA VS Code extension for visualizing data structures while debugging. Like the VS Code's watch view, but with rich visualizations of the watched value. Visualization PlaygroundClick here to explore all available visualizations. Supported LanguagesSee demos for demos. These languages and debuggers are verified to work with this extension:
All other languages and debuggers might work too. For languages with Basic Support, only JSON strings can be visualized - you must implement some logic that builds this JSON for your data structure! Fully supported languages offer Data Extractors which convert some well known data structures to json. UsageAfter installing this extension, use the command Use the command Supported ValuesNot all values can be processed. Visualizers consume specific JSON data. This extension uses hediet/visualization, a generic visualization framework. You can see in its playground which data can be visualized and how the visualization looks like. The currently watched expression should evaluate to a JSON Object string,
matching the schema of one of the supported visualizers. This JSON string may be surrounded by single or double quotation marks (or none at all) and must not be escaped.
A valid example is For some languages (TypeScript/JavaScript), runtime code is injected to support Data Extractors. A Data Extractor lifts the requirement for the visualized value to be a JSON string and acts as a bridge between custom data structures and the JSON data processed by the visualizers. When multiple Data Extractors are applicable, a preferred one can be selected in the visualization view. There is a JSON Schema for all supported visualizations and a typescript declaration file. Selected DemosReversing a Doubly Linked ListRandom WalkAst VisualizerTable VisualizerJavaScript/TypeScript Integrated Data ExtractorsData extractors convert arbitrary values into data consumable by visualizers.
They live in the debugee. The following data extractors are injected automatically into the debugee by this extension when using the
UI Features
ConfigurationThis extension provides these configuration options: debugVisualizer.debugAdapterConfigurationsAllows to set expression templates for specific debug adapter types. Example:
Configurations here overwrite the built-in support for the corresponding debug adapter type. debugVisualizer.useChromeKioskModeSpecifies whether to pop out Debug Visualization Views with Chrome in Kiosk Mode. Uses the default browser otherwise or if Chrome is not found. Defaults to debugVisualizer.js.customScriptPathsSpecifies a list of JavaScript files that are injected into the debugee when debugging JavaScript.
Each script must assign Example:
Use the See AlsoThis extension works very well together with my library ContributingFeel free to ping me on GitHub by opening an issue! Having runtime infrastructures for languages other than JavaScript would be awesome and I happily accept PRs! |