Code Monkey home page Code Monkey logo

vscode-debug-visualizer's Introduction

VS Code Debug Visualizer

See README.md for the readme of the extension.

You can get the extension in the marketplace.

See CONTRIBUTING.md for build instructions and implementation details.

vscode-debug-visualizer's People

Contributors

almenon avatar birdie7761 avatar dantup avatar fwcd avatar hediet avatar ono-max avatar phrohdoh avatar vitalytartynov avatar yardanico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-debug-visualizer's Issues

[bug] plotly doesn't work w/ python

I get an error when trying to generate a plotly graph w/ python:

from json import dumps
import random

while(True):
    data = []
    value = 0
    for i in range(10000):
        delta = 1 if random.random() > .5 else -1
        data.append(value)
        value += delta

    json_data = dumps({
	    "kind": { "plotly": True },
	    "data": data
    })
    print('done')

I evaluated json_data in the debug visualizer console and there was just a blank screen. I opened up the webview console logs and I found this:

bootstrap:105 Uncaught (in promise) ChunkLoadError: Loading chunk 2 failed.
(error: )
    at Function.i.e (http://localhost:52480/main.js:1:724)
    at Object.loader (http://localhost:52480/main.js:35:1189248)
    at e.load (http://localhost:52480/main.js:6:12838)
    at http://localhost:52480/main.js:6:13195
    at http://localhost:52480/main.js:236:538979
    at e.fire (http://localhost:52480/main.js:1:63465)
    at e._getOrCreateMode (http://localhost:52480/main.js:236:451829)
    at e._createModeAndGetLanguageIdentifier (http://localhost:52480/main.js:236:451509)
    at t._selector (http://localhost:52480/main.js:236:451123)
    at new t (http://localhost:52480/main.js:236:449819)
bootstrap:105 Uncaught (in promise) ChunkLoadError: Loading chunk 64 failed.
(error: )
    at Function.i.e (http://localhost:52480/main.js:1:724)
    at p (http://localhost:52480/main.js:35:2001026)
    at http://localhost:52480/main.js:35:2001448
    at http://localhost:52480/main.js:236:538979
    at e.fire (http://localhost:52480/main.js:1:63465)
    at e._getOrCreateMode (http://localhost:52480/main.js:236:451829)
    at e._createModeAndGetLanguageIdentifier (http://localhost:52480/main.js:236:451509)
    at t._selector (http://localhost:52480/main.js:236:451123)
    at new t (http://localhost:52480/main.js:236:449819)
    at e.create (http://localhost:52480/main.js:236:451045)
ExpressionInput.tsx:105 json_data
factory.js:104 Error while plotting: TypeError: Cannot use 'in' operator to search for 'bardir' in 0
    at Object.n.cleanData (plotly.js:110967)
    at Object.n.plot (plotly.js:111744)
    at Object.n.newPlot (plotly.js:112273)
    at Object.n.react (plotly.js:114298)
    at factory.js:89
(anonymous) @ factory.js:104
Promise.catch (async)
value @ factory.js:99
value @ factory.js:115
yl @ react-dom.production.min.js:251
t.unstable_runWithPriority @ scheduler.production.min.js:18
Gi @ react-dom.production.min.js:120
bl @ react-dom.production.min.js:244
ol @ react-dom.production.min.js:223
(anonymous) @ react-dom.production.min.js:121
t.unstable_runWithPriority @ scheduler.production.min.js:18
Gi @ react-dom.production.min.js:120
Qi @ react-dom.production.min.js:121
Yi @ react-dom.production.min.js:120
al @ react-dom.production.min.js:224
Je @ mobx.module.js:1905
Xe @ mobx.module.js:1881
Ge @ mobx.module.js:1581
e.reportChanged @ mobx.module.js:258
t.setNewValue @ mobx.module.js:1066
e.write @ mobx.module.js:4032
set @ mobx.module.js:4239
updateState @ Model.ts:186
(anonymous) @ TypedChannelContracts.js:127
handleNotification @ TypedChannel.js:210
handleNotification @ TypedChannel.js:53
processRequestOrNotification @ StreamBasedChannel.js:54
(anonymous) @ StreamBasedChannel.js:16
onMessage @ MessageStream.js:17
e.onmessage @ index.js:34

Couldn't add anything to the "Debug Visualizer" panel

As I read the usage from the page, it said that you can add variables to the panel just like "watch" does, but it will appear visually instead of just words. However, I couldn't get myself to add anything to to it as Im debugging.
image

Custom User Defined C/C++ Application Extractors

Hi hediet! This is a really lovely tool you've made!
I'm interested in looking into and perhaps eventually making a PR for allowing users to define their own C/C++ data extractors. As a test candidate, I intended to be working off of a Visual Studio solution for the running application.
After some preliminary research, I'm looking at running a C/C++ windows application alongside the test candidate which would allow the framework for the extractor to utilize the Windows headers to extract data from memory for the target application/test candidate. A brief, but useful, mock up of how the extractor can monitor memory of another application can be found at this github repo I found. I hoping that this approach would allow the extractor to define a function or set of functions which reads the memory of their application and yields a json document which can then be sent via websocket to the webview and visualizer running in the browser.
I've set up a local environment/instance of this repository, but I'm curious if you have any guidance for providing data via websocket to the webview without using the vs-code extension.

Add a better tutorial.

I still don't know how to operate this thing. Is it usable with Promises? At what point can I use it and how? Do I need a breakpoint? Can it only output expressions or even a call stack? I'm very confused.

"Module parse failed: Unexpected character" when running `yarn build`

I was following the contributing guide.

After I run yarn, there were some warnings (listed in case it's relevant):

$ yarn                                                                                                                                                              
yarn install v1.22.4
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
warning [email protected]: The engine "vscode" appears to be invalid.
[3/4] ๐Ÿ”—  Linking dependencies...
warning "workspace-aggregator-a636d9d6-7cfd-4aff-a6f3-febd4ac43bff > @hediet/visualization > [email protected]" has unmet peer dependency "keycharm@^0.2.0".
warning "workspace-aggregator-a636d9d6-7cfd-4aff-a6f3-febd4ac43bff > @hediet/visualization > [email protected]" has unmet peer dependency "moment@^2.24.0".
warning "workspace-aggregator-a636d9d6-7cfd-4aff-a6f3-febd4ac43bff > @hediet/visualization > [email protected]" has unmet peer dependency "uuid@^3.4.0".
warning "workspace-aggregator-a636d9d6-7cfd-4aff-a6f3-febd4ac43bff > @hediet/visualization > [email protected]" has unmet peer dependency "vis-util@^3.0.0".
[4/4] ๐Ÿ”จ  Building fresh packages...
โœจ  Done in 156.06s.

Then I run yarn build, an error showed up

...lines ommited

WARNING in ../node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
 @ ../node_modules/express/lib/application.js
 @ ../node_modules/express/lib/express.js
 @ ../node_modules/express/index.js
 @ ./src/Server.ts
 @ ./src/extension.ts

WARNING in ./node_modules/ws/lib/buffer-util.js
Module not found: Error: Can't resolve 'bufferutil' in '/Users/laike9m/Dev/VSC/vscode-debug-visualizer/extension/node_modules/ws/lib'
 @ ./node_modules/ws/lib/buffer-util.js
 @ ./node_modules/ws/lib/websocket.js
 @ ./node_modules/ws/index.js
 @ ./src/Server.ts
 @ ./src/extension.ts

WARNING in ../node_modules/ws/lib/buffer-util.js
Module not found: Error: Can't resolve 'bufferutil' in '/Users/laike9m/Dev/VSC/vscode-debug-visualizer/node_modules/ws/lib'
 @ ../node_modules/ws/lib/buffer-util.js
 @ ../node_modules/ws/lib/websocket.js
 @ ../node_modules/ws/index.js
 @ ../node_modules/isomorphic-ws/node.js
 @ ../node_modules/@hediet/typed-json-rpc-websocket/dist/index.js
 @ ./src/Server.ts
 @ ./src/extension.ts

WARNING in ./node_modules/ws/lib/validation.js
Module not found: Error: Can't resolve 'utf-8-validate' in '/Users/laike9m/Dev/VSC/vscode-debug-visualizer/extension/node_modules/ws/lib'
 @ ./node_modules/ws/lib/validation.js
 @ ./node_modules/ws/lib/receiver.js
 @ ./node_modules/ws/index.js
 @ ./src/Server.ts
 @ ./src/extension.ts

WARNING in ../node_modules/ws/lib/validation.js
Module not found: Error: Can't resolve 'utf-8-validate' in '/Users/laike9m/Dev/VSC/vscode-debug-visualizer/node_modules/ws/lib'
 @ ../node_modules/ws/lib/validation.js
 @ ../node_modules/ws/lib/receiver.js
 @ ../node_modules/ws/index.js
 @ ../node_modules/isomorphic-ws/node.js
 @ ../node_modules/@hediet/typed-json-rpc-websocket/dist/index.js
 @ ./src/Server.ts
 @ ./src/extension.ts

ERROR in ../node_modules/chokidar/node_modules/fsevents/fsevents.node 1:0
Module parse failed: Unexpected character '๏ฟฝ' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
 @ ../node_modules/chokidar/node_modules/fsevents/fsevents.js 13:15-41
 @ ../node_modules/chokidar/lib/fsevents-handler.js
 @ ../node_modules/chokidar/index.js
 @ ../node_modules/@hediet/node-reload/dist/HotReloadService.js
 @ ../node_modules/@hediet/node-reload/dist/hotRequire.js
 @ ../node_modules/@hediet/node-reload/dist/index.js
 @ ./src/extension.ts
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 2
Command: /usr/local/Cellar/node/14.3.0/bin/node
Arguments: /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js build
Directory: /Users/laike9m/Dev/VSC/vscode-debug-visualizer/extension
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Did some search, seems to be related to this issue:
fsevents get error "Module parse failed: Unexpected character '๏ฟฝ' (1:0)".

Any ideas how I should proceed?

System information

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.4.0

no port given error when running yarn dev

After building everything and running yarn dev in the webview folder and going to http://localhost:8080/ the website is blank and the following error shows up in the console:

Console:

[HMR] Waiting for update signal from WDS...
main.js:204371 Download the React DevTools for a better development experience: https://fb.me/react-devtools
main.js:228924 Uncaught Error: No port given.
    at new Model (main.js:228924)
    at Object../src/index.tsx (main.js:228840)
    at __webpack_require__ (main.js:769)
    at fn (main.js:130)
    at Object.0 (main.js:229400)
    at __webpack_require__ (main.js:769)
    at main.js:907
    at main.js:910
main.js:225329 [WDS] Hot Module Replacement enabled.
main.js:225333 [WDS] Live Reloading enabled.

The error persists upon refresh

Command Line output:

C:\dev\vscode-debug-visualizer\webview>yarn dev
yarn run v1.17.3
warning package.json: No license field
$ webpack-dev-server --hot
Starting type checking service...
i ๏ฝขwds๏ฝฃ: Project is running at http://localhost:8080/
i ๏ฝขwds๏ฝฃ: webpack output is served from /
i ๏ฝขwds๏ฝฃ: Content not from webpack is served from C:\dev\vscode-debug-visualizer\webview
i ๏ฝขwdm๏ฝฃ: wait until bundle finished: /
No type errors found
Version: typescript 3.8.2
Time: 6587ms
i ๏ฝขwdm๏ฝฃ: Hash: bc2c91af7ac19c5054a7
Version: webpack 4.41.6
Time: 31720ms
Built at: 03/22/2020 3:04:09 PM
                                Asset       Size  Chunks                         Chunk Names
            0-bc2c91af7ac19c5054a7.js   9.98 KiB       0  [emitted] [immutable]
        0-bc2c91af7ac19c5054a7.js.map   12.1 KiB       0  [emitted] [dev]
 03ab771b196ad90f28a35a5aa8f5ec08.ttf   96.2 KiB          [emitted]
 053082015844707d8048e606b922cdad.ttf   98.8 KiB          [emitted]
            1-bc2c91af7ac19c5054a7.js   1.49 MiB       1  [emitted] [immutable]
        1-bc2c91af7ac19c5054a7.js.map   1.63 MiB       1  [emitted] [dev]
           10-bc2c91af7ac19c5054a7.js   8.49 KiB      10  [emitted] [immutable]
       10-bc2c91af7ac19c5054a7.js.map   10.3 KiB      10  [emitted] [dev]
           11-bc2c91af7ac19c5054a7.js   2.68 KiB      11  [emitted] [immutable]
       11-bc2c91af7ac19c5054a7.js.map   2.63 KiB      11  [emitted] [dev]
           12-bc2c91af7ac19c5054a7.js    4.2 KiB      12  [emitted] [immutable]
       12-bc2c91af7ac19c5054a7.js.map   4.63 KiB      12  [emitted] [dev]
           13-bc2c91af7ac19c5054a7.js   4.71 KiB      13  [emitted] [immutable]
       13-bc2c91af7ac19c5054a7.js.map    5.2 KiB      13  [emitted] [dev]
           14-bc2c91af7ac19c5054a7.js   18.5 KiB      14  [emitted] [immutable]
       14-bc2c91af7ac19c5054a7.js.map   23.7 KiB      14  [emitted] [dev]
           15-bc2c91af7ac19c5054a7.js   7.26 KiB      15  [emitted] [immutable]
       15-bc2c91af7ac19c5054a7.js.map   8.46 KiB      15  [emitted] [dev]
           16-bc2c91af7ac19c5054a7.js   8.28 KiB      16  [emitted] [immutable]
       16-bc2c91af7ac19c5054a7.js.map   9.72 KiB      16  [emitted] [dev]
           17-bc2c91af7ac19c5054a7.js   3.06 KiB      17  [emitted] [immutable]
       17-bc2c91af7ac19c5054a7.js.map   2.91 KiB      17  [emitted] [dev]
           18-bc2c91af7ac19c5054a7.js   7.65 KiB      18  [emitted] [immutable]
       18-bc2c91af7ac19c5054a7.js.map   9.31 KiB      18  [emitted] [dev]
           19-bc2c91af7ac19c5054a7.js    4.6 KiB      19  [emitted] [immutable]
       19-bc2c91af7ac19c5054a7.js.map   5.13 KiB      19  [emitted] [dev]
            2-bc2c91af7ac19c5054a7.js    869 KiB       2  [emitted] [immutable]
        2-bc2c91af7ac19c5054a7.js.map    956 KiB       2  [emitted] [dev]
           20-bc2c91af7ac19c5054a7.js   5.95 KiB      20  [emitted] [immutable]
       20-bc2c91af7ac19c5054a7.js.map    6.7 KiB      20  [emitted] [dev]
           21-bc2c91af7ac19c5054a7.js   6.19 KiB      21  [emitted] [immutable]
       21-bc2c91af7ac19c5054a7.js.map   7.17 KiB      21  [emitted] [dev]
           22-bc2c91af7ac19c5054a7.js   5.52 KiB      22  [emitted] [immutable]
       22-bc2c91af7ac19c5054a7.js.map   6.21 KiB      22  [emitted] [dev]
           23-bc2c91af7ac19c5054a7.js   10.2 KiB      23  [emitted] [immutable]
       23-bc2c91af7ac19c5054a7.js.map   12.1 KiB      23  [emitted] [dev]
           24-bc2c91af7ac19c5054a7.js   8.05 KiB      24  [emitted] [immutable]
       24-bc2c91af7ac19c5054a7.js.map    9.4 KiB      24  [emitted] [dev]
           25-bc2c91af7ac19c5054a7.js   3.03 KiB      25  [emitted] [immutable]
       25-bc2c91af7ac19c5054a7.js.map    3.2 KiB      25  [emitted] [dev]
           26-bc2c91af7ac19c5054a7.js   6.16 KiB      26  [emitted] [immutable]
       26-bc2c91af7ac19c5054a7.js.map   6.91 KiB      26  [emitted] [dev]
           27-bc2c91af7ac19c5054a7.js   6.59 KiB      27  [emitted] [immutable]
       27-bc2c91af7ac19c5054a7.js.map   7.42 KiB      27  [emitted] [dev]
           28-bc2c91af7ac19c5054a7.js   6.63 KiB      28  [emitted] [immutable]
       28-bc2c91af7ac19c5054a7.js.map   7.85 KiB      28  [emitted] [dev]
           29-bc2c91af7ac19c5054a7.js   4.87 KiB      29  [emitted] [immutable]
       29-bc2c91af7ac19c5054a7.js.map   5.49 KiB      29  [emitted] [dev]
            3-bc2c91af7ac19c5054a7.js    446 KiB       3  [emitted] [immutable]
        3-bc2c91af7ac19c5054a7.js.map    435 KiB       3  [emitted] [dev]
           30-bc2c91af7ac19c5054a7.js    8.2 KiB      30  [emitted] [immutable]
       30-bc2c91af7ac19c5054a7.js.map   9.48 KiB      30  [emitted] [dev]
           31-bc2c91af7ac19c5054a7.js   5.68 KiB      31  [emitted] [immutable]
       31-bc2c91af7ac19c5054a7.js.map   6.34 KiB      31  [emitted] [dev]
           32-bc2c91af7ac19c5054a7.js   7.96 KiB      32  [emitted] [immutable]
       32-bc2c91af7ac19c5054a7.js.map   8.91 KiB      32  [emitted] [dev]
           33-bc2c91af7ac19c5054a7.js   18.8 KiB      33  [emitted] [immutable]
       33-bc2c91af7ac19c5054a7.js.map   22.2 KiB      33  [emitted] [dev]
           34-bc2c91af7ac19c5054a7.js   5.51 KiB      34  [emitted] [immutable]
       34-bc2c91af7ac19c5054a7.js.map   6.44 KiB      34  [emitted] [dev]
           35-bc2c91af7ac19c5054a7.js   5.91 KiB      35  [emitted] [immutable]
       35-bc2c91af7ac19c5054a7.js.map   6.71 KiB      35  [emitted] [dev]
           36-bc2c91af7ac19c5054a7.js   4.68 KiB      36  [emitted] [immutable]
       36-bc2c91af7ac19c5054a7.js.map   5.18 KiB      36  [emitted] [dev]
           37-bc2c91af7ac19c5054a7.js   16.7 KiB      37  [emitted] [immutable]
       37-bc2c91af7ac19c5054a7.js.map   21.4 KiB      37  [emitted] [dev]
           38-bc2c91af7ac19c5054a7.js   22.4 KiB      38  [emitted] [immutable]
       38-bc2c91af7ac19c5054a7.js.map   26.3 KiB      38  [emitted] [dev]
           39-bc2c91af7ac19c5054a7.js   13.1 KiB      39  [emitted] [immutable]
       39-bc2c91af7ac19c5054a7.js.map   15.5 KiB      39  [emitted] [dev]
            4-bc2c91af7ac19c5054a7.js   1.94 MiB       4  [emitted] [immutable]
        4-bc2c91af7ac19c5054a7.js.map   2.62 MiB       4  [emitted] [dev]
           40-bc2c91af7ac19c5054a7.js   19.2 KiB      40  [emitted] [immutable]
       40-bc2c91af7ac19c5054a7.js.map     25 KiB      40  [emitted] [dev]
           41-bc2c91af7ac19c5054a7.js   26.9 KiB      41  [emitted] [immutable]
       41-bc2c91af7ac19c5054a7.js.map   34.4 KiB      41  [emitted] [dev]
           42-bc2c91af7ac19c5054a7.js   7.25 KiB      42  [emitted] [immutable]
       42-bc2c91af7ac19c5054a7.js.map   8.44 KiB      42  [emitted] [dev]
           43-bc2c91af7ac19c5054a7.js   9.92 KiB      43  [emitted] [immutable]
       43-bc2c91af7ac19c5054a7.js.map   11.8 KiB      43  [emitted] [dev]
           44-bc2c91af7ac19c5054a7.js    7.1 KiB      44  [emitted] [immutable]
       44-bc2c91af7ac19c5054a7.js.map   8.51 KiB      44  [emitted] [dev]
           45-bc2c91af7ac19c5054a7.js   6.55 KiB      45  [emitted] [immutable]
       45-bc2c91af7ac19c5054a7.js.map   7.87 KiB      45  [emitted] [dev]
           46-bc2c91af7ac19c5054a7.js   13.6 KiB      46  [emitted] [immutable]
       46-bc2c91af7ac19c5054a7.js.map     16 KiB      46  [emitted] [dev]
           47-bc2c91af7ac19c5054a7.js   6.17 KiB      47  [emitted] [immutable]
       47-bc2c91af7ac19c5054a7.js.map   7.14 KiB      47  [emitted] [dev]
           48-bc2c91af7ac19c5054a7.js   15.8 KiB      48  [emitted] [immutable]
       48-bc2c91af7ac19c5054a7.js.map   18.4 KiB      48  [emitted] [dev]
           49-bc2c91af7ac19c5054a7.js   7.01 KiB      49  [emitted] [immutable]
       49-bc2c91af7ac19c5054a7.js.map   7.88 KiB      49  [emitted] [dev]
            5-bc2c91af7ac19c5054a7.js   60.6 KiB       5  [emitted] [immutable]
        5-bc2c91af7ac19c5054a7.js.map   66.4 KiB       5  [emitted] [dev]
           50-bc2c91af7ac19c5054a7.js   18.5 KiB      50  [emitted] [immutable]
       50-bc2c91af7ac19c5054a7.js.map   22.1 KiB      50  [emitted] [dev]
           51-bc2c91af7ac19c5054a7.js   7.01 KiB      51  [emitted] [immutable]
       51-bc2c91af7ac19c5054a7.js.map   7.96 KiB      51  [emitted] [dev]
           52-bc2c91af7ac19c5054a7.js   4.27 KiB      52  [emitted] [immutable]
       52-bc2c91af7ac19c5054a7.js.map    4.6 KiB      52  [emitted] [dev]
           53-bc2c91af7ac19c5054a7.js   4.01 KiB      53  [emitted] [immutable]
       53-bc2c91af7ac19c5054a7.js.map   4.42 KiB      53  [emitted] [dev]
           54-bc2c91af7ac19c5054a7.js   10.6 KiB      54  [emitted] [immutable]
       54-bc2c91af7ac19c5054a7.js.map   13.3 KiB      54  [emitted] [dev]
           55-bc2c91af7ac19c5054a7.js   6.35 KiB      55  [emitted] [immutable]
       55-bc2c91af7ac19c5054a7.js.map   7.59 KiB      55  [emitted] [dev]
           56-bc2c91af7ac19c5054a7.js   22.7 KiB      56  [emitted] [immutable]
       56-bc2c91af7ac19c5054a7.js.map   23.6 KiB      56  [emitted] [dev]
           57-bc2c91af7ac19c5054a7.js   5.94 KiB      57  [emitted] [immutable]
       57-bc2c91af7ac19c5054a7.js.map   6.71 KiB      57  [emitted] [dev]
           58-bc2c91af7ac19c5054a7.js   31.3 KiB      58  [emitted] [immutable]
       58-bc2c91af7ac19c5054a7.js.map   39.1 KiB      58  [emitted] [dev]
           59-bc2c91af7ac19c5054a7.js   11.5 KiB      59  [emitted] [immutable]
       59-bc2c91af7ac19c5054a7.js.map   13.7 KiB      59  [emitted] [dev]
5c61819764f1fa973dda8ef77e391451.woff   98.9 KiB          [emitted]
            6-bc2c91af7ac19c5054a7.js   6.88 MiB       6  [emitted] [immutable]
        6-bc2c91af7ac19c5054a7.js.map    8.3 MiB       6  [emitted] [dev]
           60-bc2c91af7ac19c5054a7.js   7.33 KiB      60  [emitted] [immutable]
       60-bc2c91af7ac19c5054a7.js.map   8.45 KiB      60  [emitted] [dev]
           61-bc2c91af7ac19c5054a7.js   6.31 KiB      61  [emitted] [immutable]
       61-bc2c91af7ac19c5054a7.js.map   7.31 KiB      61  [emitted] [dev]
           62-bc2c91af7ac19c5054a7.js   11.7 KiB      62  [emitted] [immutable]
       62-bc2c91af7ac19c5054a7.js.map   13.9 KiB      62  [emitted] [dev]
           63-bc2c91af7ac19c5054a7.js   9.16 KiB      63  [emitted] [immutable]
       63-bc2c91af7ac19c5054a7.js.map   10.5 KiB      63  [emitted] [dev]
           64-bc2c91af7ac19c5054a7.js   9.19 KiB      64  [emitted] [immutable]
       64-bc2c91af7ac19c5054a7.js.map   10.4 KiB      64  [emitted] [dev]
           65-bc2c91af7ac19c5054a7.js   4.03 KiB      65  [emitted] [immutable]
       65-bc2c91af7ac19c5054a7.js.map   4.43 KiB      65  [emitted] [dev]
           66-bc2c91af7ac19c5054a7.js   7.39 KiB      66  [emitted] [immutable]
       66-bc2c91af7ac19c5054a7.js.map    8.8 KiB      66  [emitted] [dev]
           67-bc2c91af7ac19c5054a7.js    601 KiB      67  [emitted] [immutable]
       67-bc2c91af7ac19c5054a7.js.map    716 KiB      67  [emitted] [dev]
           68-bc2c91af7ac19c5054a7.js     11 KiB      68  [emitted] [immutable]
       68-bc2c91af7ac19c5054a7.js.map   12.8 KiB      68  [emitted] [dev]
           69-bc2c91af7ac19c5054a7.js   4.31 KiB      69  [emitted] [immutable]
       69-bc2c91af7ac19c5054a7.js.map    3.8 KiB      69  [emitted] [dev]
            7-bc2c91af7ac19c5054a7.js  695 bytes       7  [emitted] [immutable]
        7-bc2c91af7ac19c5054a7.js.map  306 bytes       7  [emitted] [dev]
           70-bc2c91af7ac19c5054a7.js   2.47 KiB      70  [emitted] [immutable]
       70-bc2c91af7ac19c5054a7.js.map   1.49 KiB      70  [emitted] [dev]
            8-bc2c91af7ac19c5054a7.js   12.2 KiB       8  [emitted] [immutable]
        8-bc2c91af7ac19c5054a7.js.map   12.6 KiB       8  [emitted] [dev]
84c180eabdd692efd197345a33735e8c.woff   96.3 KiB          [emitted]
            9-bc2c91af7ac19c5054a7.js   7.45 KiB       9  [emitted] [immutable]
        9-bc2c91af7ac19c5054a7.js.map   7.68 KiB       9  [emitted] [dev]
 9631870bf93f28bc1d7010bf55621ae8.eot   96.4 KiB          [emitted]
 a609dc0f334a7d4e64205247c4e8b97c.ttf   55.2 KiB          [emitted]
 ca7934b30a0b9829dbeb0b58a6fd0b51.eot     99 KiB          [emitted]
                     editor.worker.js    443 KiB          [emitted]
                 editor.worker.js.map    460 KiB          [emitted] [dev]
                           index.html  185 bytes          [emitted]
                              main.js   11.7 MiB    main  [emitted]              main
                          main.js.map   11.4 MiB    main  [emitted] [dev]        main
                         ts.worker.js   8.97 MiB          [emitted]
                     ts.worker.js.map   9.99 MiB          [emitted] [dev]
Entrypoint main = main.js main.js.map
[0] multi ../node_modules/webpack-dev-server/client?http://localhost:8080 ../node_modules/webpack/hot/dev-server.js ./src/index.tsx 52 bytes {main} [built]
[../node_modules/react-dom/index.js] 1.33 KiB {main} [built]
[../node_modules/react/index.js] 190 bytes {main} [built]
[../node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[../node_modules/webpack-dev-server/client/index.js?http://localhost:8080] ../node_modules/webpack-dev-server/client?http://localhost:8080 4.29 KiB {main} [built]
[../node_modules/webpack-dev-server/client/overlay.js] 3.51 KiB {main} [built]
[../node_modules/webpack-dev-server/client/socket.js] 1.53 KiB {main} [built]
[../node_modules/webpack-dev-server/client/utils/createSocketUrl.js] 2.91 KiB {main} [built]
[../node_modules/webpack-dev-server/client/utils/log.js] 964 bytes {main} [built]
[../node_modules/webpack-dev-server/client/utils/reloadApp.js] 1.59 KiB {main} [built]
[../node_modules/webpack-dev-server/client/utils/sendMessage.js] 402 bytes {main} [built]
[../node_modules/webpack/hot sync ^\.\/log$] ../node_modules/webpack/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
[../node_modules/webpack/hot/dev-server.js] 1.59 KiB {main} [built]
[../node_modules/webpack/hot/emitter.js] 75 bytes {main} [built]
[./src/index.tsx] 802 bytes {main} [built]
    + 1188 hidden modules
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [../node_modules/html-webpack-plugin/lib/loader.js!../node_modules/html-webpack-plugin/default_index.ejs] 376 bytes {0} [built]
    [../node_modules/lodash/lodash.js] 528 KiB {0} [built]
    [../node_modules/webpack/buildin/global.js] 472 bytes {0} [built]
    [../node_modules/webpack/buildin/module.js] 497 bytes {0} [built]
Child vs/editor/editor:
                   Asset     Size  Chunks                   Chunk Names
        editor.worker.js  443 KiB    main  [emitted]        main
    editor.worker.js.map  460 KiB    main  [emitted] [dev]  main
    Entrypoint main = editor.worker.js editor.worker.js.map
    [../node_modules/monaco-editor/esm/vs/base/common/arrays.js] 7.5 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/diff/diff.js] 46.7 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/errors.js] 2.97 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/iterator.js] 7.69 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js] 5.71 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/platform.js] 3.97 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/types.js] 5.53 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/uri.js] 22 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js] 11.8 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/common/core/position.js] 4.53 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/common/core/range.js] 14 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js] 21 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js] 5.13 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js] 25.8 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/editor.worker.js] 1.07 KiB {main} [built]
        + 23 hidden modules
Child vs/language/typescript/tsWorker:
               Asset      Size  Chunks                   Chunk Names
        ts.worker.js  8.97 MiB    main  [emitted]        main
    ts.worker.js.map  9.99 MiB    main  [emitted] [dev]  main
    Entrypoint main = ts.worker.js ts.worker.js.map
    [../node_modules/monaco-editor/esm/vs/base/common/arrays.js] 7.5 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/diff/diff.js] 46.7 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/errors.js] 2.97 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/iterator.js] 7.69 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js] 5.71 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/platform.js] 3.97 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/types.js] 5.53 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/uri.js] 22 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js] 11.8 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js] 25.8 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/editor/editor.worker.js] 1.07 KiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js] 1.11 MiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js] 7.41 MiB {main} [built]
    [../node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js] 665 bytes {main} [built]
    [../node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js] 8.98 KiB {main} [built]
        + 28 hidden modules
i ๏ฝขwdm๏ฝฃ: Compiled successfully.

Basic Swift Support

This extension doesnโ€™t work with Swift on Mac Mojave. Please add support for Swift. Or do I need to do something to make it work with Swift? Thank you.

Using from JS "global not defined" no matter what I try and inspect

Using debug-visualizer V2.0.6.
Breakpoint in Jest unit test.
All see is "global is not defined" no matter what variable (or const expr) I type into the expression area.

thanks

=========
Version: 1.48.2 (user setup)
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:13:11.295Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

Possible to get a vsix file

Our terminals at work are intranet only, and we don't have access to the extension marketplace. Possible to get a vsix file for installation locally?

Cheers,

Add JavaScript Demo

const {
	createGraphFromPointers
} = require("@hediet/debug-visualizer-data-extraction");

let nodeId = 0;
class Node {
	constructor(value) {
		this.id = nodeId++;
		this.value = value;
		this.next = undefined;
		this.prev = undefined;
	}

	setNext(next) {
		next.prev = this;
		this.next = next;
	}

	append(value) {
		if (this.next) {
			this.next.append(value);
		} else {
			this.setNext(new Node(value));
		}
	}
}

global.visualize = (obj = {}) => {
	return createGraphFromPointers({ first, ...obj }, item => ({
		id: item.id,
		label: item.value,
		edges: [
			{ to: item.next, label: "next" },
			{ to: item.prev, label: "prev", color: "lightgray" }
		].filter(e => !!e.to)
	}));
};

var first = new Node("1");
first.append("2");
first.append("3");
first.append("4");

What a level I have to attain to use this extension?

I'm a college student and C is the only language I mastered so far,I want to lower the difficulty to learn data structure so I googled and find this extension.
But I take several hours to find and understand tutorials and still not effect.
I can't figure out where is my lack,I think it seem to need learn typescript,java,npm and other knowledge about Web front-end development to this,since I find the demonstrate gif is only show how typescript works and I can't see how to type correct command in the extension command bar.

I want to use its extension to visualized a binary tree:

petclub.c
/* petclub.c -- use a binary search tree */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "tree.h"
#define SIZE 30

char menu(void);
void addpet(Tree * pt);
void droppet(Tree * pt);
void showpets(const Tree * pt);
void findpet(const Tree * pt);
void printitem(Item item);
void uppercase(char * str);

char* s_gets(char* st,int n)    //ๅญ—็ฌฆ่พ“ๅ…ฅๆฃ€ๆต‹ๅ‡ฝๆ•ฐ
{
    char* ret_val;
    char* find;
    ret_val=fgets(st,n,stdin);
    if(ret_val)
    {
        find = strchr(st,'\n'); //ๆŸฅๆ‰พ่พ“ๅ…ฅ็š„ๅญ—็ฌฆไธฒๅœจๅ‰nไธชๅญ—็š„่Œƒๅ›ดๅ†…ๆ˜ฏๅฆๆœ‰ๆข่กŒ็ฌฆ
        if(find)
            *find = '\0';   //่‹ฅๆœ‰ๅฐ†ๅฐพ้ƒจ็š„ๆข่กŒ็ฌฆๆ›ฟไปฃๆŽ‰
        else
            while(getchar()!='\n')  //่‹ฅๆ— ๅฐ†nๅŽ้ข็š„ๅญ—็ฌฆๅ…จ้ƒจไธขๅผƒ
                continue;       
    }
    return ret_val;
}

int main(void)
{
    Tree pets;
    char choice;

    InitializeTree(&pets);
    while ((choice = menu()) != 'q')
    {
        switch (choice)
        {
            case 'a' :  addpet(&pets);
                        break;
            case 'l' :  showpets(&pets);
                        break;
            case 'f' :  findpet(&pets);
                        break;
            case 'n' :  printf("%d pets in club\n",
                                TreeItemCount(&pets));
                        break;
            case 'd' :  droppet(&pets);
                        break;
            default  :  puts("Switching error");
        }
    }
    DeleteAll(&pets);
    puts("Bye.");
   
    return 0;
}

char menu(void)
{
    int ch;

    puts("Nerfville Pet Club Membership Program");
    puts("Enter the letter corresponding to your choice:");
    puts("a) add a pet          l) show list of pets");
    puts("n) number of pets     f) find pets");
    puts("d) delete a pet       q) quit");
    while ((ch = getchar()) != EOF)
    {
        while (getchar() != '\n')  /* discard rest of line */
            continue;
        ch = tolower(ch);
        if (strchr("alrfndq",ch) == NULL)
            puts("Please enter an a, l, f, n, d, or q:");
        else
            break;
    }
    if (ch == EOF)       /* make EOF cause program to quit */
        ch = 'q';

    return ch;
}

void addpet(Tree * pt)
{
    Item temp;

    if (TreeIsFull(pt))
        puts("No room in the club!");
    else
    {
        puts("Please enter name of pet:");
        s_gets(temp.petname,SIZE);
        puts("Please enter pet kind:");
        s_gets(temp.petkind,SIZE);
        uppercase(temp.petname);
        uppercase(temp.petkind);
        AddItem(&temp, pt);
    }
}

void showpets(const Tree * pt)
{
    if (TreeIsEmpty(pt))
        puts("No entries!");
    else
        Traverse(pt, printitem);
}

void printitem(Item item)
{
    printf("Pet: %-19s  Kind: %-19s\n", item.petname,
            item.petkind);
}

void findpet(const Tree * pt)
{
    Item temp;

    if (TreeIsEmpty(pt))
    {
        puts("No entries!");
        return;     /* quit function if tree is empty */
    }

    puts("Please enter name of pet you wish to find:");
    s_gets(temp.petname,SIZE);
    puts("Please enter pet kind:");
    s_gets(temp.petkind,SIZE);
    uppercase(temp.petname);
    uppercase(temp.petkind);
    printf("%s the %s ", temp.petname, temp.petkind);
    if (InTree(&temp, pt))
        printf("is a member.\n");
    else
        printf("is not a member.\n");
}

void droppet(Tree * pt)
{
    Item temp;

    if (TreeIsEmpty(pt))
    {
        puts("No entries!");
        return;     /* quit function if tree is empty */
    }

    puts("Please enter name of pet you wish to delete:");
    s_gets(temp.petname,SIZE);
    puts("Please enter pet kind:");
    s_gets(temp.petkind,SIZE);
    uppercase(temp.petname);
    uppercase(temp.petkind);
    printf("%s the %s ", temp.petname, temp.petkind);
    if (DeleteItem(&temp, pt))
        printf("is dropped from the club.\n");
    else
        printf("is not a member.\n");
}

void uppercase(char * str)
{
    while (*str)
    {
        *str = toupper(*str);
        str++;
    }
}
`
tree.c
`/* tree.c -- tree support functions */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "tree.h"

/* local data type */
typedef struct pair {
    Node * parent;
    Node * child;
} Pair;

/* protototypes for local functions */
static Node * MakeNode(const Item * pi);
static bool ToLeft(const Item * i1, const Item * i2);
static bool ToRight(const Item * i1, const Item * i2);
static void AddNode (Node * new_node, Node * root);
static void InOrder(const Node * root, void (* pfun)(Item item));
static Pair SeekItem(const Item * pi, const Tree * ptree);
static void DeleteNode(Node **ptr);
static void DeleteAllNodes(Node * ptr);

/* function definitions */
void InitializeTree(Tree * ptree)
{
    ptree->root = NULL;
    ptree->size = 0;
}

bool TreeIsEmpty(const Tree * ptree)
{
    if (ptree->root == NULL)
        return true;
    else
        return false;
}

bool TreeIsFull(const Tree * ptree)
{
    if (ptree->size == MAXITEMS)
        return true;
    else
        return false;
}

int TreeItemCount(const Tree * ptree)
{
    return ptree->size;
}

bool AddItem(const Item * pi, Tree * ptree)
{
    Node * new_node;

    if  (TreeIsFull(ptree))
    {
        fprintf(stderr,"Tree is full\n");
        return false;             /* early return           */
    }
    if (SeekItem(pi, ptree).child != NULL)
    {
        fprintf(stderr, "Attempted to add duplicate item\n");
        return false;             /* early return           */
    }
    new_node = MakeNode(pi);      /* points to new node     */
    if (new_node == NULL)
    {
        fprintf(stderr, "Couldn't create node\n");
        return false;             /* early return           */
    }
    /* succeeded in creating a new node */
    ptree->size++;

    if (ptree->root == NULL)      /* case 1: tree is empty  */
        ptree->root = new_node;   /* new node is tree root  */
    else                          /* case 2: not empty      */
        AddNode(new_node,ptree->root); /* add node to tree  */
   
    return true;                  /* successful return      */
}

bool InTree(const Item * pi, const Tree * ptree)
{
    return (SeekItem(pi, ptree).child == NULL) ? false : true;
}

bool DeleteItem(const Item * pi, Tree * ptree)
{
    Pair look;
    
    look = SeekItem(pi, ptree);
    if (look.child == NULL)
        return false;
 
    if (look.parent == NULL)      /* delete root item       */
        DeleteNode(&ptree->root);
    else if (look.parent->left == look.child)
        DeleteNode(&look.parent->left);
    else
        DeleteNode(&look.parent->right);
    ptree->size--;

    return true;
}

void Traverse (const Tree * ptree, void (* pfun)(Item item))
{

    if (ptree != NULL)
        InOrder(ptree->root, pfun);
}

void DeleteAll(Tree * ptree)
{
    if (ptree != NULL)
        DeleteAllNodes(ptree->root);
    ptree->root = NULL;
    ptree->size = 0;
}


/* local functions */
static void InOrder(const Node * root, void (* pfun)(Item item))
{
    if (root != NULL)
    {
        InOrder(root->left, pfun);
        (*pfun)(root->item);
        InOrder(root->right, pfun);
    }
}

static void DeleteAllNodes(Node * root)
{
    Node * pright;

    if (root != NULL)
    {
        pright = root->right;
        DeleteAllNodes(root->left);
        free(root);
        DeleteAllNodes(pright);
    }
}

static void AddNode (Node * new_node, Node * root)
{
    if (ToLeft(&new_node->item, &root->item))
    {
        if (root->left == NULL)      /* empty subtree       */
            root->left = new_node;   /* so add node here    */
        else
            AddNode(new_node, root->left);/* else process subtree*/
    }
    else if (ToRight(&new_node->item, &root->item))
    {
        if (root->right == NULL)
            root->right = new_node;
        else
            AddNode(new_node, root->right);
    }
    else                         /* should be no duplicates */
    {
        fprintf(stderr,"location error in AddNode()\n");
        exit(1);
    }
}

static bool ToLeft(const Item * i1, const Item * i2)
{
    int comp1;

    if ((comp1 = strcmp(i1->petname, i2->petname)) < 0)
        return true;
    else if (comp1 == 0 &&
                strcmp(i1->petkind, i2->petkind) < 0 )
        return true;
    else
        return false;
}

static bool ToRight(const Item * i1, const Item * i2)
{
    int comp1;

    if ((comp1 = strcmp(i1->petname, i2->petname)) > 0)
        return true;
    else if (comp1 == 0 &&
                strcmp(i1->petkind, i2->petkind) > 0 )
        return true;
    else
        return false;
}

static Node * MakeNode(const Item * pi)
{
    Node * new_node;

    new_node = (Node *) malloc(sizeof(Node));
    if (new_node != NULL)
    {
        new_node->item = *pi;
        new_node->left = NULL;
        new_node->right = NULL;
    }
    
    return new_node;
}

static Pair SeekItem(const Item * pi, const Tree * ptree)
{
    Pair look;
    look.parent = NULL;
    look.child = ptree->root;

    if (look.child == NULL)
        return look;                        /* early return   */
 
    while (look.child != NULL)
    {
        if (ToLeft(pi, &(look.child->item)))
        {
            look.parent = look.child;
            look.child = look.child->left;
        }
        else if (ToRight(pi, &(look.child->item)))
        {
            look.parent = look.child;
            look.child = look.child->right;
        }
        else       /* must be same if not to left or right    */
            break; /* look.child is address of node with item */
    }
 
    return look;                       /* successful return   */
}

static void DeleteNode(Node **ptr)
/* ptr is address of parent member pointing to target node  */
{
    Node * temp;

    puts((*ptr)->item.petname);
    if ( (*ptr)->left == NULL)
    {
        temp = *ptr;
        *ptr = (*ptr)->right;
        free(temp);
    }
    else if ( (*ptr)->right == NULL)
    {
        temp = *ptr;
        *ptr = (*ptr)->left;
        free(temp);
    }
    else    /* deleted node has two children */
    {
        /* find where to reattach right subtree */
        for (temp = (*ptr)->left; temp->right != NULL;
                temp = temp->right)
            continue;
        temp->right = (*ptr)->right;
        temp = *ptr;
        *ptr =(*ptr)->left;
        free(temp);
    }
}

`

tree.h
`/* tree.h -- binary search tree                          */
/*           no duplicate items are allowed in this tree */
#ifndef _TREE_H_
#define _TREE_H_
#include <stdbool.h>

/* redefine Item as appropriate */
typedef struct item
{
    char petname[20];
    char petkind[20];
} Item;

#define MAXITEMS 10

typedef struct node
{
    Item item;
    struct node * left;    /* pointer to right branch  */
    struct node * right;   /* pointer to left branch   */
} Node;

typedef struct tree
{
    Node * root;           /* pointer to root of tree  */
    int size;              /* number of items in tree  */
}Tree;

/* function prototypes */

/* operation:      initialize a tree to empty          */
/* preconditions:  ptree points to a tree              */
/* postconditions: the tree is initialized to empty    */
void InitializeTree(Tree * ptree);

/* operation:      determine if tree is empty          */
/* preconditions:  ptree points to a tree              */
/* postconditions: function returns true if tree is    */
/*                 empty and returns false otherwise   */
bool TreeIsEmpty(const Tree * ptree);

/* operation:      determine if tree is full           */
/* preconditions:  ptree points to a tree              */
/* postconditions: function returns true if tree is    */
/*                 full and returns false otherwise    */
bool TreeIsFull(const Tree * ptree);

/* operation:      determine number of items in tree   */
/* preconditions:  ptree points to a tree              */
/* postconditions: function returns number of items in */
/*                 tree                                */
int TreeItemCount(const Tree * ptree);

/* operation:      add an item to a tree               */
/* preconditions:  pi is address of item to be added   */
/*                 ptree points to an initialized tree */
/* postconditions: if possible, function adds item to  */
/*                 tree and returns true; otherwise,    */
/*                 the function returns false          */
bool AddItem(const Item * pi, Tree * ptree);

/* operation:  find an item in a tree              */
/* preconditions:  pi points to an item                */
/*                 ptree points to an initialized tree */
/* postconditions: function returns true if item is in */
/*                 tree and returns false otherwise    */
bool InTree(const Item * pi, const Tree * ptree);

/* operation:      delete an item from a tree          */
/* preconditions:  pi is address of item to be deleted */
/*                 ptree points to an initialized tree */
/* postconditions: if possible, function deletes item  */
/*                 from tree and returns true;         */
/*                 otherwise, the function returns false*/
bool DeleteItem(const Item * pi, Tree * ptree);

/* operation:      apply a function to each item in    */
/*                 the tree                            */
/* preconditions:  ptree points to a tree              */
/*                 pfun points to a function that takes*/
/*                 an Item argument and has no return  */
/*                 value                               */
/* postcondition:  the function pointed to by pfun is  */
/*                 executed once for each item in tree */
void Traverse (const Tree * ptree, void (* pfun)(Item item));

/* operation:      delete everything from a tree       */
/* preconditions:  ptree points to an initialized tree */
/* postconditions: tree is empty                       */
void DeleteAll(Tree * ptree);

#endif

what do I need to do to add full python/Language X support?

hey, noob here. I've never actually contributed to a repo that wasn't mine.

I wanted to contribute to this project, and start adding full support for other languages(python, java, rust, cpp). I saw that data extractors are necessary to convert the data to a serialized json format.

Are those visualizers supposed to be in that given language or in javascript?
Also, I want to get familiar with the project structure. What would you consider the entry point to be? how does the flow of execution generally look?

Problems with viewing data in the cpp demo

hey. I was trying to use the cpp Demo but while debuging I can't see the data in the Debug-Visualizer
window.
I tried to give as an input the myGraphJson string variable but the debbuger is not able to parse it.
Im not sure if it is a bug or that i'm not understanding how to use the debbuger.
thanks a lot ,Yotam!

image

Allow setting of plotly layout

We are using the plotly visualiser to graph test cases in our software. It is a great tool for this but there are a couple of limitations due to only being able to set the individual plot data and not being able to set the plot layout options. Specifically it would be useful to set:

  • Plot title - in our case the test case name.
  • Axes properties - titles and ranges.

This could be achieved by propagating up the plotly layout object. Currently it is empty (https://github.com/hediet/vscode-debug-visualizer/blob/master/visualization/src/visualizers/plotly/PlotlyViewer.tsx):

			<Plot
				style={{ width: "100%" }}
				data={this.props.data}
				layout={{}}
				config={{ responsive: true }}
			/>

[dev enhancement] unit tests

I don't see any unit tests yet. What's your preferred framework? Jest?
If I try to make a PR I'll probably start off with writing some tests.

[bug] npm install for data-extraction doesn't work

When I cd into data-extraction and run npm i I get the following error:

C:\dev\vscode-debug-visualizer\data-extraction>npm i
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "^[object Object]": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\almenon\AppData\Roaming\npm-cache\_logs\2020-02-24T05_47_11_520Z-debug.log

Then I tried yarn, which worked. (although it asked me to manually select the version of @types/d3)

The yarn.lock file has the following:

"@types/d3@^[object Object]":
  version "5.7.2"
  resolved "https://registry.yarnpkg.com/@types/d3/-/d3-5.7.2.tgz#52235eb71a1d3ca171d6dca52a58f5ccbe0254cc"
  integrity sha512-7/wClB8ycneWGy3jdvLfXKTd5SoTg9hji7IdJ0RuO9xTY54YpJ8zlcFADcXhY1J3kCBwxp+/1jeN6a5OMwgYOw==
  dependencies:
    "@types/d3-array" "^1"
    "@types/d3-axis" "*"
    "@types/d3-brush" "*"
    "@types/d3-chord" "*"
    "@types/d3-collection" "*"
    "@types/d3-color" "*"
    "@types/d3-contour" "*"
    "@types/d3-dispatch" "*"
    "@types/d3-drag" "*"
    "@types/d3-dsv" "*"
    "@types/d3-ease" "*"
    "@types/d3-fetch" "*"
    "@types/d3-force" "*"
    "@types/d3-format" "*"
    "@types/d3-geo" "*"
    "@types/d3-hierarchy" "*"
    "@types/d3-interpolate" "*"
    "@types/d3-path" "*"
    "@types/d3-polygon" "*"
    "@types/d3-quadtree" "*"
    "@types/d3-random" "*"
    "@types/d3-scale" "*"
    "@types/d3-scale-chromatic" "*"
    "@types/d3-selection" "*"
    "@types/d3-shape" "*"
    "@types/d3-time" "*"
    "@types/d3-time-format" "*"
    "@types/d3-timer" "*"
    "@types/d3-transition" "*"
    "@types/d3-voronoi" "*"
    "@types/d3-zoom" "*"

I still see object object in the lock file with yarn so I'm guessing that yarn runs into the same issue, it just doesn't warn you about it like npm. I'm not sure what's causing the object object thing :(

Can you commit your yarn.lock file please? Maybe that will help.

Build instructions?

Would you mind documenting how to build and run this extension in the debugger?
Also, it seems to expect globally installed tsc and webpack, not sure what else...

Issue plotting large dataset from Python

This is a great extension! I was considering starting to work on something similar when I found this.
I was hoping to plot some rather large datasets using the plotly visualizer, but ran into an issue.

Plotting with 10k points looks OK:

plot_json = json.dumps({
    "kind": {"plotly": True},
    "data": [
        {"y": np.arange(10000).tolist()},
    ],
})

But it breaks at 10944 points:

plot_json = json.dumps({
    "kind": {"plotly": True},
    "data": [
        {"y": np.arange(10944).tolist()},
    ],
})

The error I get in the Debug Visualizer pane is (truncated):

Could not parse evaluation result as JSON:

Unexpected token ' in JSON at position 0

Evaluation result was:
'{"kind": {"plotly": true}, "data": [{"y": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
 ...
 10939, 10940, 10941, 10942, 10943]}]}'

Used debug adapter: python

For reference I would like to plot ~millions of points. I know plotly is capable of this (if a bit slow at times), and I have done it by serializing to JSON and sending to a basic web server before.

Thanks!

Add support for Rust

Can this awesome plugin support Rust?

Rust has std::fmt::Debug which may be helpful to the implementation.

Supporting non-JS debuggers

There's probably no general solution for turning data structures into JSON, however most debuggers support some kind of scripting, which could be used to bridge the gap. If you made the expression that gets sent to the debugger configurable, developers would be able to provide the requisite glue code.
Let's say you supported a config setting similar to this:

"debugVisualizer.evalTemplates": {
    "<debugger-type>": { // DebugConfiguration::type
        "expression": "<some string with a placeholder>",
        "context": "<watch or repl>" 
    }
}

If someone wanted to use this extension with C++ in LLDB, they'd need to write a function, using LLDB's Python scripting, that can convert C++ objects to JSON , then tell Debug Visualizer how to use it:

"debugVisualizer.evalTemplates": {
    "lldb": {
        "expression": "script to_json(\"${var}\")",
        "context": "repl"
    }
}

Support Data Extractions for Python

Currently, when visualizing python expressions, they need to evaluate to a specific json string.
Data Extractions as implemented in JavaScript lift that requirement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.