hediet / vscode-debug-visualizer

An extension for VS Code that visualizes data during debugging.
https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer
GNU General Public License v3.0
7.84k stars 410 forks source link

Unable to get the grid visualisation in python demo #226

Open ramu-r opened 2 months ago

ramu-r commented 2 months ago

I tried the insertion sort demo from the python examples. The serialized array still shows up as a graph. Is there any step that I missed. image

When I click on the JSON source in the visualization viewer it shows this image

meiyoufeng116 commented 1 month ago

Hi, It seems that after a vscode update, when debugging the .py file, it does not enter PyVisualizationSupport.ts but enters GenericVisualizationSupport.ts instead. This causes the extension to continuously output Python objects in a graphical way.

I have never worked with Node.js and TypeScript before, so I can only modify this piece of code in a straightforward manner. I replaced the getVisualizationData function from PyVisualization.ts to GenericVisulizatioinSupport.ts, and then modified the expression: finalExpression at line 84 to expression: visualize("+finalExpression+"). After rebuilding the file, it seems work. Obviously, this extension can only visualize .py files in this way. I think there should be a better method.