Showing preview only (625K chars total). Download the full file or copy to clipboard to get everything.
Repository: hediet/vscode-debug-visualizer
Branch: master
Commit: 96c26e5388ed
Files: 182
Total size: 578.3 KB
Directory structure:
gitextract_mf4tfga_/
├── .github/
│ ├── FUNDING.yml
│ └── workflows/
│ ├── ci.yml
│ └── opened-issues-triage.yml
├── .gitignore
├── .prettierrc.json
├── .vscode/
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── data-extraction/
│ ├── CHANGELOG.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── CommonDataTypes.ts
│ │ ├── DataExtractionResult.ts
│ │ ├── getGlobal.ts
│ │ ├── index.ts
│ │ ├── js/
│ │ │ ├── api/
│ │ │ │ ├── DataExtractorApi.ts
│ │ │ │ ├── DataExtractorApiImpl.ts
│ │ │ │ ├── LoadDataExtractorsFn.ts
│ │ │ │ ├── default-extractors/
│ │ │ │ │ ├── AsIsDataExtractor.ts
│ │ │ │ │ ├── GetDebugVisualizationDataExtractor.ts
│ │ │ │ │ ├── GridExtractor.ts
│ │ │ │ │ ├── MarkedGridExtractor.ts
│ │ │ │ │ ├── ObjectGraphExtractor.ts
│ │ │ │ │ ├── PlotlyDataExtractor.ts
│ │ │ │ │ ├── StringDiffExtractor.ts
│ │ │ │ │ ├── StringRangeExtractor.ts
│ │ │ │ │ ├── TableExtractor.ts
│ │ │ │ │ ├── ToStringExtractor.ts
│ │ │ │ │ ├── TypeScriptDataExtractors.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── registerDefaultDataExtractors.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── injection.ts
│ │ │ ├── global-helpers.ts
│ │ │ ├── helpers/
│ │ │ │ ├── asData.ts
│ │ │ │ ├── cache.ts
│ │ │ │ ├── createGraph.ts
│ │ │ │ ├── createGraphFromPointers.ts
│ │ │ │ ├── find.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── markedGrid.ts
│ │ │ │ └── tryEval.ts
│ │ │ └── index.ts
│ │ └── util.ts
│ ├── test/
│ │ ├── main.test.ts
│ │ └── tsconfig.json
│ ├── tsconfig.json
│ └── webpack.config.ts
├── demos/
│ ├── cpp/
│ │ ├── .gitignore
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── tasks.json
│ │ └── main.cpp
│ ├── csharp/
│ │ ├── .gitignore
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ ├── settings.json
│ │ │ └── tasks.json
│ │ ├── ExtractedData.cs
│ │ ├── Program.cs
│ │ └── demo.csproj
│ ├── dart/
│ │ ├── debug_visualizers.dart
│ │ └── demo.dart
│ ├── golang/
│ │ ├── .vscode/
│ │ │ └── launch.json
│ │ ├── demo.go
│ │ └── go.mod
│ ├── java/
│ │ ├── .classpath
│ │ ├── .gitignore
│ │ ├── .project
│ │ ├── .settings/
│ │ │ └── org.eclipse.jdt.core.prefs
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── settings.json
│ │ └── src/
│ │ └── app/
│ │ ├── App.java
│ │ ├── ExtractedData.java
│ │ ├── GraphData.java
│ │ └── TextData.java
│ ├── js/
│ │ ├── .vscode/
│ │ │ ├── settings.json
│ │ │ └── tasks.json
│ │ ├── README.md
│ │ ├── custom-visualizer.js
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── MockLanguageServiceHost.ts
│ │ │ ├── demo_address_book.ts
│ │ │ ├── demo_custom-data-extractor.ts
│ │ │ ├── demo_doubly-linked-list.ts
│ │ │ ├── demo_fetch.js
│ │ │ ├── demo_random-walks.ts
│ │ │ ├── demo_singly-linked-list.js
│ │ │ ├── demo_sorting.ts
│ │ │ ├── demo_stack-frames.js
│ │ │ ├── demo_typescript-asts.ts
│ │ │ └── playground.ts
│ │ └── tsconfig.json
│ ├── nim/
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── tasks.json
│ │ ├── LICENSE
│ │ ├── main.nim
│ │ └── nim.cfg
│ ├── php/
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── settings.json
│ │ └── demo.php
│ ├── python/
│ │ ├── .vscode/
│ │ │ └── launch.json
│ │ ├── Person.py
│ │ ├── debugvisualizer.py
│ │ ├── demo.py
│ │ ├── graph.py
│ │ └── insertion_sort.py
│ ├── ruby/
│ │ ├── README.md
│ │ └── src/
│ │ ├── demo_custom_visualizer.rb
│ │ └── demo_random_walks.rb
│ ├── rust/
│ │ ├── .gitignore
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── settings.json
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── main.rs
│ └── swift/
│ ├── .gitignore
│ ├── .vscode/
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── Package.swift
│ ├── Sources/
│ │ └── swiftDemo/
│ │ └── main.swift
│ ├── Tests/
│ │ ├── LinuxMain.swift
│ │ └── swiftDemoTests/
│ │ ├── XCTestManifests.swift
│ │ └── swiftDemoTests.swift
│ └── main.swift
├── docs/
│ └── main.plantuml
├── extension/
│ ├── .vscodeignore
│ ├── CHANGELOG.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── Config.ts
│ │ ├── VisualizationBackend/
│ │ │ ├── ComposedVisualizationSupport.ts
│ │ │ ├── ConfigurableVisualizationSupport.ts
│ │ │ ├── DispatchingVisualizationBackend.ts
│ │ │ ├── GenericVisualizationSupport.ts
│ │ │ ├── JsVisualizationSupport.ts
│ │ │ ├── PyVisualizationSupport.ts
│ │ │ ├── RbVisualizationSupport.ts
│ │ │ ├── VisualizationBackend.ts
│ │ │ ├── index.ts
│ │ │ └── parseEvaluationResultFromGenericDebugAdapter.ts
│ │ ├── VisualizationWatchModel/
│ │ │ ├── VisualizationWatchModel.ts
│ │ │ ├── VisualizationWatchModelImpl.ts
│ │ │ └── index.ts
│ │ ├── extension.ts
│ │ ├── proxies/
│ │ │ ├── DebugSessionProxy.ts
│ │ │ ├── DebuggerProxy.ts
│ │ │ └── DebuggerViewProxy.ts
│ │ ├── types.d.ts
│ │ ├── utils/
│ │ │ ├── DebouncedRunner.ts
│ │ │ ├── IncrementalMap.ts
│ │ │ └── VsCodeSettings.ts
│ │ ├── webview/
│ │ │ ├── InternalWebviewManager.ts
│ │ │ ├── WebviewConnection.ts
│ │ │ └── WebviewServer.ts
│ │ └── webviewContract.ts
│ ├── tsconfig.json
│ └── webpack.config.ts
├── package.json
├── tslint.json
└── webview/
├── index.js
├── package.json
├── src/
│ ├── components/
│ │ ├── App.tsx
│ │ ├── ExpressionInput.tsx
│ │ ├── GUI.tsx
│ │ ├── NoData.tsx
│ │ ├── Visualizer.tsx
│ │ └── VisualizerHeaderDetails.tsx
│ ├── hotComponent.tsx
│ ├── index.tsx
│ ├── model/
│ │ ├── Model.ts
│ │ ├── MonacoBridge.ts
│ │ ├── VsCodeApi.ts
│ │ └── lib.es5.d.ts.txt
│ ├── style.scss
│ ├── vscode-dark.scss
│ └── vscode-light.scss
├── tsconfig.json
└── webpack.config.ts
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
github: hediet
================================================
FILE: .github/workflows/ci.yml
================================================
on:
push:
branches:
- master
pull_request:
jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 20.x
- run: yarn install
- run: yarn build
================================================
FILE: .github/workflows/opened-issues-triage.yml
================================================
name: Move new issues into Triage
on:
issues:
types: [opened]
jobs:
automate-project-columns:
runs-on: ubuntu-latest
steps:
- uses: alex-page/github-project-automation-plus@v0.2.3
with:
project: Backlog
column: Triage
repo-token: ${{ secrets.GH_TOKEN }}
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
dist/
out/
# Python byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.vsix
================================================
FILE: .prettierrc.json
================================================
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"useTabs": true,
"printWidth": 120
}
================================================
FILE: .vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:8090",
"webRoot": "${workspaceFolder}/visualization-playground"
},
{
"name": "Run Extension (Hot Reload)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/extension",
"${workspaceFolder}/demos/php"
],
"env": {
"HOT_RELOAD": "true",
"USE_DEV_UI": ""
},
"outFiles": ["${workspaceFolder}/extension/dist/**/*.js"],
"preLaunchTask": "npm: dev - extension"
},
{
"name": "Run Extension (Hot Reload + Dev UI)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/extension",
"${workspaceFolder}/demos/php"
],
"env": {
"HOT_RELOAD": "true",
"USE_DEV_UI": "true"
},
"outFiles": ["${workspaceFolder}/extension/dist/**/*.js"],
"preLaunchTask": "npm: dev - extension"
},
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/extension",
"${workspaceFolder}/demos/js"
],
"env": {
"HOT_RELOAD": "",
"USE_DEV_UI": ""
},
"outFiles": ["${workspaceFolder}/extension/dist/**/*.js"]
},
{
"name": "Run Extension (Dev UI)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/extension",
"${workspaceFolder}/demos/js"
],
"env": {
"HOT_RELOAD": "",
"USE_DEV_UI": "true"
},
"outFiles": ["${workspaceFolder}/extension/dist/**/*.js"],
"preLaunchTask": "npm: dev - extension"
},
{
"type": "dart",
"request": "launch",
"name": "Run Dart samples",
"program": "demos/dart/demo.dart"
}
]
}
================================================
FILE: .vscode/settings.json
================================================
{
"search.exclude": {
"extension/out": true
},
"plantuml.diagramsRoot": "docs",
"plantuml.exportFormat": "png",
"plantuml.exportOutDir": "docs/exported",
"typescript.updateImportsOnFileMove.enabled": "prompt",
"mochaExplorer.files": "./data-extraction/test/**/*.test.ts",
"mochaExplorer.require": ["ts-node/register", "source-map-support/register"],
"tasksStatusbar.taskLabelFilter": "dev",
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules\\typescript\\lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.prettierPath": "node_modules/prettier",
"prettier.printWidth": 120,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
================================================
FILE: .vscode/tasks.json
================================================
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"label": "npm: dev - extension",
"script": "dev",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"path": "extension/",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
This document extends the [readme](./extension/README.md) of the extension with implementation details.
## Build Instructions
- Clone the repository
- Run `yarn` in the repository root
- Run `yarn build`
## Dev Instructions
This project uses yarn workspaces and consists of the sub-projects _data-extraction_, _extension_ and _webview_.
To setup a dev environment, follow these steps:
- Clone the repository
- Run `yarn` in the repository root
- Run `yarn build` initially (or `yarn dev` for every sub-project)
- Run `yarn dev` for the sub-project (i.e. in its folder) you are working on.
For the _webview_ project, `yarn dev` will serve the react application on port 8080.
Certain query parameters need to be set, so that the UI can connect to the debug visualizer extension.
You can use VS Code to launch and debug the extension.
Choose the preconfigured `Run Extension (Dev UI)` as debug configuration
so that the extension loads the UI from the webpack server.
Otherwise, the extension will start a webserver on its own, hosting the `dist` folder of the _webview_ project.
## Publish Instructions
- Follow the Build Instructions
- `cd extension`
- `yarn pub`
## Architecture

### webview
Implements the UI and is hosted inside a webview in VS Code.
Can be opened in a browser window.
Uses websockets and JSON RPC to communicate with the extension.
### hediet/visualization
Contains all the visualizers and visualization infrastructure.
This external project can be found [here](https://github.com/hediet/visualization).
### extension
Creates the webview in VS Code, hosts a webserver and a websocket server.
The webserver serves the _webview_ project that is loaded by the webview.
If started with the `Run Extension (Dev UI)` debug configuration, it will load
the page from `http://localhost:8080` rather than from its own http server.
The webview is served from an http server rather than the file system to work around some security mechanisms,
which would prevent lazy chunk loading or websockets.
After the webview is loaded, it connects to the websocket server.
The websocket server is used to evaluate expressions and is secured by a random token.
### data-extraction
Provides types and a JS runtime for data extraction.
================================================
FILE: LICENSE.md
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and`show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
# VS Code Debug Visualizer
[](https://github.com/sponsors/hediet)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZP5F38L4C88UY&source=url)
[](https://twitter.com/intent/follow?screen_name=hediet_dev)
See [README.md](./extension/README.md) for the readme of the extension.
You can get the extension in the [marketplace](https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer).
See [CONTRIBUTING.md](./CONTRIBUTING.md) for build instructions and implementation details.

================================================
FILE: data-extraction/CHANGELOG.md
================================================
# Change Log
## 0.11.0
- Object Graph Data Extractor
- Plotly Data Extractor
- Some Bugfixes
================================================
FILE: data-extraction/LICENSE.md
================================================
MIT License
Copyright (c) 2020 Henning Dieterichs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: data-extraction/README.md
================================================
# @hediet/debug-visualizer-data-extraction
[](https://twitter.com/intent/follow?screen_name=hediet_dev)
A library that helps implementing data extractors for the Debug Visualizer VS Code extension.
It will automatically be injected by the extension when the debugger attaches.
Compatible with NodeJS and browsers.
# Installation
Use the following command to install the library using yarn:
```
yarn add @hediet/debug-visualizer-data-extraction
```
# Usage
## `createGraphFromPointers` Helper
```ts
import { createGraphFromPointers } from "@hediet/debug-visualizer-data-extraction";
setTimeout(() => {
new Main().run();
}, 0);
class Main {
run() {
const list = new DoublyLinkedList("1");
list.setNext(new DoublyLinkedList("2"));
list.next!.setNext(new DoublyLinkedList("3"));
list.next!.next!.setNext(new DoublyLinkedList("4"));
// Watch `visualize()` with the Debug Visualizer Extension for VS Code!
const visualize = () =>
// Returns `CommonDataTypes.Graph` data which can be visualized by
// either the vis.js or the graphviz visualizer.
createGraphFromPointers({ list, last, cur }, i => ({
id: i.id,
label: i.name,
color: finished.has(i) ? "lime" : undefined,
edges: [
{ to: i.next!, label: "next" },
{ to: i.prev!, label: "prev", color: "lightgray" },
].filter(r => !!r.to),
}));
const finished = new Set();
var cur: DoublyLinkedList | undefined = list;
// Reverses `list`. Finished nodes have correct pointers,
// their next node is also finished.
var last: DoublyLinkedList | undefined = undefined;
while (cur) {
cur.prev = cur.next;
cur.next = last;
finished.add(cur);
last = cur;
cur = cur.prev;
}
console.log("finished");
}
}
let id = 0;
class DoublyLinkedList {
public readonly id = (id++).toString();
constructor(public name: string) {}
next: DoublyLinkedList | undefined;
prev: DoublyLinkedList | undefined;
public setNext(val: DoublyLinkedList): void {
val.prev = this;
this.next = val;
}
}
```

## Registering Custom Data Extractors
```ts
import { getDataExtractorApi } from "@hediet/debug-visualizer-data-extraction";
getDataExtractorApi().registerExtractor({
id: "my-foo-extractor",
getExtractions: (data, collector) => {
if (data instanceof Foo) {
collector.addExtraction({
id: "my-foo-extraction",
name: "My Foo Extraction",
priority: 2000,
extractData: () => ({ kind: { text: true }, text: "Foo" }),
});
}
},
});
setTimeout(() => {
new Main().run();
}, 0);
class Foo {}
class Main {
run() {
const f = new Foo();
// if `f` is watched by the Debug Visualizer,
// `my-foo-extractor` will provide the data for the visualizers.
// See `CommonDataTypes` for data types that have built in visualizers.
debugger;
}
}
```
================================================
FILE: data-extraction/package.json
================================================
{
"name": "@hediet/debug-visualizer-data-extraction",
"description": "A library that helps implementing data extractors for the Debug Visualizer VS Code extension.",
"version": "0.14.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"author": {
"name": "Henning Dieterichs",
"email": "henning.dieterichs@live.de"
},
"repository": {
"type": "git",
"url": "https://github.com/hediet/vscode-debug-visualizer.git"
},
"license": "MIT",
"files": [
"dist",
"src"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"dev": "webpack --watch --mode development",
"build": "webpack --mode production",
"test": "mocha --require source-map-support/register --require ts-node/register ./test/**/*.test.ts"
},
"dependencies": {},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
"@types/copy-webpack-plugin": "^10.1.0",
"@types/mocha": "^7.0.2",
"@types/node": "^13.7.4",
"@types/plotly.js": "1.44.28",
"coveralls": "^3.0.11",
"mocha": "^7.1.1",
"mocha-lcov-reporter": "^1.3.0",
"nyc": "^15.0.0",
"source-map-support": "^0.5.16",
"tslint": "^6.1.3",
"typescript": "^5.1.6",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1"
}
}
================================================
FILE: data-extraction/src/CommonDataTypes.ts
================================================
// This file was created automatically. Do not edit it manually!
export type KnownVisualizationData =
| TreeVisualizationData
| AstTreeVisualizationData
| GraphvizDotVisualizationData
| GraphVisualizationData
| GraphVisualizationData
| GridVisualizationData
| ImageVisualizationData
| MonacoTextVisualizationData
| MonacoTextDiffVisualizationData
| TableVisualizationData
| PlotlyVisualizationData
| SimpleTextVisualizationData
| SvgVisualizationData;
export type TreeVisualizationData = {
kind: {
tree: true;
};
root: TreeNode;
};
export type TreeNode = {
/**
* The children of this tree-node
*/
children: TreeNode[];
/**
* The parts that make up the text of this item
*/
items: TreeNodeItem[];
/**
* If a node is selected, the concatenation of all segment values from root to the selected node is shown to the user.
*/
segment?: string;
/**
* Marked nodes are highlighted and scrolled into view on every visualization update.
*/
isMarked?: boolean;
};
export type TreeNodeItem = {
/**
* The text to show
*/
text: string;
/**
* The style of the text
*/
emphasis?: "style1" | "style2" | "style3" | string;
};
export type AstTreeVisualizationData = {
kind: {
ast: true;
tree: true;
text: true;
};
root: AstTreeNode;
text: string;
fileName?: string;
};
export type AstTreeNode = {
children: AstTreeNode[];
items: AstTreeNodeItem[];
segment?: string;
isMarked?: boolean;
span: {
start: number;
length: number;
};
};
export type AstTreeNodeItem = {
text: string;
emphasis?: "style1" | "style2" | "style3" | string;
};
export type GraphvizDotVisualizationData = {
kind: {
dotGraph: true;
};
text: string;
};
export type GraphVisualizationData = {
kind: {
graph: true;
};
nodes: GraphNode[];
edges: GraphEdge[];
};
export type GraphNode = {
id: string;
label?: string;
color?: string;
shape?: "ellipse" | "box";
};
export type GraphEdge = {
from: string;
to: string;
label?: string;
id?: string;
color?: string;
style?: "solid" | "dashed" | "dotted";
};
export type GridVisualizationData = {
kind: {
grid: true;
};
columnLabels?: {
label?: string;
}[];
rows: {
label?: string;
columns: {
content?: string;
/**
* A value to identify this cell. Should be unique.
*/
tag?: string;
color?: string;
}[];
}[];
markers?: {
id: string;
row: number;
column: number;
rows?: number;
columns?: number;
label?: string;
color?: string;
}[];
};
export type ImageVisualizationData = {
kind: {
imagePng: true;
};
/**
* The base 64 encoded PNG representation of the image
*/
base64Data: string;
};
export type MonacoTextVisualizationData = {
kind: {
text: true;
};
/**
* The text to show
*/
text: string;
decorations?: {
range: LineColumnRange;
label?: string;
}[];
/**
* An optional filename that might be used for chosing a syntax highlighter
*/
fileName?: string;
};
export type LineColumnRange = {
/**
* The start position
*/
start: LineColumnPosition;
/**
* The end position
*/
end: LineColumnPosition;
};
export type LineColumnPosition = {
/**
* The 0-based line number
*/
line: number;
/**
* The 0-based column number
*/
column: number;
};
export type MonacoTextDiffVisualizationData = {
kind: {
text: true;
};
/**
* The text to show
*/
text: string;
/**
* The text to compare against
*/
otherText: string;
/**
* An optional filename that might be used for chosing a syntax highlighter
*/
fileName?: string;
};
export type TableVisualizationData = {
kind: {
table: true;
};
/**
* An array of objects. The properties of the objects are used as columns.
*/
rows: {}[];
};
export type PlotlyVisualizationData = {
kind: {
plotly: true;
};
/**
* Expecting Plotly.Data[] (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/795ce172038dbafcb9cba030d637d733a7eea19c/types/plotly.js/index.d.ts#L1036)
*/
data: {
text?: string | string[];
xaxis?: string;
yaxis?: string;
cells?: {
values?: string[][];
};
header?: {
values?: string[];
};
domain?: {
x?: number[],
y?: number[],
};
x?: (string | number | null)[] | (string | number | null)[][];
y?: (string | number | null)[] | (string | number | null)[][];
z?: (string | number | null)[] | (string | number | null)[][];
type?:
| "bar"
| "box"
| "candlestick"
| "choropleth"
| "contour"
| "heatmap"
| "histogram"
| "indicator"
| "mesh3d"
| "ohlc"
| "parcoords"
| "pie"
| "pointcloud"
| "scatter"
| "scatter3d"
| "scattergeo"
| "scattergl"
| "scatterpolar"
| "scatterternary"
| "sunburst"
| "surface"
| "treemap"
| "waterfall"
| "funnel"
| "funnelarea"
| "scattermapbox"
| "table";
mode?:
| "lines"
| "markers"
| "text"
| "lines+markers"
| "text+markers"
| "text+lines"
| "text+lines+markers"
| "none"
| "gauge"
| "number"
| "delta"
| "number+delta"
| "gauge+number"
| "gauge+number+delta"
| "gauge+delta";
}[];
/**
* Expecting Partial<Plotly.Layout> (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/795ce172038dbafcb9cba030d637d733a7eea19c/types/plotly.js/index.d.ts#L329)
*/
layout?: {
title?: string;
};
};
export type SimpleTextVisualizationData = {
kind: {
text: true;
};
text: string;
};
export type SvgVisualizationData = {
kind: {
svg: true;
};
/**
* The svg content
*/
text: string;
};
================================================
FILE: data-extraction/src/DataExtractionResult.ts
================================================
export interface DataExtractionResult {
data: VisualizationData;
usedExtractor: DataExtractorInfo;
availableExtractors: DataExtractorInfo[];
}
/**
* Instances must be valid json values.
*/
export interface VisualizationData {
kind: Record<string, true>;
}
export interface DataExtractorInfo {
id: DataExtractorId;
name: string;
priority: number;
}
export type DataExtractorId = {
__brand: "DataExtractorId";
} & string;
export function isVisualizationData(val: unknown): val is VisualizationData {
if (typeof val !== "object" || !val || !("kind" in val)) {
return false;
}
const obj = val as any;
if (typeof obj.kind !== "object" || !obj.kind) {
return false;
}
return Object.values(obj.kind).every(val => val === true);
}
================================================
FILE: data-extraction/src/getGlobal.ts
================================================
export function getGlobal(): any {
if (typeof globalThis === "object") {
return globalThis;
} else if (typeof global === "object") {
return global;
} else if (typeof window === "object") {
return window;
}
throw new Error("No global available");
}
================================================
FILE: data-extraction/src/index.ts
================================================
export * from "./js";
export * from "./CommonDataTypes";
export * from "./DataExtractionResult";
================================================
FILE: data-extraction/src/js/api/DataExtractorApi.ts
================================================
import { DataExtractionResult, VisualizationData } from "../../DataExtractionResult";
import { LoadDataExtractorsFn } from "./LoadDataExtractorsFn";
export interface DataExtractorApi {
/**
* Registers a single extractor.
*/
registerExtractor(extractor: DataExtractor): void;
/**
* Registers multiple extractors.
*/
registerExtractors(extractors: DataExtractor[]): void;
/**
* Extracts data from the result of `valueFn`.
* @valueFn a function returning the value to extract the data from.
* Is a function so that it's evaluation can depend on `evalFn`.
*/
getData(
valueFn: () => unknown,
evalFn: <T>(expression: string) => T,
preferredDataExtractorId: string | undefined,
variablesInScope: Record<string, unknown>,
callFramesSnapshot: CallFramesSnapshot | null
): JSONString<DataResult>;
/**
* Registers all default (built-in) extractors.
* @preferExisting if `true`, existing extractors with the same id are not overwritten.
*/
registerDefaultExtractors(preferExisting?: boolean): void;
setDataExtractorFn(id: string, fn: LoadDataExtractorsFn | undefined): void;
}
export type DataResult =
| {
kind: "Data";
extractionResult: DataExtractionResult;
}
| { kind: "NoExtractors" }
| { kind: "Error"; message: string }
| {
kind: "OutdatedCallFrameSnapshot";
callFramesRequest: CallFramesRequest;
};
export interface JSONString<T> extends String {
__brand: { json: T };
}
export interface CallFramesRequest {
requestId: string;
requestedCallFrames: CallFrameRequest[];
}
export interface CallFrameRequest {
methodName: string;
pathRegExp: string | undefined;
}
export interface CallFramesSnapshot {
requestId: string;
frames: (CallFrameInfo | SkippedCallFrames)[];
}
export interface SkippedCallFrames {
skippedFrames: number;
}
export interface CallFrameInfo {
methodName: string;
source: { name: string; path: string };
vars: Record<string, any>;
}
export interface DataExtractor {
/**
* Must be unique among all data extractors.
*/
id: string;
/**
* Filters the data to be extracted.
*/
dataCtor?: string;
getExtractions(data: unknown, extractionCollector: ExtractionCollector, context: DataExtractorContext): void;
}
export interface ExtractionCollector {
/**
* Suggests a possible extraction.
*/
addExtraction(extraction: DataExtraction): void;
}
export interface DataExtractorContext {
/**
* Evaluates an expression in the context of the active stack frame.
*/
evalFn: <TEval>(expression: string) => TEval;
readonly expression: string | undefined;
readonly variablesInScope: Record<string, () => unknown>;
extract(value: unknown): VisualizationData | undefined;
readonly callFrameInfos: readonly (CallFrameInfo | SkippedCallFrames)[];
addCallFrameRequest(request: CallFrameRequest): void;
}
export interface DataExtraction {
/**
* Higher priorities are preferred.
*/
priority: number;
/**
* A unique id identifying this extraction among all extractions.
* Required to express extraction preferences.
*/
id?: string;
/**
* A user friendly name of this extraction.
*/
name?: string;
extractData(): VisualizationData;
}
================================================
FILE: data-extraction/src/js/api/DataExtractorApiImpl.ts
================================================
import {
DataExtractorInfo,
VisualizationData,
} from "../../DataExtractionResult";
import * as helpers from "../helpers";
import {
CallFrameInfo,
CallFrameRequest,
CallFramesSnapshot,
DataExtraction,
DataExtractor,
DataExtractorApi,
DataExtractorContext,
DataResult,
JSONString,
SkippedCallFrames,
} from "./DataExtractorApi";
import { LoadDataExtractorsFn } from "./LoadDataExtractorsFn";
import { registerDefaultExtractors } from "./default-extractors";
/**
* @internal
*/
export class DataExtractorApiImpl implements DataExtractorApi {
public static lastContext: DataExtractorContext | undefined = undefined;
private readonly extractors = new Map<string, DataExtractor>();
private readonly extractorSources = new Map<string, LoadDataExtractorsFn>();
private toJson<TData>(data: TData): JSONString<TData> {
return JSON.stringify(data) as any;
}
public registerExtractor(extractor: DataExtractor): void {
this.extractors.set(extractor.id, extractor);
}
public registerExtractors(extractors: DataExtractor[]): void {
for (const e of extractors) {
this.registerExtractor(e);
}
}
public getData(
valueFn: () => unknown,
evalFn: <T>(expression: string) => T,
preferredDataExtractorId: string | undefined,
variablesInScope: Record<string, () => unknown>,
callFramesSnapshot: CallFramesSnapshot | null
): JSONString<DataResult> {
const callFrameRequests: CallFrameRequest[] = [];
const rootContext = new ContextImpl(
variablesInScope,
removeEnd(removeStart(valueFn.toString(), "() => ("), ")").trim(),
evalFn,
this,
undefined,
callFramesSnapshot?.frames ?? [],
callFrameRequests
);
DataExtractorApiImpl.lastContext = rootContext;
const value = valueFn();
const extractions = this.getExtractions(value, rootContext);
DataExtractorApiImpl.lastContext = undefined;
const requestId =
callFrameRequests.length === 0
? ""
: "" + cyrb53(JSON.stringify(callFrameRequests));
if ((callFramesSnapshot?.requestId ?? "") !== requestId) {
return this.toJson({
kind: "OutdatedCallFrameSnapshot",
callFramesRequest: {
requestId,
requestedCallFrames: callFrameRequests,
},
});
}
let usedExtraction = extractions[0];
if (!usedExtraction) {
return this.toJson({ kind: "NoExtractors" } as DataResult);
}
if (preferredDataExtractorId) {
const preferred = extractions.find(
(e) => e.id === preferredDataExtractorId
);
if (preferred) {
usedExtraction = preferred;
}
}
try {
const data = usedExtraction.extractData();
return this.toJson({
kind: "Data",
extractionResult: {
data,
usedExtractor: mapExtractor(usedExtraction),
availableExtractors: extractions.map(mapExtractor),
},
} as DataResult);
} catch (e) {
return this.toJson({
kind: "Data",
extractionResult: {
data: visualizeError(e),
usedExtractor: mapExtractor(usedExtraction),
availableExtractors: extractions.map(mapExtractor),
},
} as DataResult);
}
}
public getExtractions(
value: unknown,
context: DataExtractorContext
): DataExtraction[] {
const extractions = new Array<DataExtraction>();
const extractors = new Array<DataExtractor>();
for (const fn of this.extractorSources.values()) {
try {
fn((extractor) => {
extractors.push(extractor);
}, helpers);
} catch (e) {
console.error('Error in data extractor source', fn, e);
}
}
for (const extractor of [...this.extractors.values(), ...extractors]) {
if (extractor.dataCtor !== undefined) {
if (
typeof value !== "object" ||
value === null ||
value.constructor.name !== extractor.dataCtor
) {
continue;
}
}
try {
extractor.getExtractions(
value,
{
addExtraction(extraction) {
if (extraction.id === undefined) {
extraction.id = extractor.id;
}
if (extraction.name === undefined) {
extraction.name = extractor.id;
}
extractions.push(extraction);
},
},
context
);
} catch (e) {
extractions.push({
id: extractor.id,
name: extractor.id,
priority: 0,
extractData() {
return visualizeError(e);
},
});
}
}
extractions.sort((a, b) => b.priority - a.priority);
return extractions;
}
public registerDefaultExtractors(preferExisting: boolean = false): void {
// TODO consider preferExisting
registerDefaultExtractors(this);
}
public setDataExtractorFn(
id: string,
fn: LoadDataExtractorsFn | undefined
): void {
if (fn) {
this.extractorSources.set(id, fn);
} else {
this.extractorSources.delete(id);
}
}
}
function visualizeError(e: unknown | Error): VisualizationData {
return helpers.asData({
kind: { text: true },
fileName: 'error.md',
text: `# Error while running data extractor\n\n${formatErrorStr(e)}`,
});
}
function formatErrorStr(e: unknown | Error): string {
if (e instanceof Error) {
return `${e.message}\n\nStack:\n${e.stack}`;
}
return "" + e;
}
function mapExtractor(e: DataExtraction): DataExtractorInfo {
return {
id: e.id! as any,
name: e.name!,
priority: e.priority,
};
}
class ContextImpl implements DataExtractorContext {
constructor(
public readonly variablesInScope: Record<string, () => unknown>,
public readonly expression: string | undefined,
public readonly evalFn: <T>(expression: string) => T,
private readonly _api: DataExtractorApiImpl,
private readonly _parent: ContextImpl | undefined,
public readonly callFrameInfos: readonly (
| CallFrameInfo
| SkippedCallFrames
)[],
private readonly _callFrameRequests: CallFrameRequest[]
) { }
addCallFrameRequest(request: CallFrameRequest): void {
this._callFrameRequests.push(request);
}
get _level(): number {
return this._parent ? this._parent._level + 1 : 0;
}
extract(value: any): VisualizationData | undefined {
if (this._level > 10) {
throw new Error("extract() called too many times recursively");
}
const extractions = this._api.getExtractions(
value,
new ContextImpl(
this.variablesInScope,
undefined,
this.evalFn,
this._api,
this,
this.callFrameInfos,
this._callFrameRequests
)
);
if (extractions.length === 0) {
return undefined;
}
return extractions[0].extractData();
}
}
function removeStart(str: string, start: string): string {
if (str.startsWith(start)) {
return str.substr(start.length);
}
return str;
}
function removeEnd(str: string, end: string): string {
if (str.endsWith(end)) {
return str.substr(0, str.length - end.length);
}
return str;
}
// From https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript
function cyrb53(str: string, seed = 0) {
let h1 = 0xdeadbeef ^ seed,
h2 = 0x41c6ce57 ^ seed;
for (let i = 0, ch; i < str.length; i++) {
ch = str.charCodeAt(i);
h1 = Math.imul(h1 ^ ch, 2654435761);
h2 = Math.imul(h2 ^ ch, 1597334677);
}
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);
h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);
h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
}
================================================
FILE: data-extraction/src/js/api/LoadDataExtractorsFn.ts
================================================
import { DataExtractor } from "./DataExtractorApi";
import type * as helpersTypes from "../helpers"
export type LoadDataExtractorsFn = (
register: (extractor: DataExtractor) => void,
helpers: typeof helpersTypes
) => void;
================================================
FILE: data-extraction/src/js/api/default-extractors/AsIsDataExtractor.ts
================================================
import { isVisualizationData } from "../../../DataExtractionResult";
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../..";
export class AsIsDataExtractor implements DataExtractor {
readonly id = "as-is";
getExtractions(
data: unknown,
extractionCollector: ExtractionCollector,
context: DataExtractorContext
): void {
if (!isVisualizationData(data)) {
return;
}
extractionCollector.addExtraction({
id: this.id,
name: "As Is",
priority: 500,
extractData() {
return data;
},
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/GetDebugVisualizationDataExtractor.ts
================================================
import { VisualizationData } from "../../../DataExtractionResult";
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../DataExtractorApi";
export class GetVisualizationDataExtractor implements DataExtractor {
readonly id = "get-visualization-data";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
if (typeof data !== "object" || !data) {
return;
}
const getVisualizationData = (data as any)
.getVisualizationData as Function;
if (typeof getVisualizationData !== "function") {
return;
}
collector.addExtraction({
id: this.id,
name: "Use Method 'getVisualizationData'",
priority: 600,
extractData() {
return getVisualizationData.apply(data);
},
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/GridExtractor.ts
================================================
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../..";
import { GridVisualizationData } from "../../../CommonDataTypes";
import { expect } from "../../../util";
export class GridExtractor implements DataExtractor {
readonly id = "grid";
getExtractions(
data: unknown,
extractionCollector: ExtractionCollector,
context: DataExtractorContext
): void {
if (!Array.isArray(data)) {
return;
}
extractionCollector.addExtraction({
id: this.id,
name: "Array As Grid",
priority: 500,
extractData: () =>
expect<GridVisualizationData>({
kind: { grid: true },
rows: [{ columns: data.map(d => ({ tag: "" + d })) }],
}),
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/MarkedGridExtractor.ts
================================================
import { DataExtractor, ExtractionCollector, DataExtractorContext } from "..";
import { LineColumnRange } from "../../../CommonDataTypes";
import { asData, markedGrid, tryEval } from "../../helpers";
export class MarkedGridFromArrayExtractor implements DataExtractor {
readonly id = "markedGridFromArray";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
if (!Array.isArray(data)) {
return;
}
if (!Array.isArray(data[0])) {
return;
}
let markers: any;
if (data.length === 2 && typeof data[1] === "object") {
markers = data[1];
} else {
for (let i = 1; i < data.length; i++) {
if (typeof data[i] !== "string") {
return;
}
}
markers = tryEval(data.slice(1));
}
collector.addExtraction({
id: "markedGridFromArray",
name: "Marked Grid from Array",
priority: 1000,
extractData() {
return markedGrid(data[0], markers as any);
},
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/ObjectGraphExtractor.ts
================================================
import { VisualizationData } from "../../../DataExtractionResult";
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../DataExtractorApi";
import {
createGraph,
CreateGraphEdge,
createGraphFromPointers,
} from "../../helpers";
import { GraphNode } from "../../..";
export class ObjectGraphExtractor implements DataExtractor {
readonly id = "object-graph";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
function isObject(val: unknown): val is object {
if (typeof val !== "object") {
return false;
}
if (!val) {
return false;
}
return true;
}
if (!isObject(data)) {
return;
}
const infoSelector: (item: object) => {
id?: string | number;
edges: CreateGraphEdge<object>[];
} & Omit<GraphNode, "id"> = (item) => {
let label = "";
const edges = new Array<CreateGraphEdge<any>>();
if (item instanceof Set) {
label = "Set";
for (const value of item.values()) {
if (isObject(value)) {
edges.push({ label: "item", to: value });
}
}
} else if (item instanceof Map) {
label = "Map";
for (const [key, value] of item.entries()) {
if (isObject(value)) {
edges.push({ label: key, to: value });
}
}
} else {
for (const [key, val] of Object.entries(item)) {
if (isObject(val)) {
edges.push({ label: key, to: val });
}
}
const className = item.constructor
? item.constructor.name
: "?";
label = className;
if (!Array.isArray(item)) {
try {
let toStrVal = item.toString();
if (toStrVal !== "[object Object]") {
if (toStrVal.length > 15) {
toStrVal += ` "${toStrVal.substr(0, 15)}..."`;
}
label += `${className}: ${toStrVal}`;
}
} catch (e) {}
}
}
return {
shape: "box",
edges,
color: item === data ? "lightblue" : undefined,
label,
};
};
collector.addExtraction({
id: "object-graph",
name: "Object Graph",
priority: 98,
extractData() {
return createGraph([data], infoSelector, { maxSize: 50 });
},
});
if (
data.constructor === Object &&
Object.values(data).every(
(v) => v === undefined || v === null || typeof v === "object"
)
) {
collector.addExtraction({
id: "object-graph-pointers",
name: "Object Graph With Pointers",
priority: 99,
extractData() {
return createGraphFromPointers(data as any, infoSelector, {
maxSize: 50,
});
},
});
}
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/PlotlyDataExtractor.ts
================================================
import { PlotlyVisualizationData } from "../../../CommonDataTypes";
import { expect } from "../../../util";
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../DataExtractorApi";
export class PlotlyDataExtractor implements DataExtractor {
readonly id = "plot";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
if (!Array.isArray(data)) {
return;
}
if (data.some(x => typeof x !== "number")) {
return;
}
collector.addExtraction({
id: "plot-y",
name: "Plot as y-Values",
priority: 1001,
extractData: () =>
expect<PlotlyVisualizationData>({
kind: {
plotly: true,
},
data: [{ y: data }],
}),
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/StringDiffExtractor.ts
================================================
import {
DataExtractor,
DataExtractorContext,
ExtractionCollector,
} from "../..";
export class StringDiffExtractor implements DataExtractor {
public readonly id = "string-diff";
public getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
) {
if (
Array.isArray(data) &&
data.length === 2 &&
typeof data[0] === "string" &&
typeof data[1] === "string"
) {
collector.addExtraction({
id: "string-diff",
name: "String Diff",
priority: 1300,
extractData: () => ({
kind: { text: true },
text: data[0],
otherText: data[1],
}),
});
}
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/StringRangeExtractor.ts
================================================
import { DataExtractor, ExtractionCollector, DataExtractorContext } from "..";
import { LineColumnRange } from "../../../CommonDataTypes";
import { asData } from "../../helpers";
export class StringRangeExtractor implements DataExtractor {
readonly id = "stringRange";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
if (!Array.isArray(data)) {
return;
}
if (typeof data[0] !== "string") {
return;
}
const text = data[0];
const decorations1: { range: LineColumnRange; label?: string }[] = [];
const decorations2: { range: LineColumnRange; label?: string }[] = [];
function offsetToLineColumn(offset: number) {
let line = 0;
let column = 0;
for (let idx = 0; idx < text.length; idx++) {
if (idx === offset) {
return { line, column };
}
if (text[idx] === "\n") {
line++;
column = 0;
} else {
column++;
}
}
return { line, column }; // TODO
}
if (
data.length === 2 &&
typeof data[1] === "object" &&
!Array.isArray(data[1])
) {
data = [data[0], ...Object.values(data[1])] as [
number | [number, number]
][];
}
for (let item of (data as (number | [number, number])[]).slice(1)) {
if (typeof item === "string") {
try {
item = context.evalFn(item);
} catch (e) {
return;
}
if (item === undefined) {
continue;
}
}
if (typeof item === "number") {
const pos = offsetToLineColumn(item);
decorations1.push({ range: { start: pos, end: pos } });
decorations2.push({
range: {
start: pos,
end: { line: pos.line, column: pos.column + 1 },
},
});
} else if (
Array.isArray(item) &&
item.length === 2 &&
typeof item[0] === "number" &&
typeof item[1] === "number"
) {
decorations1.push({
range: {
start: offsetToLineColumn(item[0]),
end: offsetToLineColumn(item[1]),
},
});
decorations2.push(decorations1[decorations1.length - 1]);
} else {
return;
}
}
collector.addExtraction({
priority: 1200,
id: "stringRange",
name: "String Range",
extractData() {
return asData({
kind: { text: true },
text,
decorations: decorations1,
});
},
});
collector.addExtraction({
priority: 1000,
id: "stringRangeFullCharacters",
name: "String Range (Full Character)",
extractData() {
return asData({
kind: { text: true },
text,
decorations: decorations2,
});
},
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/TableExtractor.ts
================================================
import { isAssertionExpression } from "typescript";
import { DataExtractor, ExtractionCollector, DataExtractorContext } from "..";
import { TableVisualizationData } from "../../../CommonDataTypes";
import { expect } from "../../../util";
function assert<T>(value: unknown): asserts value {}
export class TableDataExtractor implements DataExtractor {
readonly id = "table";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
if (!Array.isArray(data)) {
return;
}
if (
!data.every((d) => typeof d === "object" && d && !Array.isArray(d))
) {
return;
}
assert<object[]>(data);
collector.addExtraction({
id: "table",
name: "Table",
priority: 1000,
extractData() {
return expect<TableVisualizationData>({
kind: {
table: true,
},
rows: data,
});
},
});
collector.addExtraction({
id: "table-with-type-name",
name: "Table (With Type Name)",
priority: 950,
extractData() {
return expect<TableVisualizationData>({
kind: {
table: true,
},
rows: data.map((d) => ({ type: d.constructor.name, ...d })),
});
},
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/ToStringExtractor.ts
================================================
import { MonacoTextVisualizationData } from "../../../CommonDataTypes";
import { expect } from "../../../util";
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../DataExtractorApi";
export class ToStringDataExtractor implements DataExtractor {
readonly id = "to-string";
getExtractions(
data: unknown,
collector: ExtractionCollector,
context: DataExtractorContext
): void {
collector.addExtraction({
id: "to-string",
name: "To String",
priority: 100,
extractData() {
return expect<MonacoTextVisualizationData>({
kind: {
text: true,
},
text: "" + data,
});
},
});
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/TypeScriptDataExtractors.ts
================================================
import * as ts from "typescript"; // Only compile-time import!
import { AstTreeNode } from "../../..";
import { AstTreeVisualizationData } from "../../../CommonDataTypes";
import { expect } from "../../../util";
import {
DataExtractor,
ExtractionCollector,
DataExtractorContext,
} from "../DataExtractorApi";
export class TypeScriptAstDataExtractor implements DataExtractor {
readonly id = "typescript-ast";
getExtractions(
data: unknown,
collector: ExtractionCollector,
{ evalFn }: DataExtractorContext
): void {
if (!data) {
return;
}
function getApi(): typeof ts {
if (typeof data === "object" && "typescript" in (data as object)) {
return (data as any).typescript;
} else {
// This might refer to global.require which uses CWD for resolution!
const require = evalFn<(request: string) => unknown>("require");
return require("typescript") as typeof ts;
}
}
let tsApi: typeof ts;
try {
tsApi = getApi();
if (!tsApi) {
return;
}
} catch (e) {
return;
}
const helper = new Helper(tsApi);
let rootSourceFile: ts.SourceFile | undefined = undefined;
let rootNode: ts.Node | undefined = undefined;
let marked: Set<ts.Node>;
let fn: (n: ts.Node) => string | undefined = (n: ts.Node) => undefined;
if (
Array.isArray(data) &&
data.every(helper.isNode) &&
data.length > 0
) {
rootSourceFile = helper.getSourceFile(data[0] as ts.Node);
marked = new Set(data);
} else if (helper.isNode(data)) {
rootSourceFile = helper.getSourceFile(data);
marked = new Set([data]);
} else if (typeof data === "object" && data) {
marked = new Set();
const map = new Map<ts.Node, string>();
fn = (n: ts.Node) => map.get(n);
for (const [key, item] of Object.entries(data)) {
if (key === "fn") {
fn = item;
} else if (key === "typescript") {
} else {
if (key === "rootNode") {
rootNode = item;
}
let nodes: Array<ts.Node>;
if (helper.isNode(item)) {
nodes = [item];
} else if (
Array.isArray(item) &&
item.every(helper.isNode)
) {
nodes = item;
} else {
return;
}
if (nodes.length > 0 && !rootSourceFile) {
rootSourceFile = helper.getSourceFile(nodes[0]);
}
for (const n of nodes) {
marked.add(n);
map.set(n, key);
}
}
}
} else {
return;
}
if (!rootSourceFile) {
return;
}
const finalRootSourceFile = rootSourceFile;
collector.addExtraction({
id: "ts-ast",
name: "TypeScript AST",
priority: 1000,
extractData() {
return expect<AstTreeVisualizationData>({
kind: { text: true, tree: true, ast: true },
root: helper.toTreeNode(
rootNode || finalRootSourceFile,
"root",
"",
marked,
fn
),
text: finalRootSourceFile.text,
fileName: "index.ts",
});
},
});
}
}
class Helper {
constructor(private readonly tsApi: typeof ts) {}
getPropertyNameInParent(value: any, parent: any): string | undefined {
for (const propertyName in parent) {
if (propertyName.startsWith("_")) continue;
const member = parent[propertyName];
if (member === value) {
return propertyName;
}
if (Array.isArray(member)) {
const index = member.indexOf(value);
if (index !== -1) {
return `${propertyName}[${index}]`;
}
}
}
return undefined;
}
getChildren(node: ts.Node): ts.Node[] {
const result = new Array<ts.Node>();
this.tsApi.forEachChild(node, n => {
result.push(n);
});
return result;
}
toTreeNode(
node: ts.Node,
memberName: string,
segmentName: string,
marked: Set<ts.Node>,
emphasizedValueFn: (node: ts.Node) => string | undefined
): AstTreeNode {
const name = this.tsApi.SyntaxKind[node.kind];
const children = this.getChildren(node)
.map((childNode, idx) => {
let parentPropertyName =
this.getPropertyNameInParent(childNode, node) || "";
if (childNode.kind == this.tsApi.SyntaxKind.SyntaxList) {
const children = this.getChildren(childNode);
for (const c of children) {
const name =
this.getPropertyNameInParent(c, node) || "";
if (name) {
parentPropertyName = name;
break;
}
}
}
let segmentName = "." + parentPropertyName;
if (node.kind == this.tsApi.SyntaxKind.SyntaxList) {
parentPropertyName = "" + idx;
segmentName = `[${idx}]`;
}
return this.toTreeNode(
childNode,
parentPropertyName,
segmentName,
marked,
emphasizedValueFn
);
})
.filter(c => c !== null);
let value: string | undefined = undefined;
if (this.tsApi.isIdentifier(node)) {
value = node.text || (node.escapedText as string);
} else if (this.tsApi.isLiteralExpression(node)) {
value = node.text;
}
const items: AstTreeNode["items"] = [
{ text: `${memberName}: `, emphasis: "style1" },
{ text: name },
];
const emphasizedVal = emphasizedValueFn(node);
if (value) {
items.push({ text: value, emphasis: "style2" });
}
if (emphasizedVal) {
items.push({ text: emphasizedVal, emphasis: "style3" });
}
return {
items,
children: children,
segment: segmentName,
span: {
length: node.end - node.pos,
start: node.pos,
},
isMarked: marked.has(node),
};
}
isNode = (node: unknown): node is ts.Node => {
return (
typeof node === "object" &&
node !== null &&
(this.tsApi.isToken(node as any) ||
(this.tsApi as any).isNode(node))
);
};
getSourceFile(node: ts.Node | any): ts.SourceFile {
if (!node) {
throw new Error("Detached node");
}
if (this.tsApi.isSourceFile(node)) {
return node;
}
if (!("getSourceFile" in node)) {
return this.getSourceFile(node.parent);
}
return node.getSourceFile();
}
}
================================================
FILE: data-extraction/src/js/api/default-extractors/index.ts
================================================
export { registerDefaultExtractors } from "./registerDefaultDataExtractors";
================================================
FILE: data-extraction/src/js/api/default-extractors/registerDefaultDataExtractors.ts
================================================
import { DataExtractorApi } from "../DataExtractorApi";
import { TypeScriptAstDataExtractor } from "./TypeScriptDataExtractors";
import { AsIsDataExtractor } from "./AsIsDataExtractor";
import { GetVisualizationDataExtractor } from "./GetDebugVisualizationDataExtractor";
import { ToStringDataExtractor } from "./ToStringExtractor";
import { PlotlyDataExtractor } from "./PlotlyDataExtractor";
import { ObjectGraphExtractor } from "./ObjectGraphExtractor";
import { getDataExtractorApi } from "../injection";
import { GridExtractor } from "./GridExtractor";
import { TableDataExtractor } from "./TableExtractor";
import { StringDiffExtractor } from "./StringDiffExtractor";
import { StringRangeExtractor } from "./StringRangeExtractor";
import { MarkedGridFromArrayExtractor } from "./MarkedGridExtractor";
/**
* The default data extractors should be registered by VS Code automatically.
* Registering them manually ensures that they are up to date.
*/
export function registerDefaultExtractors(
api: DataExtractorApi = getDataExtractorApi()
) {
for (const item of [
new TypeScriptAstDataExtractor(),
new AsIsDataExtractor(),
new GetVisualizationDataExtractor(),
new ToStringDataExtractor(),
new PlotlyDataExtractor(),
new ObjectGraphExtractor(),
new GridExtractor(),
new TableDataExtractor(),
new StringDiffExtractor(),
new StringRangeExtractor(),
new MarkedGridFromArrayExtractor(),
]) {
api.registerExtractor(item);
}
}
================================================
FILE: data-extraction/src/js/api/index.ts
================================================
export * from "./DataExtractorApi";
export * from "./injection";
export { DataExtractorApiImpl } from "./DataExtractorApiImpl";
export * from "./LoadDataExtractorsFn";
================================================
FILE: data-extraction/src/js/api/injection.ts
================================================
import * as fs from "fs";
import { getGlobal } from "../../getGlobal";
import * as globalHelpers from "../global-helpers";
import * as helpers from "../helpers";
import { DataExtractorApi } from "./DataExtractorApi";
import { DataExtractorApiImpl } from "./DataExtractorApiImpl";
/**
* Returns standalone JS code representing an expression that initializes the data extraction API.
* This expression returns nothing.
* This function is called in the VS Code extension, the expression is evaluated in the debugee.
*/
export function getExpressionToInitializeDataExtractorApi(): string {
const _fs = require("fs") as typeof fs;
const moduleSrc = _fs.readFileSync(__filename, { encoding: "utf8" });
return `((function () {
let module = {};
${moduleSrc}
return module.exports.getDataExtractorApi();
})())`;
}
/**
* Returns standalone JS code representing an expression that returns the data extraction API.
* This expression returns an object of type `DataExtractorApi`.
* This function is called in the VS Code extension, the expression is evaluated in the debugee.
*/
export function getExpressionForDataExtractorApi(): string {
return `((${selfContainedGetInitializedDataExtractorApi.toString()})())`;
}
const apiKey = "@hediet/data-extractor-api/v3";
export function getDataExtractorApi(): DataExtractorApi {
installHelpers();
const globalObj = getGlobal();
if (!globalObj[apiKey]) {
globalObj[apiKey] = new DataExtractorApiImpl();
}
return globalObj[apiKey];
}
/**
* This code is used to detect if the API has not been initialized yet.
* @internal
*/
export const ApiHasNotBeenInitializedCode = "EgH0cybXij1jYUozyakO" as const;
/**
* @internal
*/
function selfContainedGetInitializedDataExtractorApi(): DataExtractorApi {
function getGlobal(): any {
if (typeof globalThis === "object") {
return globalThis;
} else if (typeof global === "object") {
return global;
} else if (typeof window === "object") {
return window;
}
throw new Error("No global available");
}
const globalObj = getGlobal();
const key: typeof apiKey = "@hediet/data-extractor-api/v3";
let api: DataExtractorApi | undefined = globalObj[key];
if (!api) {
const code: typeof ApiHasNotBeenInitializedCode =
"EgH0cybXij1jYUozyakO";
throw new Error(
`Data Extractor API has not been initialized. Code: ${code}`
);
}
return api;
}
export function installHelpers(): void {
const globalObj = getGlobal();
// `hediet` as prefix to avoid name collision (I own `hediet.de`).
globalObj["hedietDbgVis"] = { ...helpers, ...globalHelpers };
}
================================================
FILE: data-extraction/src/js/global-helpers.ts
================================================
export { getDataExtractorApi as getApi } from "./api/injection";
================================================
FILE: data-extraction/src/js/helpers/asData.ts
================================================
import { KnownVisualizationData } from "../../CommonDataTypes";
import { VisualizationData } from "../../DataExtractionResult";
export function asData(data: KnownVisualizationData): VisualizationData {
return data;
}
================================================
FILE: data-extraction/src/js/helpers/cache.ts
================================================
import { DataExtractorApiImpl } from "../api";
const cached = new Map<string, any>();
/**
* Evaluates an expression
*/
export function cache<T>(
expression: string | (() => T),
id: string | number | undefined = undefined
): T {
let resultFn: () => any;
let key: string;
if (typeof expression === "string") {
const context = DataExtractorApiImpl.lastContext!;
resultFn = () => context.evalFn(expression);
key = JSON.stringify({ expr: expression, id });
} else {
resultFn = () => expression();
key = JSON.stringify({ expr: expression.toString(), id });
}
if (cached.has(key)) {
return cached.get(key);
}
const result = resultFn();
cached.set(key, result);
return result;
}
================================================
FILE: data-extraction/src/js/helpers/createGraph.ts
================================================
import {
GraphEdge,
GraphNode,
GraphVisualizationData,
} from "../../CommonDataTypes";
export type CreateGraphEdge<T> = ({ to: T } | { from: T } | { include: T }) &
Omit<GraphEdge, "from" | "to">;
/**
* Given a list of roots, it creates a graph by following their edges recursively.
* Tracks cycles.
*/
export function createGraph<T>(
roots: T[],
infoSelector: (
item: T
) => {
id?: string | number;
edges: CreateGraphEdge<T>[];
} & Omit<GraphNode, "id">,
options: { maxSize?: number } = {}
): GraphVisualizationData {
const r: GraphVisualizationData = {
kind: {
graph: true,
},
nodes: [],
edges: [],
};
let idCounter = 1;
const ids = new Map<T, string>();
function getId(item: T): string {
const _id = infoSelector(item).id;
if (_id !== undefined) {
return "" + _id;
}
let id = ids.get(item);
if (!id) {
id = `hediet.de/id-${idCounter++}`;
ids.set(item, id);
}
return id;
}
const queue = new Array<{ item: T; dist: number }>(
...roots.map(r => ({ item: r, dist: 0 }))
);
const processed = new Set<T>();
while (queue.length > 0) {
const { item, dist } = queue.shift()!;
if (processed.has(item)) {
continue;
}
processed.add(item);
const nodeInfo = infoSelector(item);
const fromId = getId(item);
r.nodes.push({ ...nodeInfo, id: fromId, ["edges" as any]: undefined });
for (const e of nodeInfo.edges) {
let other: T;
let toId: string | undefined;
let fromId_: string | undefined;
if ("to" in e) {
other = e.to;
toId = getId(e.to);
fromId_ = fromId;
} else if ("from" in e) {
other = e.from;
toId = getId(e.from);
fromId_ = fromId;
} else if ("include" in e) {
other = e.include;
} else {
throw new Error("Every edge must either have 'to' or 'from'");
}
if (fromId_ !== undefined && toId !== undefined) {
r.edges.push({
...e,
from: fromId_,
to: toId,
});
}
let shouldPush = !processed.has(other);
if (
options.maxSize &&
processed.size + queue.length > options.maxSize
) {
shouldPush = false;
}
if (shouldPush) {
queue.push({ item: other, dist: dist + 1 });
}
}
}
return r;
}
================================================
FILE: data-extraction/src/js/helpers/createGraphFromPointers.ts
================================================
import { GraphNode, GraphVisualizationData } from "../../CommonDataTypes";
import { CreateGraphEdge, createGraph } from "./createGraph";
/**
* Given a labeled list of roots, it creates a graph by following their edges recursively.
* Tracks cycles.
*/
export function createGraphFromPointers<T>(
roots: Record<string, T | undefined | null>,
infoSelector: (item: T) => {
id?: string | number;
edges: CreateGraphEdge<T>[];
} & Omit<GraphNode, "id">,
options: { maxSize?: number } = {}
): GraphVisualizationData {
const marker = {};
interface Pointer {
marker: {};
name: string;
value: T | null | undefined;
}
const items = Object.entries(roots).map<Pointer>(([name, value]) => ({
marker,
name,
value,
}));
return createGraph<T | Pointer>(
items,
(item) => {
if (
typeof item === "object" &&
item &&
"marker" in item &&
item["marker"] === marker
) {
return {
id: "label____" + item.name,
color: "orange",
label: item.name,
edges: [
{ to: item.value!, color: "orange", label: "" },
].filter((t) => !!t.to),
};
} else {
return infoSelector(item as T);
}
},
options
);
}
================================================
FILE: data-extraction/src/js/helpers/find.ts
================================================
import { DataExtractorApiImpl } from "../api";
export function find(predicate: (obj: unknown) => boolean): unknown {
const processed = new Set();
if (!DataExtractorApiImpl.lastContext) {
throw new Error("No data extractor context!");
}
const values = Object.values(
DataExtractorApiImpl.lastContext.variablesInScope
);
const queue = [
...values.map((v) => {
try {
return v();
} catch (e) {
return undefined;
}
}),
];
let i = 10000;
while (i > 0) {
i--;
const top = queue.shift();
processed.add(top);
if (predicate(top)) {
return top;
}
if (typeof top === "object" && top) {
for (const val of Object.values(top)) {
if (!processed.has(val)) {
processed.add(val);
queue.push(val);
}
}
}
}
return undefined;
}
export function findVar(
options: { nameSimilarTo?: string; ctor?: string },
predicate?: (value: any) => boolean
): unknown | undefined {
if (!DataExtractorApiImpl.lastContext) {
throw new Error("No data extractor context!");
}
let bestValue = undefined;
let bestValueScore = undefined; // minimized
for (const [name, value] of Object.entries(
DataExtractorApiImpl.lastContext.variablesInScope
)) {
const v = value();
if (options.ctor !== undefined) {
if (
typeof v !== "object" ||
!v ||
v.constructor.name !== options.ctor
) {
continue;
}
}
if (predicate) {
if (!predicate(v)) {
continue;
}
}
let score = 0;
if (options.nameSimilarTo !== undefined) {
score += similarityScore(name, options.nameSimilarTo);
} else {
return v;
}
if (bestValueScore === undefined || score < bestValueScore) {
bestValue = v;
bestValueScore = score;
}
}
return bestValue;
}
function similarityScore(a: string, b: string): number {
const distance = levenshteinDistance(a, b);
const aSorted = a.split("").sort().join("");
const bSorted = b.split("").sort().join("");
const distance2 = levenshteinDistance(aSorted, bSorted);
return distance * 10 + distance2;
}
function levenshteinDistance(a: string, b: string): number {
if (a.length === 0) return b.length;
if (b.length === 0) return a.length;
const matrix = [];
// increment along the first column of each row
let i;
for (i = 0; i <= b.length; i++) {
matrix[i] = [i];
}
// increment each column in the first row
let j;
for (j = 0; j <= a.length; j++) {
matrix[0][j] = j;
}
// Fill in the rest of the matrix
for (i = 1; i <= b.length; i++) {
for (j = 1; j <= a.length; j++) {
if (b.charAt(i - 1) == a.charAt(j - 1)) {
matrix[i][j] = matrix[i - 1][j - 1];
} else {
matrix[i][j] = Math.min(
matrix[i - 1][j - 1] + 1, // substitution
Math.min(
matrix[i][j - 1] + 1, // insertion
matrix[i - 1][j] + 1
)
); // deletion
}
}
}
return matrix[b.length][a.length];
}
================================================
FILE: data-extraction/src/js/helpers/index.ts
================================================
export * from "./createGraph";
export * from "./createGraphFromPointers";
export * from "./tryEval";
export * from "./markedGrid";
export * from "./cache";
export * from "./asData";
export * from "./find";
================================================
FILE: data-extraction/src/js/helpers/markedGrid.ts
================================================
import { GridVisualizationData } from "../../CommonDataTypes";
export function markedGrid(
arr: unknown[],
marked: Record<string, number | undefined>
): GridVisualizationData {
if (!Array.isArray(arr)) {
arr = [...(arr as any)];
}
return {
kind: { grid: true },
rows: [
{
columns: arr.map((d) => ({
content: "" + d,
tag: "" + d,
})),
},
],
markers: marked
? Object.entries(marked)
.map(([key, val]) => ({
id: "" + key,
row: 0,
column: val!,
}))
.filter((c) => c.column !== undefined)
: undefined,
};
}
================================================
FILE: data-extraction/src/js/helpers/tryEval.ts
================================================
import { DataExtractorApiImpl } from "../api/DataExtractorApiImpl";
/**
* Takes an object and eval's its values.
* Each successfully evaluated value is added to the result object,
* its original key is used as key in the result object.
*
* # Example
* ```
* const x = 1;
* tryEval({ val1: "x", val2: "x y" })
* // -> { val1: 1 }
* ```
*/
export function tryEval(obj: Record<string, string>): Record<string, unknown>;
/**
* Takes an array of strings and eval's its items.
* Each successfully evaluated value is added to the result object,
* its original value is used as key.
*
* # Example
* ```
* const x = 1;
* tryEval(["x", "y", "a a", "x + 2"])
* // -> { x: 1, "x + 2": 3 }
* ```
*/
export function tryEval(arr: string[]): Record<string, unknown>;
export function tryEval(
obj: Record<string, string> | string[] | string
): Record<string, unknown> | unknown {
const result: Record<string, unknown> = {};
const context = DataExtractorApiImpl.lastContext!;
if (Array.isArray(obj)) {
for (const val of obj) {
try {
result[val] = context.evalFn(val);
} catch (e) {}
}
} else {
for (const [key, val] of Object.entries(obj)) {
try {
result[key] = context.evalFn(val);
} catch (e) {}
}
}
return result;
}
================================================
FILE: data-extraction/src/js/index.ts
================================================
export * from "./api";
export * from "./helpers";
export { registerDefaultExtractors } from "./api/default-extractors";
================================================
FILE: data-extraction/src/util.ts
================================================
export function expect<T>(data: T): T {
return data;
}
================================================
FILE: data-extraction/test/main.test.ts
================================================
import { DataExtractorApiImpl } from "../";
describe("extractor", () => {
it("should not crash", () => {
const dataExtractor = new DataExtractorApiImpl();
dataExtractor.registerDefaultExtractors();
const result = dataExtractor.getData(
() => [1, 2, 3],
() => null!,
undefined
);
});
});
================================================
FILE: data-extraction/test/tsconfig.json
================================================
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"strict": true,
"skipLibCheck": true,
"rootDir": "./",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"newLine": "LF",
"sourceMap": true,
"noEmit": true
},
"include": ["./**/*"]
}
================================================
FILE: data-extraction/tsconfig.json
================================================
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"strict": true,
"outDir": "./dist",
"skipLibCheck": true,
"rootDir": "./src",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"newLine": "LF",
"sourceMap": true
},
"include": ["./src/**/*"]
}
================================================
FILE: data-extraction/webpack.config.ts
================================================
import { CleanWebpackPlugin } from "clean-webpack-plugin";
import * as path from "path";
import * as webpack from "webpack";
const r = (file: string) => path.resolve(__dirname, file);
module.exports = {
target: "node",
entry: r("./src/index"),
output: {
path: r("./dist"),
filename: "index.js",
libraryTarget: "commonjs2",
devtoolModuleFilenameTemplate: "../[resource-path]",
},
devtool: "source-map",
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
},
],
},
],
},
node: {
__dirname: false,
__filename: false,
},
plugins: [
new CleanWebpackPlugin({
//protectWebpackAssets: true,
cleanAfterEveryBuildPatterns: ["!**/*.d.ts", "!**/*.d.ts.map"],
}),
],
} as webpack.Configuration;
================================================
FILE: demos/cpp/.gitignore
================================================
main
================================================
FILE: demos/cpp/.vscode/launch.json
================================================
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
================================================
FILE: demos/cpp/.vscode/tasks.json
================================================
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": "build"
}
]
}
================================================
FILE: demos/cpp/main.cpp
================================================
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
// visualize `myGraphJson`!
string myGraphJson = "{\"kind\":{\"graph\":true},"
"\"nodes\":[{\"id\":\"1\"},{\"id\":\"2\"}],"
"\"edges\":[{\"from\":\"1\",\"to\":\"2\"}]}";
cout << myGraphJson;
}
================================================
FILE: demos/csharp/.gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
================================================
FILE: demos/csharp/.vscode/launch.json
================================================
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": "C# - Demo: Linked List",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "csharp-build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/demo.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
}
]
}
================================================
FILE: demos/csharp/.vscode/settings.json
================================================
{
"debugVisualizer.debugAdapterConfigurations": {}
}
================================================
FILE: demos/csharp/.vscode/tasks.json
================================================
{
"version": "2.0.0",
"tasks": [
{
"label": "csharp-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/csharp/demo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
================================================
FILE: demos/csharp/ExtractedData.cs
================================================
#nullable enable
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Hediet.DebugVisualizer.ExtractedData
{
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public abstract class ExtractedData
{
[JsonProperty("kind")]
public Dictionary<string, bool> Kind
{
get
{
var d = new Dictionary<string, bool>();
foreach (var tag in Tags)
{
d.Add(tag, true);
}
return d;
}
}
[JsonIgnore]
public abstract string[] Tags { get; }
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
public class TextData : ExtractedData
{
public override string[] Tags => new string[] { "text" };
[JsonProperty("text")]
public string TextValue { get; set; }
public TextData(string text)
{
this.TextValue = text;
}
}
public class GraphData : ExtractedData
{
public override string[] Tags => new string[] { "graph" };
[JsonProperty("nodes")]
public IList<NodeData> Nodes { get; set; } = new List<NodeData>();
[JsonProperty("edges")]
public IList<EdgeData> Edges { get; set; } = new List<EdgeData>();
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class NodeData
{
public NodeData(string id)
{
Id = id;
}
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("label")]
public string? Label { get; set; }
[JsonProperty("color")]
public string? Color { get; set; }
[JsonProperty("shape")]
public string? Shape { get; set; }
}
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class EdgeData
{
public EdgeData(string from, string to)
{
From = from;
To = to;
}
[JsonProperty("from")]
public string From { get; set; }
[JsonProperty("to")]
public string To { get; set; }
[JsonProperty("label")]
public string? Label { get; set; }
[JsonProperty("id")]
public string? Id { get; set; }
[JsonProperty("color")]
public string? Color { get; set; }
[JsonProperty("dashes")]
public bool? Dashes { get; set; }
}
public static GraphData From<T>(IEnumerable<T> items, Func<T, NodeInfo<T>, NodeInfo<T>> f) where T : notnull
{
var d = new GraphData();
var q = new Queue<T>(items);
var i = 0;
var infos = new Dictionary<T, NodeInfo<T>>();
string GetId(NodeInfo<T> item)
{
if (item.Id == null)
item.Id = "hediet.de/" + (i++);
return item.Id;
}
NodeInfo<T> GetNodeInfo(T item)
{
if (infos.ContainsKey(item))
return infos[item];
var info = f(item, new NodeInfo<T>());
infos.Add(item, info);
return info;
}
while (q.Count > 0)
{
var nodeInfo = GetNodeInfo(q.Dequeue());
var nd = new NodeData(GetId(nodeInfo));
d.Nodes.Add(nd);
nd.Label = nodeInfo.Label;
nd.Color = nodeInfo.Color;
foreach (var e in nodeInfo.Edges)
{
var ed = new EdgeData(nd.Id, GetId(GetNodeInfo(e.To)));
d.Edges.Add(ed);
ed.Label = e.Label;
ed.Id = e.Id;
q.Enqueue(e.To);
}
}
return d;
}
public class NodeInfo<T>
{
public IList<EdgeInfo<T>> Edges { get; set; } = new List<EdgeInfo<T>>();
public string? Label { get; set; }
public string? Id { get; set; }
public string? Color { get; set; }
public NodeInfo<T> AddEdge(T to, string? id = null, string? label = null)
{
var e = new EdgeInfo<T>(to);
e.Id = id;
e.Label = label;
Edges.Add(e);
return this;
}
}
public class EdgeInfo<T>
{
public T To { get; set; }
public string? Label { get; set; }
public string? Id { get; set; }
public EdgeInfo(T to)
{
To = to;
}
}
}
}
================================================
FILE: demos/csharp/Program.cs
================================================
// Install dotnet core clr see VS Code docs on how to setup VS Code so that you can debug C# applications.
// The Debug Visualizer does not support C# data extractors yet.
// If you want to visualize a value, it's `ToString` method must return supported json data.
// See the readme of the extension for supported json schemas.
#nullable enable
using System.Linq;
using Hediet.DebugVisualizer.ExtractedData;
namespace Demo
{
class Program
{
static void Main(string[] args)
{
var list = new LinkedList<int>();
// visualize `list.Visualize()` here!
list.Append(1);
list.Append(2);
list.Append(3);
list.Append(4);
}
}
class LinkedList<T>
{
class Node
{
public Node(T value) { Value = value; }
public T Value { get; set; }
public Node? Next { get; set; }
}
private Node? Head { get; set; }
public void Append(T item)
{
if (this.Head == null)
{
this.Head = new Node(item);
}
else
{
var cur = this.Head;
while (cur.Next != null)
{
cur = cur.Next;
}
cur.Next = new Node(item);
}
}
public string Visualize()
{
var list = new Node(default(T)!) { Next = this.Head };
return GraphData.From(new[] { list }, (item, info) =>
{
info.Id = item == list ? "List" : string.Format("{0}", item.Value);
if (item == list)
{
info.Color = "orange";
}
if (item.Next != null)
info.AddEdge(item.Next!, label: item == list ? "head" : "next");
return info;
}).ToString();
}
}
}
================================================
FILE: demos/csharp/demo.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="newtonsoft.json" Version="12.0.3" />
</ItemGroup>
</Project>
================================================
FILE: demos/dart/debug_visualizers.dart
================================================
import 'dart:convert';
String graph(List<GraphNode> nodes, List<GraphEdge> edges) {
return jsonEncode({
'kind': {'graph': true},
'nodes': nodes,
'edges': edges,
});
}
String plotly(List<num> values) {
return jsonEncode({
'kind': {'plotly': true},
'data': [
{'y': values}
],
});
}
String tree(TreeNode root) {
return jsonEncode({
'kind': {'tree': true},
'root': root,
});
}
class Graph {
List<GraphNode> nodes;
List<GraphEdge> edges;
}
class GraphEdge {
final String from;
final String to;
final String label;
GraphEdge(this.from, this.to, this.label);
Map<String, dynamic> toJson() => {
'from': from,
'to': to,
'label': label,
};
}
class GraphNode {
final String id;
final String label;
GraphNode(
this.id,
this.label,
);
Map<String, dynamic> toJson() => {
'id': id,
'label': label,
};
}
class TreeNode {
final List<TreeNode> children;
final List<TreeNodeItem> items;
final String segment;
final bool isMarked;
TreeNode(this.children, this.items, this.segment, [this.isMarked = false]);
Map<String, dynamic> toJson() => {
'children': children ?? [],
'items': items,
'segment': segment,
'isMarked': isMarked,
};
}
class TreeNodeItem {
final String text;
TreeNodeItem(this.text);
Map<String, dynamic> toJson() => {
'text': text,
};
}
================================================
FILE: demos/dart/demo.dart
================================================
import 'dart:collection';
import 'dart:developer';
import 'dart:math';
// ignore: unused_import
import 'debug_visualizers.dart';
final _rnd = Random();
String Function() visualize;
void main() {
debugger();
// Open a Debug Visualizer window and evalute the expression "visualize()"
// and then press Continue to step through the samples.
plotly_demo();
graph_demo();
tree_demo();
}
void plotly_demo() {
final values = <int>[];
visualize = () => plotly(values);
for (var i = 0; i < 20; i++) {
debugger();
values.add(i + _rnd.nextInt(5) - 2);
}
}
void graph_demo() {
graphFromDoubleLinked<T>(
DoubleLinkedQueue<T> values, String Function(T) toString) {
node(T s) => GraphNode(toString(s), toString(s));
edge(DoubleLinkedQueueEntry<T> e) => [
if (e.nextEntry() != null)
GraphEdge(
toString(e.element),
toString(e.nextEntry().element),
"next",
),
if (e.previousEntry() != null)
GraphEdge(
toString(e.element),
toString(e.previousEntry().element),
"prev",
),
];
final nodes = values.map(node).toList();
final edges = <GraphEdge>[];
values.forEachEntry((e) => edges.addAll(edge(e)));
return graph(nodes, edges);
}
final values = DoubleLinkedQueue<String>();
visualize = () => graphFromDoubleLinked(values, (s) => s);
for (var i = 0; i < 10; i++) {
debugger();
values.addLast('Node $i');
}
}
void tree_demo() {
var nodeNum = 1;
TreeNode createNode(int levels) {
final name = 'Node ${nodeNum++}';
final children =
levels > 0 ? List.generate(2, (_) => createNode(levels - 1)) : null;
return TreeNode(children, [TreeNodeItem(name)], name);
}
var levels = 0;
visualize = () {
nodeNum = 1;
return tree(createNode(levels));
};
for (var i = 1; i < 5; i++) {
debugger();
levels = i;
}
}
================================================
FILE: demos/golang/.vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"env": {},
"args": [],
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 1,
"maxStringLen": 5000,
"maxArrayValues": 64,
"maxStructFields": -1
}
}
]
}
================================================
FILE: demos/golang/demo.go
================================================
package main
import (
"encoding/json"
"math/rand"
"strconv"
"time"
)
// If you want to visualize large data structures,
// you need to increase Delve's maxStringLen.
// (See here https://github.com/microsoft/vscode-go/issues/868 for more info)
// You can do this by adding the following configuration to your launch.json:
// "dlvLoadConfig": {
// "followPointers": true,
// "maxVariableRecurse": 1,
// "maxStringLen": 5000,
// "maxArrayValues": 64,
// "maxStructFields": -1
// }
// For debugging tests, you can set the maxStringLen in settings.json like this:
// "go.delveConfig": {
// "dlvLoadConfig": {
// "followPointers": true,
// "maxVariableRecurse": 1,
// "maxStringLen": 5000,
// "maxArrayValues": 64,
// "maxStructFields": -1
// },
// "apiVersion": 2,
// "showGlobalVariables": true
// }
// Open a new Debug Visualizer and visualize "s"
func main() {
rand.Seed(time.Now().UnixNano())
graph := NewGraph()
var s string
for i := 0; i < 100; i++ {
id := strconv.Itoa(i)
graph.Nodes = append(graph.Nodes, NodeGraphData{
ID: id,
Label: id,
})
if i > 0 {
targetId := rand.Intn(i)
graph.Edges = append(graph.Edges, EdgeGraphData{
From: id,
To: strconv.Itoa(targetId),
})
}
s = graph.toString()
_ = s
//fmt.Printf("%s", s)
}
}
type Graph struct {
Kind map[string]bool `json:"kind"`
Nodes []NodeGraphData `json:"nodes"`
Edges []EdgeGraphData `json:"edges"`
}
type NodeGraphData struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Color string `json:"color,omitempty"`
Shape string `json:"shape,omitempty"`
}
type EdgeGraphData struct {
From string `json:"from"`
To string `json:"to"`
Label string `json:"label,omitempty"`
ID string `json:"id"`
Color string `json:"color,omitempty"`
Dashes bool `json:"dashes,omitempty"`
}
func NewGraph() *Graph {
return &Graph{
Kind: map[string]bool{"graph": true},
Nodes: []NodeGraphData{},
Edges: []EdgeGraphData{},
}
}
func (this *Graph) toString() string {
rs, _ := json.Marshal(this)
return string(rs)
}
================================================
FILE: demos/golang/go.mod
================================================
module demo
go 1.13
================================================
FILE: demos/java/.classpath
================================================
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-annotations-2.9.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-core-2.9.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-databind-2.9.8.jar"/>
</classpath>
================================================
FILE: demos/java/.gitignore
================================================
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
!lib/**
================================================
FILE: demos/java/.project
================================================
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>java</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1599063072264</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
================================================
FILE: demos/java/.settings/org.eclipse.jdt.core.prefs
================================================
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=10
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=11
================================================
FILE: demos/java/.vscode/launch.json
================================================
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - DemoLinkedLists",
"request": "launch",
"mainClass": "DemoLinkedLists"
},
{
"name": "Java - Demo",
"type": "java",
"request": "launch",
"projectName": "java"
}
]
}
================================================
FILE: demos/java/.vscode/settings.json
================================================
{
"java.dependency.packagePresentation": "flat",
"java.dependency.syncWithFolderExplorer": true,
"debugVisualizer.debugAdapterConfigurations": {}
}
================================================
FILE: demos/java/src/app/App.java
================================================
package app;
import app.GraphData.EdgeInfo;
public class App {
public static void main(String[] args) {
// watch `list.visualize()`
LinkedList<String> list = new LinkedList<String>();
list.append("1");
list.append("2");
list.append("3");
list.append("4");
}
}
class LinkedList<T> {
private Node<T> head;
public void append(T value) {
if (head == null) {
head = new Node<T>(value);
} else {
Node<T> m = head;
while (m.next != null) {
m = m.next;
}
m.next = new Node<T>(value);
}
}
public String visualize() {
Node<T> list = new Node<T>(null);
list.next = this.head;
return GraphData.from(list, (item, info) -> {
if (item != list) {
info.id = item.value.toString();
} else {
info.label = "list";
}
if (item.next != null) {
EdgeInfo<LinkedList.Node<T>> ei = info.addEdge(item.next);
ei.label = "next";
}
return info;
}).toString();
}
static class Node<T> {
public T value;
public Node<T> next;
public Node(T value) {
this.value = value;
}
}
}
================================================
FILE: demos/java/src/app/ExtractedData.java
================================================
package app;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public abstract class ExtractedData {
public HashMap<String, Boolean> getKind() {
HashMap<String, Boolean> m = new HashMap<>();
for (String s : getTags()) {
m.put(s, true);
}
return m;
}
@JsonIgnore
protected abstract String[] getTags();
@Override
public String toString() {
ObjectMapper objectMapper = new ObjectMapper();
try {
String val = objectMapper.writeValueAsString(this);
return val;
} catch (JsonProcessingException e) {
return "JsonProcessingException";
}
}
}
================================================
FILE: demos/java/src/app/GraphData.java
================================================
package app;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
public class GraphData extends ExtractedData {
private List<NodeData> nodes = new ArrayList<>();
private List<EdgeData> edges = new ArrayList<>();
@Override
protected String[] getTags() {
return new String[] { "graph" };
}
public List<NodeData> getNodes() {
return this.nodes;
}
public List<EdgeData> getEdges() {
return this.edges;
}
@JsonInclude(Include.NON_NULL)
public static class NodeData {
private String id;
private String label; // can be null
private String color; // can be null
private String shape; // can be null
public NodeData(String id) {
this.id = id;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public String getColor() {
return this.color;
}
public void setColor(String color) {
this.color = color;
}
public String getShape() {
return this.shape;
}
public void setShape(String shape) {
this.shape = shape;
}
}
@JsonInclude(Include.NON_NULL)
public static class EdgeData {
private String from;
private String to;
private String label; // Can be null
private String id; // Can be null
private String color; // Can be null
private Boolean dashes; // Can be null
public EdgeData(String from, String to) {
this.from = from;
this.to = to;
}
public String getFrom() {
return this.from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return this.to;
}
public void setTo(String to) {
this.to = to;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getColor() {
return this.color;
}
public void setColor(String color) {
this.color = color;
}
public Boolean getDashes() {
return this.dashes;
}
public void setDashes(Boolean dashes) {
this.dashes = dashes;
}
}
public interface NodeInfoProvider<T> {
public NodeInfo<T> getNodeInfo(T item, NodeInfo<T> nodeInfo);
}
public static <T> GraphData from(T item, NodeInfoProvider<T> f) {
GraphData d = new GraphData();
ArrayDeque<T> q = new ArrayDeque<>();
q.add(item);
FromState<T> s = new FromState<>(f);
while (q.size() > 0) {
NodeInfo<T> nodeInfo = s.getNodeInfo(q.removeFirst());
NodeData nd = new NodeData(s.getId(nodeInfo));
d.nodes.add(nd);
nd.setLabel(nodeInfo.label);
nd.setColor(nodeInfo.color);
for (EdgeInfo<T> e : nodeInfo.edges) {
EdgeData ed = new EdgeData(nd.id, s.getId(s.getNodeInfo(e.to)));
d.edges.add(ed);
ed.setLabel(e.label);
ed.setId(e.id);
q.add(e.to);
}
}
return d;
}
static class FromState<T> {
private int i = 0;
private NodeInfoProvider<T> provider;
private HashMap<T, NodeInfo<T>> infos = new HashMap<>();
public FromState(NodeInfoProvider<T> provider) {
this.provider = provider;
}
public String getId(NodeInfo<T> nodeInfo) {
if (nodeInfo.id == null) {
nodeInfo.id = "hediet.de/" + (i++);
}
return nodeInfo.id;
}
public NodeInfo<T> getNodeInfo(T item) {
if (infos.containsKey(item)) {
return infos.get(item);
}
NodeInfo<T> info = this.provider.getNodeInfo(item, new NodeInfo<>());
infos.put(item, info);
return info;
}
}
public static class NodeInfo<T> {
public ArrayList<EdgeInfo<T>> edges = new ArrayList<EdgeInfo<T>>();
public String label; // Can be null.
public String id; // Can be null.
public String color; // Can be null.
public EdgeInfo<T> addEdge(T to) {
EdgeInfo<T> i = new EdgeInfo<>(to);
this.edges.add(i);
return i;
}
}
public static class EdgeInfo<T> {
public T to;
public String label; // Can be null.
public String id; // Can be null.
public EdgeInfo(T to) {
this.to = to;
}
}
}
================================================
FILE: demos/java/src/app/TextData.java
================================================
package app;
public class TextData extends ExtractedData {
private final String textValue;
public TextData(String text) {
this.textValue = text;
}
@Override
protected String[] getTags() {
return new String[] { "text" };
}
public String getText() {
return this.textValue;
}
}
================================================
FILE: demos/js/.vscode/settings.json
================================================
{
"editor.minimap.enabled": false,
"git.enabled": false,
"typescript.tsc.autoDetect": "off",
"debugVisualizer.js.customScriptPaths": [
"${workspaceFolder}/custom-visualizer.js",
]
}
================================================
FILE: demos/js/.vscode/tasks.json
================================================
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
================================================
FILE: demos/js/README.md
================================================
# JS Demos
Simply run `yarn` and select the launch target you want to debug in the debugger pane of VS Code.
================================================
FILE: demos/js/custom-visualizer.js
================================================
// @ts-check
/**
* @type {import("@hediet/debug-visualizer-data-extraction").LoadDataExtractorsFn}
*/
module.exports = (register, helpers) => {
register({
id: "map",
getExtractions(data, collector, context) {
if (!(data instanceof Map)) {
return;
}
collector.addExtraction({
priority: 1000,
id: "map",
name: "Map",
extractData() {
return helpers.asData({
kind: { table: true },
rows: [...data].map(([k, v]) => ({ key: k, value: v }))
});
},
});
},
});
register({
id: "binaryViewer",
getExtractions(data, collector, context) {
if (typeof data !== "number") {
return;
}
/*
context.addCallFrameRequest({
methodName: "Module._load",
pathRegExp: ".*",
});
context.addCallFrameRequest({
methodName: "LinkedList.insertAt",
pathRegExp: ".*",
});*/
collector.addExtraction({
priority: 10000,
id: "binary",
name: "Bits of Integer",
extractData() {
return context.extract(JSON.stringify(context.callFrameInfos, undefined, 4));
return helpers.asData({
kind: { text: true },
text: data.toString(2),
});
},
});
},
});
};
================================================
FILE: demos/js/package.json
================================================
{
"name": "demo",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@hediet/node-reload": "0.7.3",
"@types/node": "^13.7.4",
"node-fetch": "^2.6.1",
"typescript": "^3.8.2"
},
"scripts": {
"dev": "tsc --watch"
}
}
================================================
FILE: demos/js/src/MockLanguageServiceHost.ts
================================================
import * as ts from "typescript";
export class MockLanguageServiceHost implements ts.LanguageServiceHost {
constructor(
private readonly files: Map<string, string>,
private readonly compilationSettings: ts.CompilerOptions
) {}
getScriptFileNames(): string[] {
return [...this.files.keys()];
}
getScriptVersion(fileName: string): string {
return ""; // our files don't change
}
getScriptSnapshot(fileName: string): ts.IScriptSnapshot | undefined {
const content = this.files.get(fileName);
if (!content) {
return undefined;
}
return {
dispose() {},
getChangeRange: () => undefined,
getLength: () => content.length,
getText: (start, end) => content.substr(start, end - start),
};
}
getCompilationSettings(): ts.CompilerOptions {
return this.compilationSettings;
}
getCurrentDirectory(): string {
return "/";
}
getDefaultLibFileName(options: ts.CompilerOptions): string {
return ts.getDefaultLibFileName(options);
}
}
================================================
FILE: demos/js/src/demo_address_book.ts
================================================
class Person {
constructor(public id: number, public firstName: string, public lastName: string, public email: string, public gender: string, public company: string) {
}
}
class Company {
constructor(public id: number, public name: string, public street: string, public email: string) { }
}
class AddressBook {
public static loadPersons(): Person[] {
const contactsData = [{
"id": 1,
"first_name": "Burg",
"last_name": "Legg",
"email": "blegg0@elpais.com",
"gender": "Male",
"company": "Zoozzy"
}, {
"id": 2,
"first_name": "Erminia",
"last_name": "Heersema",
"email": "eheersema1@jugem.jp",
"gender": "Female",
"company": "Skipfire"
}, {
"id": 3,
"first_name": "Penrod",
"last_name": "Claxton",
"email": "pclaxton2@furl.net",
"gender": "Male",
"company": "Dabvine"
}, {
"id": 4,
"first_name": "Peterus",
"last_name": "Alabone",
"email": "palabone3@icio.us",
"gender": "Male",
"company": "Gabtune"
}, {
"id": 5,
"first_name": "Rickie",
"last_name": "Belsher",
"email": "rbelsher4@marketwatch.com",
"gender": "Male",
"company": "Digitube"
}, {
"id": 6,
"first_name": "Griffie",
"last_name": "Poulsum",
"email": "gpoulsum5@printfriendly.com",
"gender": "Male",
"company": "Mymm"
}, {
"id": 7,
"first_name": "Fidelio",
"last_name": "Gateland",
"email": "fgateland6@intel.com",
"gender": "Male",
"company": "Meeveo"
}, {
"id": 8,
"first_name": "Fayth",
"last_name": "D'Oyly",
"email": "fdoyly7@twitter.com",
"gender": "Female",
"company": "Podcat"
}, {
"id": 9,
"first_name": "Janela",
"last_name": "Shelton",
"email": "jshelton8@dion.ne.jp",
"gender": "Female",
"company": "Kayveo"
}, {
"id": 10,
"first_name": "Yance",
"last_name": "Vatcher",
"email": "yvatcher9@ask.com",
"gender": "Male",
"company": "Photobug"
}, {
"id": 11,
"first_name": "Filippo",
"last_name": "Timoney",
"email": "ftimoneya@spotify.com",
"gender": "Male",
"company": "Rhyzio"
}, {
"id": 12,
"first_name": "Helli",
"last_name": "Friskey",
"email": "hfriskeyb@usa.gov",
"gender": "Female",
"company": "Eare"
}, {
"id": 13,
"first_name": "Enos",
"last_name": "Connick",
"email": "econnickc@sitemeter.com",
"gender": "Male",
"company": "Meetz"
}, {
"id": 14,
"first_name": "Lorri",
"last_name": "Chessun",
"email": "lchessund@wp.com",
"gender": "Female",
"company": "Jaxworks"
}, {
"id": 15,
"first_name": "Justina",
"last_name": "Spedroni",
"email": "jspedronie@abc.net.au",
"gender": "Female",
"company": "Rhyzio"
}, {
"id": 16,
"first_name": "Odilia",
"last_name": "Ealden",
"email": "oealdenf@fastcompany.com",
"gender": "Female",
"company": "Blognation"
}, {
"id": 17,
"first_name": "Dale",
"last_name": "Bretherick",
"email": "dbretherickg@dmoz.org",
"gender": "Male",
"company": "Skipfire"
}, {
"id": 18,
"first_name": "Syman",
"last_name": "Lawdham",
"email": "slawdhamh@so-net.ne.jp",
"gender": "Male",
"company": "Wordify"
}, {
"id": 19,
"first_name": "Catarina",
"last_name": "Stoile",
"email": "cstoilei@hud.gov",
"gender": "Female",
"company": "Avaveo"
}, {
"id": 20,
"first_name": "Simonette",
"last_name": "Danett",
"email": "sdanettj@eepurl.com",
"gender": "Female",
"company": "Realblab"
}, {
"id": 21,
"first_name": "Fielding",
"last_name": "MacHarg",
"email": "fmachargk@blogtalkradio.com",
"gender": "Male",
"company": "Photolist"
}, {
"id": 22,
"first_name": "Anni",
"last_name": "Hounsom",
"email": "ahounsoml@wikia.com",
"gender": "Female",
"company": "Devify"
}, {
"id": 23,
"first_name": "Evelin",
"last_name": "Gaytor",
"email": "egaytorm@myspace.com",
"gender": "Male",
"company": "Aivee"
}, {
"id": 24,
"first_name": "Lynde",
"last_name": "Itscowicz",
"email": "litscowiczn@fc2.com",
"gender": "Female",
"company": "Skipfire"
}, {
"id": 25,
"first_name": "Reta",
"last_name": "Felipe",
"email": "rfelipeo@free.fr",
"gender": "Female",
"company": "Ainyx"
}, {
"id": 26,
"first_name": "Bar",
"last_name": "Shillingford",
"email": "bshillingfordp@sun.com",
"gender": "Male",
"company": "Skilith"
}, {
"id": 27,
"first_name": "Mel",
"last_name": "Cooch",
"email": "mcoochq@icq.com",
"gender": "Female",
"company": "Meevee"
}, {
"id": 28,
"first_name": "Wheeler",
"last_name": "Kettlesting",
"email": "wkettlestingr@miitbeian.gov.cn",
"gender": "Male",
"company": "Mybuzz"
}, {
"id": 29,
"first_name": "Corabel",
"last_name": "Pordall",
"email": "cpordalls@sourceforge.net",
"gender": "Female",
"company": "Blogtag"
}, {
"id": 30,
"first_name": "Merrily",
"last_name": "Weatherhill",
"email": "mweatherhillt@printfriendly.com",
"gender": "Female",
"company": "Divape"
}, {
"id": 31,
"first_name": "Reynard",
"last_name": "Osgodby",
"email": "rosgodbyu@eepurl.com",
"gender": "Male",
"company": "Yakijo"
}, {
"id": 32,
"first_name": "Guilbert",
"last_name": "Bilston",
"email": "gbilstonv@devhub.com",
"gender": "Male",
"company": "Vinder"
}, {
"id": 33,
"first_name": "Farr",
"last_name": "Skehan",
"email": "fskehanw@t-online.de",
"gender": "Male",
"company": "Linkbuzz"
}, {
"id": 34,
"first_name": "Roger",
"last_name": "Langelay",
"email": "rlangelayx@pcworld.com",
"gender": "Male",
"company": "Tekfly"
}, {
"id": 35,
"first_name": "Jemmy",
"last_name": "Yggo",
"email": "jyggoy@ifeng.com",
"gender": "Female",
"company": "Jabberstorm"
}, {
"id": 36,
"first_name": "Cybill",
"last_name": "Chastaing",
"email": "cchastaingz@mayoclinic.com",
"gender": "Female",
"company": "Riffpedia"
}, {
"id": 37,
"first_name": "Samuele",
"last_name": "Zorzoni",
"email": "szorzoni10@opensource.org",
"gender": "Male",
"company": "Devcast"
}, {
"id": 38,
"first_name": "Svend",
"last_name": "Hamill",
"email": "shamill11@google.co.jp",
"gender": "Male",
"company": "Kwilith"
}, {
"id": 39,
"first_name": "Carlin",
"last_name": "Roote",
"email": "croote12@gov.uk",
"gender": "Male",
"company": "Twitterlist"
}, {
"id": 40,
"first_name": "Dawna",
"last_name": "Lanfer",
"email": "dlanfer13@mlb.com",
"gender": "Female",
"company": "Jayo"
}, {
"id": 41,
"first_name": "Melissa",
"last_name": "Chappelow",
"email": "mchappelow14@usa.gov",
"gender": "Female",
"company": "Skibox"
}, {
"id": 42,
"first_name": "George",
"last_name": "Hargreaves",
"email": "ghargreaves15@pagesperso-orange.fr",
"gender": "Female",
"company": "Zazio"
}, {
"id": 43,
"first_name": "Sampson",
"last_name": "Steaning",
"email": "ssteaning16@state.gov",
"gender": "Male",
"company": "Jaxworks"
}, {
"id": 44,
"first_name": "Brana",
"last_name": "Wims",
"email": "bwims17@icio.us",
"gender": "Female",
"company": "Flashset"
}, {
"id": 45,
"first_name": "Shawn",
"last_name": "Saffen",
"email": "ssaffen18@shutterfly.com",
"gender": "Male",
"company": "Twitterwire"
}, {
"id": 46,
"first_name": "Alessandro",
"last_name": "Gasker",
"email": "agasker19@slashdot.org",
"gender": "Male",
"company": "Dabtype"
}, {
"id": 47,
"first_name": "Bobby",
"last_name": "Mulcock",
"email": "bmulcock1a@time.com",
"gender": "Female",
"company": "Quamba"
}, {
"id": 48,
"first_name": "Ashlen",
"last_name": "Midner",
"email": "amidner1b@devhub.com",
"gender": "Female",
"company": "Thoughtstorm"
}, {
"id": 49,
"first_name": "Mallory",
"last_name": "Joel",
"email": "mjoel1c@upenn.edu",
"gender": "Male",
"company": "Twitterbeat"
}, {
"id": 50,
"first_name": "Maximilian",
"last_name": "Scraggs",
"email": "mscraggs1d@ucla.edu",
"gender": "Male",
"company": "Twiyo"
}, {
"id": 51,
"first_name": "Beverlie",
"last_name": "Pittet",
"email": "bpittet1e@github.io",
"gender": "Female",
"company": "Riffpath"
}, {
"id": 52,
"first_name": "Enrique",
"last_name": "Rentilll",
"email": "erentilll1f@smugmug.com",
"gender": "Male",
"company": "Blognation"
}, {
"id": 53,
"first_name": "Cathrin",
"last_name": "McKendry",
"email": "cmckendry1g@hc360.com",
"gender": "Female",
"company": "Shuffledrive"
}, {
"id": 54,
"first_name": "Isabeau",
"last_name": "Quincey",
"email": "iquincey1h@msn.com",
"gender": "Female",
"company": "Tagcat"
}, {
"id": 55,
"first_name": "Geoffrey",
"last_name": "Grzegorczyk",
"email": "ggrzegorczyk1i@loc.gov",
"gender": "Male",
"company": "Youfeed"
}, {
"id": 56,
"first_name": "Ruggiero",
"last_name": "Vaar",
"email": "rvaar1j@unesco.org",
"gender": "Male",
"company": "Babbleset"
}, {
"id": 57,
"first_name": "Alfonso",
"last_name": "Tarzey",
"email": "atarzey1k@weebly.com",
"gender": "Male",
"company": "Pixonyx"
}, {
"id": 58,
"first_name": "Marylin",
"last_name": "Bissex",
"email": "mbissex1l@microsoft.com",
"gender": "Female",
"company": "Tagfeed"
}, {
"id": 59,
"first_name": "Cathryn",
"last_name": "Morhall",
"email": "cmorhall1m@irs.gov",
"gender": "Female",
"company": "Tagopia"
}, {
"id": 60,
"first_name": "Terza",
"last_name": "Easey",
"email": "teasey1n@thetimes.co.uk",
"gender": "Female",
"company": "Devcast"
}, {
"id": 61,
"first_name": "Hale",
"last_name": "Gaudon",
"email": "hgaudon1o@webnode.com",
"gender": "Male",
"company": "Quinu"
}, {
"id": 62,
"first_name": "Hadley",
"last_name": "Elwood",
"email": "helwood1p@japanpost.jp",
"gender": "Male",
"company": "Plajo"
}, {
"id": 63,
"first_name": "Seamus",
"last_name": "Straker",
"email": "sstraker1q@live.com",
"gender": "Male",
"company": "Yoveo"
}, {
"id": 64,
"first_name": "Urbano",
"last_name": "Gisbey",
"email": "ugisbey1r@sitemeter.com",
"gender": "Male",
"company": "Quinu"
}, {
"id": 65,
"first_name": "Gerri",
"last_name": "McInulty",
"email": "gmcinulty1s@businessinsider.com",
"gender": "Male",
"company": "Agimba"
}, {
"id": 66,
"first_name": "Lena",
"last_name": "Gonthier",
"email": "lgonthier1t@newsvine.com",
"gender": "Female",
"company": "Geba"
}, {
"id": 67,
"first_name": "Ameline",
"last_name": "Wheatcroft",
"email": "awheatcroft1u@163.com",
"gender": "Female",
"company": "Twitternation"
}, {
"id": 68,
"first_name": "Kathryn",
"last_name": "Castelli",
"email": "kcastelli1v@about.com",
"gender": "Female",
"company": "Photospace"
}, {
"id": 69,
"first_name": "Terrell",
"last_name": "Walicki",
"email": "twalicki1w@amazon.co.jp",
"gender": "Male",
"company": "Babblestorm"
}, {
"id": 70,
"first_name": "Claudianus",
"last_name": "Tremathack",
"email": "ctremathack1x@walmart.com",
"gender": "Male",
"company": "Skyndu"
}, {
"id": 71,
"first_name": "Sanford",
"last_name": "Devinn",
"email": "sdevinn1y@ehow.com",
"gender": "Male",
"company": "Dynazzy"
}, {
"id": 72,
"first_name": "Gwendolen",
"last_name": "Turfrey",
"email": "gturfrey1z@va.gov",
"gender": "Female",
"company": "Yacero"
}, {
"id": 73,
"first_name": "Alta",
"last_name": "Leap",
"email": "aleap20@ezinearticles.com",
"gender": "Female",
"company": "Twitterlist"
}, {
"id": 74,
"first_name": "Johnath",
"last_name": "Andrzejowski",
"email": "jandrzejowski21@google.com.hk",
"gender": "Female",
"company": "Lazzy"
}, {
"id": 75,
"first_name": "Yancy",
"last_name": "Askham",
"email": "yaskham22@sciencedaily.com",
"gender": "Male",
"company": "Yabox"
}, {
"id": 76,
"first_name": "Paula",
"last_name": "Warder",
"email": "pwarder23@harvard.edu",
"gender": "Female",
"company": "Zooxo"
}, {
"id": 77,
"first_name": "Grannie",
"last_name": "Hauxley",
"email": "ghauxley24@symantec.com",
"gender": "Male",
"company": "Yakidoo"
}, {
"id": 78,
"first_name": "Enid",
"last_name": "Grealy",
"email": "egrealy25@homestead.com",
"gender": "Female",
"company": "Gabcube"
}, {
"id": 79,
"first_name": "Lazarus",
"last_name": "Itscowicz",
"email": "litscowicz26@epa.gov",
"gender": "Male",
"company": "Demizz"
}, {
"id": 80,
"first_name": "Marmaduke",
"last_name": "Gilligan",
"email": "mgilligan27@tiny.cc",
"gender": "Male",
"company": "Yombu"
}, {
"id": 81,
"first_name": "Linnell",
"last_name": "Chree",
"email": "lchree28@ocn.ne.jp",
"gender": "Female",
"company": "Buzzshare"
}, {
"id": 82,
"first_name": "Pavia",
"last_name": "Pocke",
"email": "ppocke29@newsvine.com",
"gender": "Female",
"company": "Eidel"
}, {
"id": 83,
"first_name": "Golda",
"last_name": "Stuchburie",
"email": "gstuchburie2a@oaic.gov.au",
"gender": "Female",
"company": "Flipstorm"
}, {
"id": 84,
"first_name": "Trace",
"last_name": "Lodge",
"email": "tlodge2b@whitehouse.gov",
"gender": "Male",
"company": "Zazio"
}, {
"id": 85,
"first_name": "Nikolia",
"last_name": "Bartolomivis",
"email": "nbartolomivis2c@opensource.org",
"gender": "Female",
"company": "Devshare"
}, {
"id": 86,
"first_name": "Dela",
"last_name": "Wimp",
"email": "dwimp2d@miitbeian.gov.cn",
"gender": "Female",
"company": "Wordware"
}, {
"id": 87,
"first_name": "Rustie",
"last_name": "Drury",
"email": "rdrury2e@sun.com",
"gender": "Male",
"company": "Youbridge"
}, {
"id": 88,
"first_name": "Phedra",
"last_name": "Shrimptone",
"email": "pshrimptone2f@unicef.org",
"gender": "Female",
"company": "Realcube"
}, {
"id": 89,
"first_name": "Alaster",
"last_name": "Vittori",
"email": "avittori2g@senate.gov",
"gender": "Male",
"company": "Livepath"
}, {
"id": 90,
"first_name": "Pascal",
"last_name": "Neissen",
"email": "pneissen2h@mediafire.com",
"gender": "Male",
"company": "Mydo"
}, {
"id": 91,
"first_name": "Brian",
"last_name": "Manuel",
"email": "bmanuel2i@blog.com",
"gender": "Male",
"company": "Roomm"
}, {
"id": 92,
"first_name": "Jen",
"last_name": "Laydon",
"email": "jlaydon2j@hubpages.com",
"gender": "Female",
"company": "Plambee"
}, {
"id": 93,
"first_name": "Beltran",
"last_name": "Brandoni",
"email": "bbrandoni2k@digg.com",
"gender": "Male",
"company": "Yacero"
}, {
"id": 94,
"first_name": "Sarene",
"last_name": "Gaymar",
"email": "sgaymar2l@surveymonkey.com",
"gender": "Female",
"company": "Katz"
}, {
"id": 95,
"first_name": "Iormina",
"last_name": "Peedell",
"email": "ipeedell2m@seattletimes.com",
"gender": "Female",
"company": "Youfeed"
}, {
"id": 96,
"first_name": "Abigail",
"last_name": "Kielty",
"email": "akielty2n@npr.org",
"gender": "Female",
"company": "Reallinks"
}, {
"id": 97,
"first_name": "Hallie",
"last_name": "Toomey",
"email": "htoomey2o@google.com.au",
"gender": "Female",
"company": "Flipbug"
}, {
"id": 98,
"first_name": "Sergeant",
"last_name": "Pourveer",
"email": "spourveer2p@amazon.co.uk",
"gender": "Male",
"company": "Skinix"
}, {
"id": 99,
"first_name": "Elfie",
"last_name": "McKinlay",
"email": "emckinlay2q@xrea.com",
"gender": "Female",
"company": "Devcast"
}, {
"id": 100,
"first_name": "Wainwright",
"last_name": "Juggins",
"email": "wjuggins2r@tamu.edu",
"gender": "Male",
"company": "Topiclounge"
}];
const contacts = contactsData.map(d => new Person(d.id, d.first_name, d.last_name, d.email, d.gender, d.company));
return contacts;
}
public static loadCompanies() {
const companies = [{
"id": 101,
"city": "Lakshmīpur",
"street": "36300 Lake View Center",
"email": "ogovier0@gmpg.org",
"company": "Fiveclub"
}, {
"id": 102,
"city": "El Quetzal",
"street": "551 New Castle Parkway",
"email": "elander1@g.co",
"company": "Twitterwire"
}, {
"id": 103,
"city": "Mayakovski",
"street": "1 Norway Maple Center",
"email": "dcustance2@hostgator.com",
"company": "Jabbersphere"
}, {
"id": 104,
"city": "Al Jawādīyah",
"street": "02 Carey Hill",
"email": "evanoort3@sciencedaily.com",
"company": "Zoovu"
}, {
"id": 105,
"city": "Girona",
"street": "3 Lillian Center",
"email": "dducker4@cbsnews.com",
"company": "Innojam"
}, {
"id": 106,
"city": "Vouani",
"street": "5165 Vera Avenue",
"email": "orzehorz5@arizona.edu",
"company": "Zoovu"
}, {
"id": 107,
"city": "Caibarién",
"street": "3739 Burrows Drive",
"email": "ltrahair6@pinterest.com",
"company": "Quamba"
}, {
"id": 108,
"city": "Wushi",
"street": "88 Bay Hill",
"email": "plebourn7@springer.com",
"company": "Feednation"
}, {
"id": 109,
"city": "Zbýšov",
"street": "38 Dovetail Place",
"email": "slace8@netscape.com",
"company": "Zoomzone"
}, {
"id": 110,
"city": "Nová Cerekev",
"street": "90194 Dixon Avenue",
"email": "mdoxey9@goo.gl",
"company": "Devpoint"
}];
return companies.map(c => new Company(c.id, c.company, c.street, c.email));
}
public static loadContacts() {
const result = new Array<Person | Company>();
result.push(...this.loadPersons());
result.push(...this.loadCompanies());
let idx = 0;
while (idx++ < 1000) {
const i = Math.round(Math.random() * (result.length - 1));
const j = Math.round(Math.random() * (result.length - 1));
const temp = result[i];
result[i] = result[j];
result[j] = temp;
}
return result;
}
}
const contacts = AddressBook.loadContacts();
debugger;
================================================
FILE: demos/js/src/demo_custom-data-extractor.ts
================================================
import { getDataExtractorApi } from "@hediet/debug-visualizer-data-extraction";
// Registers all existing extractors.
getDataExtractorApi().registerDefaultExtractors();
getDataExtractorApi().registerExtractor({
id: "my-extractor",
getExtractions: (data, collector) => {
if (data instanceof Foo) {
collector.addExtraction({
id: "my-extractor",
name: "My Extractor",
priority: 2000,
extractData: () => ({ kind: { text: true }, text: "Foo" }),
});
}
},
});
setTimeout(() => {
new Main().run();
}, 0);
class Foo {}
class Main {
run() {
const f = new Foo();
// visualize `f` here!
debugger;
}
}
================================================
FILE: demos/js/src/demo_doubly-linked-list.ts
================================================
import {
getDataExtractorApi,
createGraphFromPointers,
} from "@hediet/debug-visualizer-data-extraction";
getDataExtractorApi().registerDefaultExtractors();
setTimeout(() => {
new Main().run();
}, 0);
class Main {
/** @pure */
run() {
id = 0;
const head = new DoublyLinkedListNode("1");
head.setNext(new DoublyLinkedListNode("2"));
head.next!.setNext(new DoublyLinkedListNode("3"));
const tail = new DoublyLinkedListNode("4");
head.next!.next!.setNext(tail);
reverse(new DoublyLinkedList(head, tail));
console.log("finished");
}
}
function reverse(list: DoublyLinkedList) {
// Open a new Debug Visualizer
// and enter `visualize()`!
const visualize = () =>
createGraphFromPointers(
{
last,
"list.head": list.head,
"list.tail": list.tail
},
i => ({
id: i.id,
label: i.name,
color: finished.has(i) ? "lime" : "lightblue",
edges: [
{ to: i.next!, label: "next", color: "lightblue", },
{ to: i.prev!, label: "prev", color: "lightgray" },
].filter(r => !!r.to),
}));
// Finished nodes have correct pointers,
// their next node is also finished.
const finished = new Set();
var last: DoublyLinkedListNode | null = null;
list.tail = list.head;
while (list.head) {
list.head.prev = list.head.next;
list.head.next = last;
finished.add(list.head);
last = list.head;
list.head = list.head.prev;
}
list.head = last;
}
class DoublyLinkedList {
constructor(
public head: DoublyLinkedListNode | null,
public tail: DoublyLinkedListNode | null
) { }
}
let id = 0;
class DoublyLinkedListNode {
public readonly id = (id++).toString();
constructor(public name: string) { }
next: DoublyLinkedListNode | null = null;
prev: DoublyLinkedListNode | null = null;
public setNext(val: DoublyLinkedListNode): void {
val.prev = this;
this.next = val;
}
}
================================================
FILE: demos/js/src/demo_fetch.js
================================================
const fetch = require("node-fetch");
fetch("https://jsonplaceholder.typicode.com/users")
.then((response) => response.json())
.then((json) => {
debugger;
});
================================================
FILE: demos/js/src/demo_random-walks.ts
================================================
// visualize `data`
const data = new Array<number>();
let curValue = 0;
for (let j = 0; j < 100; j++) {
addManyRandomValues();
}
function addManyRandomValues() {
for (let i = 0; i < 100; i++) {
addRandomValue();
}
}
function addRandomValue() {
const delta = Math.random()
> 0.5 ? 1 : -1;
data.push(curValue);
curValue += delta;
}
================================================
FILE: demos/js/src/demo_singly-linked-list.js
================================================
// See https://codeburst.io/linked-lists-in-javascript-es6-code-part-1-6dd349c3dcc3
/*
After install the Debug Visualizer extension,
press F1, enter "Open Debug Visualizer" and
use the following code as expression to visualize.
Then, press F5 and chose "node".
```
hedietDbgVis.createGraphFromPointers(
hedietDbgVis.tryEval([
"list.head",
"newNode",
"node",
"previous",
this.constructor.name === "LinkedList" ? "this.head" : "err",
]),
n => ({
id: n.data,
color: "lightblue",
label: `${n.data}`,
edges: [{ to: n.next, label: "next" }].filter(i => !!i.to),
})
)
```
*/
class LinkedList {
constructor() {
this.head = null;
}
}
class Node {
constructor(data, next = null) {
(this.data = data), (this.next = next);
}
}
LinkedList.prototype.insertAtBeginning = function(data) {
// A newNode object is created with property data
// and next = null
let newNode = new Node(data);
// The pointer next is assigned head pointer
// so that both pointers now point at the same node.
newNode.next = this.head;
// As we are inserting at the beginning the head pointer
// needs to now point at the newNode.
this.head = newNode;
return this.head;
};
LinkedList.prototype.getAt = function(index) {
let counter = 0;
let node = this.head;
while (node) {
if (counter === index) {
return node;
}
counter++;
node = node.next;
}
return null;
};
// The insertAt() function contains the steps to insert
// a node at a given index.
LinkedList.prototype.insertAt = function(data, index) {
// if the list is empty i.e. head = null
if (!this.head) {
this.head = new Node(data);
return;
}
// if new node needs to be inserted at the front
// of the list i.e. before the head.
if (index === 0) {
this.head = new Node(data, this.head);
return;
}
// else, use getAt() to find the previous node.
const previous = this.getAt(index - 1);
let newNode = new Node(data);
newNode.next = previous.next;
previous.next = newNode;
return this.head;
};
const list = new LinkedList();
debugger; // Press F10 to continue
list.insertAtBeginning("4");
list.insertAtBeginning("3");
list.insertAtBeginning("2");
list.insertAtBeginning("1");
list.insertAt("3.5", 3);
console.log("finished");
// Some Plotting.
// Use `data` as expression to visualize.
const data = [];
for (let x = 0; x < 1000; x += 1) {
data.push(Math.sin(x / 10));
if (x % 10 === 0) {
console.log("step");
}
}
================================================
FILE: demos/js/src/demo_sorting.ts
================================================
import { getDataExtractorApi } from "@hediet/debug-visualizer-data-extraction";
getDataExtractorApi().registerDefaultExtractors();
/*
Visualize this expression:
```ts
hedietDbgVis.markedGrid(
array,
hedietDbgVis.tryEval(["i", "j", "left", "right"])
)
```
*/
// From https://github.com/AvraamMavridis/Algorithms-Data-Structures-in-Typescript/blob/master/algorithms/quickSort.md
/** @pure */
function main() {
const array = [1, 2, 33, 31, 1, 2, 63, 123, 6, 32, 943, 346, 24];
const sorted = quickSort(array, 0, array.length - 1);
console.log(sorted);
}
main();
function swap(array: Array<number>, i: number, j: number) {
[array[i], array[j]] = [array[j], array[i]];
}
/**
* Split array and swap values
*
* @param {Array<number>} array
* @param {number} [left=0]
* @param {number} [right=array.length - 1]
* @returns {number}
*/
function partition(
array: Array<number>,
left: number = 0,
right: number = array.length - 1
) {
const pivot = Math.floor((right + left) / 2);
const pivotVal = array[pivot];
let i = left;
let j = right;
while (i <= j) {
while (array[i] < pivotVal) {
i++;
}
while (array[j] > pivotVal) {
j--;
}
if (i <= j) {
swap(array, i, j);
i++;
j--;
}
}
return i;
}
/**
* Quicksort implementation
*
* @param {Array<number>} array
* @param {number} [left=0]
* @param {number} [right=array.length - 1]
* @returns {Array<number>}
*/
function quickSort(
array: Array<number>,
left: number = 0,
right: number = array.length - 1
) {
let index;
if (array.length > 1) {
index = partition(array, left, right);
if (left < index - 1) {
quickSort(array, left, index - 1);
}
if (index < right) {
quickSort(array, index, right);
}
}
return array;
}
================================================
FILE: demos/js/src/demo_stack-frames.js
================================================
function test() {
let i = 1;
debugger;
}
let i = 0;
test();
================================================
FILE: demos/js/src/demo_typescript-asts.ts
================================================
import * as ts from "typescript";
import { getDataExtractorApi } from "@hediet/debug-visualizer-data-extraction";
import { MockLanguageServiceHost } from "./MockLanguageServiceHost";
// Registers all existing extractors.
getDataExtractorApi().registerDefaultExtractors();
setTimeout(() => {
new Main().run();
}, 0);
class Main {
run() {
/*const files = new Map<string, string>([
[
"main.ts",
`
class Test1 {
public foo(a: number) {
const x = { a: 5 };
const y = { a: 5 };
}
}
`,
],
]);
const serviceHost = new MockLanguageServiceHost(files, {});
const baseService = ts.createLanguageService(
serviceHost,
ts.createDocumentRegistry()
);
const prog = baseService.getProgram()!;
debugger;
const c = prog.getTypeChecker();
let myValue = undefined; // Visualize `myValue` here!
const sourceFileAst = prog.getSourceFiles()[0];
myValue = sourceFileAst;
console.log("myValue is the source code of the AST");
debugger;
myValue = {
sf: sourceFileAst,
fn: (n: ts.Node) => {
try {
const t = c.getTypeAtLocation(n);
return t ? c.typeToString(t) : undefined;
} catch (e) {
return "" + e;
}
},
};
console.log("myValue is AST, annotated with type information");
debugger;
myValue = {
sf: sourceFileAst,
fn: (n: ts.Node) => {
try {
const t = c.getSymbolAtLocation(n);
return t ? ts.SymbolFlags[t.flags] : undefined;
} catch (e) {
return "" + e;
}
},
};
console.log("myValue is AST, annotated with symbol information");
debugger;*/
require;
const sf = ts.createSourceFile("main.ts",
`
class Test1 {
public foo(a: number) {
const x = { a: 5 };
const y = { a: 24 };
}
}
`, ts.ScriptTarget.ESNext, true);
const traverse = (node: ts.Node) => {
ts.forEachChild(node, child => {
traverse(child);
});
};
traverse(sf);
}
}
/*
myValue = {
kind: { text: true, svg: true },
text: `
<svg height="210" width="500">
<polygon
points="100,10 40,198 190,78 10,78 160,198"
style="fill:lime;stroke:purple;stroke-width:5;fill-rule:nonzero;"
/>
</svg>
`,
};*/
================================================
FILE: demos/js/src/playground.ts
================================================
import {
enableHotReload,
registerUpdateReconciler,
getReloadCount,
hotCallExportedFunction,
} from "@hediet/node-reload";
enableHotReload();
registerUpdateReconciler(module);
import { registerDefaultExtractors } from "@hediet/debug-visualizer-data-extraction";
registerDefaultExtractors();
if (getReloadCount(module) === 0) {
// set interval so that the file watcher can detect changes in other files.
setInterval(() => {
hotCallExportedFunction(module, run);
}, 1000);
}
export function run() {
new Demo().run();
}
class Demo {
private f = new Foo(new Foo(undefined));
private arr = [new Foo(this.f), this.f];
private set = new Set([this.arr[0], new Foo(new Foo(this.arr[1]))]);
run() {
debugger;
}
}
class Foo {
constructor(public readonly next: Foo | undefined) {}
}
================================================
FILE: demos/js/tsconfig.json
================================================
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"strict": true,
"outDir": "dist",
"skipLibCheck": true,
"rootDir": "./src",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"newLine": "LF",
"sourceMap": true,
"experimentalDecorators": true
},
"include": ["src/**/*"]
}
================================================
FILE: demos/nim/.vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Run your Executable",
"program": "${workspaceFolder}/main",
"args": [],
"cwd": "${workspaceFolder}",
"initCommands": [
// To let LLDB know that NCSTRING is just like a C string
"type format add --format c-string NCSTRING"
],
"preLaunchTask": "build"
}
]
}
================================================
FILE: demos/nim/.vscode/tasks.json
================================================
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "nim c main.nim"
}
]
}
================================================
FILE: demos/nim/LICENSE
================================================
MIT License
Copyright (c) 2020 Danil Yarantsev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: demos/nim/main.nim
================================================
import random, json, options, sugar
type
Kind = object
array: bool
Label = object
label: Option[string]
Column = object
content: Option[string]
tag: Option[string]
color: Option[string]
Row = object
label: Option[string]
columns: seq[Column]
Marker = object
id: string
row: int
column: int
rows: Option[int]
columns: Option[int]
label: Option[string]
color: Option[string]
Grid = object
kind: Kind
columnLabels: Option[seq[Label]]
rows: seq[Row]
markers: Option[seq[Marker]]
proc showSeq[T](data: seq[T], markers: seq[(string, int)] = @[]): cstring =
# Need to use cstring string type for C-compatible strings
let labels = collect(newSeq):
# Labels are indexes of the seq
for x in 0 ..< data.len():
Label(label: some($x))
let columns = collect(newSeq):
# Columns contain values of the seq
for x in data:
Column(content: some($x), tag: some($x))
let marks = collect(newSeq):
# If there are any markers (id - string, index - int)
for marker in markers:
Marker(id: marker[0], row: 0, column: marker[1])
let grid = Grid(
kind: Kind(array: true),
rows: @[Row(columns: columns)],
columnLabels: some(labels),
markers: some(marks)
)
# Serialize to JSON
result = $ %grid
proc main =
# Random seed
randomize()
# Fill seq with 10 random values from 1 to 999
var a = newSeq[int]()
for x in 0..10:
a.add rand(1..999)
# Simple bubble sort with some markers
# Open the visualizer and type in "ress"
let n = a.len() - 1
var ress = showSeq(a, @[("i", 0), ("j", 0)])
for i in 0 .. n:
for j in 0 .. n - i - 1:
if a[j] > a[j+1]:
ress = showSeq(a, @[("i", i), ("j", j)]) # breakpoint
let temp = a[j]
a[j] = a[j + 1]
a[j + 1] = temp
ress = showSeq(a, @[("i", i), ("j", j)]) # breakpoint
main()
================================================
FILE: demos/nim/nim.cfg
================================================
# For Nim source code lines
debugger:native
================================================
FILE: demos/php/.vscode/launch.json
================================================
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": "PHP - Demo",
"type": "php",
"request": "launch",
"program": "${workspaceFolder}/demo.php",
"xdebugSettings": {
"max_data": -1
}
}
]
}
================================================
FILE: demos/php/.vscode/settings.json
================================================
{
"debugVisualizer.debugAdapterConfigurations": {
"php": {
"context": "watch",
"expressionTemplate": "${expr}"
}
}
}
================================================
FILE: demos/php/demo.php
================================================
<?php
// Install php, xdebug and the php debug extension for VS Code
// (https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug).
// The Debug Visualizer has no support for PHP data extractors yet,
// so to visualize data, your value must be a valid JSON string representing the data.
// See readme for supported data schemas.
$graph = [
"kind" => ["graph" => true],
"nodes" => [
["id" => "1", "label" => "1"]
],
"edges" => []
];
// Visualize "$visualize()"
$visualize = function () use (&$graph) {
return json_encode($graph);
};
for ($i = 2; $i < 100; $i++) {
// add a node
$id = "" . $i;
array_push($graph["nodes"],
["id" => $id, "label" => $id]);
// connects the node to a random edge
$targetId = "" . random_int(1, $i - 1);
array_push($graph["edges"],
["from" => $id, "to" => "" . $targetId]);
}
echo "finished";
================================================
FILE: demos/python/.vscode/launch.json
================================================
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": []
}
================================================
FILE: demos/python/Person.py
================================================
class Person:
def __init__(self, name, parents=None) -> None:
self.name = name
self.parents = [] if parents is None else parents
def addParent(self, parent: "Person"):
self.parents.append(parent)
================================================
FILE: demos/python/debugvisualizer.py
================================================
from Person import Person
import json
from vscodedebugvisualizer import globalVisualizationFactory
class PersonVisualizer:
def checkType(self, t):
return isinstance(t, Person)
def visualizePerson(self, person: Person, nodes=[], edges=[]):
if person.name in [n["id"] for n in nodes]:
return nodes, edges
nodes.append(
{
"id": person.name,
"label": person.name,
}
)
for p in person.parents:
nodes, edges = self.visualizePerson(p, nodes, edges)
edges.append(
{
"from": p.name,
"to": person.name,
}
)
return nodes, edges
def visualize(self, person: Person):
jsonDict = {
"kind": {"graph": True},
"nodes": [],
"edges": [],
}
self.visualizePerson(person, jsonDict["nodes"], jsonDict["edges"])
return json.dumps(jsonDict)
globalVisualizationFactory.addVisualizer(PersonVisualizer())
================================================
FILE: demos/python/demo.py
================================================
import numpy as np
# put "x" in the Debug Visualizer and use step by step
# debugging to see the diffrent types of data visualization
x = 5
x = "asdf"
x = 5.5
x = [1, 2, 3, 4, 5, 6, "a", "b"]
x = ["b", "a", "c", "d", "e"]
x.sort()
x = {
"asdf1": "dasdf",
"asdf2": "dasdf",
"asdf3": {"foo": "bar"},
}
x = [1, 2, 3, 4, 5, 6]
# histogram
x = np.concatenate([np.arange(i) for i in range(9)])
x = x.reshape(2, -1)
# one dimension
x = np.arange(100)
x = np.linspace(-np.pi, np.pi, 100)
x = np.sin(x)
# 2 dimension
x = x.reshape(5, 20)
# 2 dimension transpose
x = x.transpose()
x = x.transpose()
# 3 dimensions
x = x.reshape(2, 5, 10)
# 4 dimensions
x = x.reshape(2, 5, 2, 5)
# big number
x = np.empty(2 ** 24)
x[0:1000000] = 1
x[1000000:10000000] = 5
# pyTorch
try:
import torch
x = np.concatenate([np.arange(i) for i in range(9)])
x = x.reshape(2, -1)
x = torch.Tensor(x)
pass
except ImportError:
pass
# tensorflow
try:
import tensorflow as tf
x = np.concatenate([np.arange(i) for i in range(9)])
x = x.reshape(2, -1)
x = tf.convert_to_tensor(x)
pass
except ImportError:
pass
# pandas
try:
import pandas as pd
import plotly.express as px
x = px.data.gapminder().query("year == 2007")
pass
except ImportError:
pass
# custom visualizer defined in ./debugvisualizer.py (this file is included automatically)
from Person import Person
x = Person("Aria")
parent1 = Person("Eduart")
parent2 = Person("Catelyn")
x.addParent(parent1)
x.addParent(parent2)
parent1.addParent(Person("Benjen"))
# direct debug-visualizer json as dict with property "kind"
x = {
"kind": {"dotGraph": True},
"text": '\ndigraph G {\n subgraph cluster_0 {\n style=filled;\n color=lightgrey;\n node [style=filled,color=white];\n a0 -> a1 -> a2 -> a3;\n label = "process #1";\n }\n \n subgraph cluster_1 {\n node [style=filled];\n b0 -> b1 -> b2 -> b3;\n label = "process #2";\n color=blue\n }\n start -> a0;\n start -> b0;\n a1 -> b3;\n b2 -> a3;\n a3 -> a0;\n a3 -> end;\n b3 -> end;\n \n start [shape=Mdiamond];\n end [shape=Msquare];\n}\n',
}
x = {
"kind": {"plotly": True},
"data": [
{
"mode": "lines",
"type": "scatter",
"x": ["A", "B", "C"],
"xaxis": "x",
"y": [4488916, 3918072, 3892124],
"yaxis": "y",
},
{
"cells": {"values": [["A", "B", "C"], [341319, 281489, 294786], [4488916, 3918072, 3892124]]},
"domain": {"x": [0.0, 1.0], "y": [0.0, 0.60]},
"header": {"align": "left", "font": {"size": 10}, "values": ["Date", "Number", "Output"]},
"type": "table",
},
],
"layout": {"xaxis": {"anchor": "y", "domain": [0.0, 1.0]}, "yaxis": {"anchor": "x", "domain": [0.75, 1.0]}},
}
pass
================================================
FILE: demos/python/graph.py
================================================
# Install the python extension for VS Code
# (https:#marketplace.visualstudio.com/items?itemName=ms-python.python).
# The Debug Visualizer has no support for Python data extractors yet,
# so to visualize data, your value must be a valid JSON string representing the data.
# See readme for supported data schemas.
from json import dumps
from random import randint
graph = {
"kind": {"graph": True},
"nodes": [
{"id": "1", "label": "1"}
],
"edges": []
}
for i in range(2,100):
# add a node
id = str(i)
graph["nodes"].append({"id": id, "label": id})
# connects the node to a random edge
targetId = str(randint(1, i - 1))
graph["edges"].append({"from": id, "to": targetId})
print("i is " + str(i))
# try setting a breakpoint right above
# then put graph into the visualization console and press enter
# when you step through the code each time you hit the breakpoint
# the graph should automatically refresh!
# example of json_graph visualization with 10 nodes:
# https://i.imgur.com/RqZuYHH.png
print("finished")
================================================
FILE: demos/python/insertion_sort.py
================================================
"""Python demo for sorting using VS Code Debug Visualizer."""
def serialize(arr):
"""Serialize an array into a format the visualizer can understand."""
formatted = {
"kind": {"grid": True},
"rows": [
{
"columns": [
{"content": str(value), "tag": str(value)} for value in arr
],
}
],
}
return formatted
arr = [6, 9, 3, 12, 1, 11, 5, 13, 8, 14, 2, 4, 10, 0, 7]
# Put serialized into the Debug Visualizer console
serialized = serialize(arr)
# Set a breakpoint on the line below and go through the code in debug mode to
# watch it update
for target_idx in range(1, len(arr)):
target_value = arr[target_idx]
compare_idx = target_idx - 1
while compare_idx >= 0 and arr[compare_idx] > target_value:
arr[compare_idx + 1] = arr[compare_idx]
serialized = serialize(arr)
compare_idx -= 1
arr[compare_idx + 1] = target_value
serialized = serialize(arr)
assert arr == sorted(arr)
================================================
FILE: demos/ruby/README.md
================================================
# Ruby Demos
To visualize Ruby objects, you need to install [debugvisualizer.gem](https://github.com/ono-max/debugvisualizer).
Install the gem by executing:
$ gem install debugvisualizer
================================================
FILE: demos/ruby/src/demo_custom_visualizer.rb
================================================
require 'debugvisualizer'
class Foo; end
DebugVisualizer.register Foo do |data|
{
id: "my_visualizer",
name: "My Visualizer",
data: {
kind: { text: true },
text: "Foo"
}
}
end
f = Foo.new
# visualize `f` here!
binding.break
================================================
FILE: demos/ruby/src/demo_random_walks.rb
================================================
data = []
curVal = 0
100.times{
100.times{
delta = rand > 0.5 ? 1 : -1
data << curVal
curVal += delta
# visualize `data` here and press F5(or Continue button) over and over!
binding.break
}
}
================================================
FILE: demos/rust/.gitignore
================================================
# Generated by Cargo
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
================================================
FILE: demos/rust/.vscode/launch.json
================================================
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "run rust demo",
"cargo": {
"args": [
"build",
"--bin=rust_demo",
"--package=rust_demo",
],
"filter": {
gitextract_mf4tfga_/
├── .github/
│ ├── FUNDING.yml
│ └── workflows/
│ ├── ci.yml
│ └── opened-issues-triage.yml
├── .gitignore
├── .prettierrc.json
├── .vscode/
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── data-extraction/
│ ├── CHANGELOG.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── CommonDataTypes.ts
│ │ ├── DataExtractionResult.ts
│ │ ├── getGlobal.ts
│ │ ├── index.ts
│ │ ├── js/
│ │ │ ├── api/
│ │ │ │ ├── DataExtractorApi.ts
│ │ │ │ ├── DataExtractorApiImpl.ts
│ │ │ │ ├── LoadDataExtractorsFn.ts
│ │ │ │ ├── default-extractors/
│ │ │ │ │ ├── AsIsDataExtractor.ts
│ │ │ │ │ ├── GetDebugVisualizationDataExtractor.ts
│ │ │ │ │ ├── GridExtractor.ts
│ │ │ │ │ ├── MarkedGridExtractor.ts
│ │ │ │ │ ├── ObjectGraphExtractor.ts
│ │ │ │ │ ├── PlotlyDataExtractor.ts
│ │ │ │ │ ├── StringDiffExtractor.ts
│ │ │ │ │ ├── StringRangeExtractor.ts
│ │ │ │ │ ├── TableExtractor.ts
│ │ │ │ │ ├── ToStringExtractor.ts
│ │ │ │ │ ├── TypeScriptDataExtractors.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── registerDefaultDataExtractors.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── injection.ts
│ │ │ ├── global-helpers.ts
│ │ │ ├── helpers/
│ │ │ │ ├── asData.ts
│ │ │ │ ├── cache.ts
│ │ │ │ ├── createGraph.ts
│ │ │ │ ├── createGraphFromPointers.ts
│ │ │ │ ├── find.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── markedGrid.ts
│ │ │ │ └── tryEval.ts
│ │ │ └── index.ts
│ │ └── util.ts
│ ├── test/
│ │ ├── main.test.ts
│ │ └── tsconfig.json
│ ├── tsconfig.json
│ └── webpack.config.ts
├── demos/
│ ├── cpp/
│ │ ├── .gitignore
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── tasks.json
│ │ └── main.cpp
│ ├── csharp/
│ │ ├── .gitignore
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ ├── settings.json
│ │ │ └── tasks.json
│ │ ├── ExtractedData.cs
│ │ ├── Program.cs
│ │ └── demo.csproj
│ ├── dart/
│ │ ├── debug_visualizers.dart
│ │ └── demo.dart
│ ├── golang/
│ │ ├── .vscode/
│ │ │ └── launch.json
│ │ ├── demo.go
│ │ └── go.mod
│ ├── java/
│ │ ├── .classpath
│ │ ├── .gitignore
│ │ ├── .project
│ │ ├── .settings/
│ │ │ └── org.eclipse.jdt.core.prefs
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── settings.json
│ │ └── src/
│ │ └── app/
│ │ ├── App.java
│ │ ├── ExtractedData.java
│ │ ├── GraphData.java
│ │ └── TextData.java
│ ├── js/
│ │ ├── .vscode/
│ │ │ ├── settings.json
│ │ │ └── tasks.json
│ │ ├── README.md
│ │ ├── custom-visualizer.js
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── MockLanguageServiceHost.ts
│ │ │ ├── demo_address_book.ts
│ │ │ ├── demo_custom-data-extractor.ts
│ │ │ ├── demo_doubly-linked-list.ts
│ │ │ ├── demo_fetch.js
│ │ │ ├── demo_random-walks.ts
│ │ │ ├── demo_singly-linked-list.js
│ │ │ ├── demo_sorting.ts
│ │ │ ├── demo_stack-frames.js
│ │ │ ├── demo_typescript-asts.ts
│ │ │ └── playground.ts
│ │ └── tsconfig.json
│ ├── nim/
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── tasks.json
│ │ ├── LICENSE
│ │ ├── main.nim
│ │ └── nim.cfg
│ ├── php/
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── settings.json
│ │ └── demo.php
│ ├── python/
│ │ ├── .vscode/
│ │ │ └── launch.json
│ │ ├── Person.py
│ │ ├── debugvisualizer.py
│ │ ├── demo.py
│ │ ├── graph.py
│ │ └── insertion_sort.py
│ ├── ruby/
│ │ ├── README.md
│ │ └── src/
│ │ ├── demo_custom_visualizer.rb
│ │ └── demo_random_walks.rb
│ ├── rust/
│ │ ├── .gitignore
│ │ ├── .vscode/
│ │ │ ├── launch.json
│ │ │ └── settings.json
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── main.rs
│ └── swift/
│ ├── .gitignore
│ ├── .vscode/
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── Package.swift
│ ├── Sources/
│ │ └── swiftDemo/
│ │ └── main.swift
│ ├── Tests/
│ │ ├── LinuxMain.swift
│ │ └── swiftDemoTests/
│ │ ├── XCTestManifests.swift
│ │ └── swiftDemoTests.swift
│ └── main.swift
├── docs/
│ └── main.plantuml
├── extension/
│ ├── .vscodeignore
│ ├── CHANGELOG.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── Config.ts
│ │ ├── VisualizationBackend/
│ │ │ ├── ComposedVisualizationSupport.ts
│ │ │ ├── ConfigurableVisualizationSupport.ts
│ │ │ ├── DispatchingVisualizationBackend.ts
│ │ │ ├── GenericVisualizationSupport.ts
│ │ │ ├── JsVisualizationSupport.ts
│ │ │ ├── PyVisualizationSupport.ts
│ │ │ ├── RbVisualizationSupport.ts
│ │ │ ├── VisualizationBackend.ts
│ │ │ ├── index.ts
│ │ │ └── parseEvaluationResultFromGenericDebugAdapter.ts
│ │ ├── VisualizationWatchModel/
│ │ │ ├── VisualizationWatchModel.ts
│ │ │ ├── VisualizationWatchModelImpl.ts
│ │ │ └── index.ts
│ │ ├── extension.ts
│ │ ├── proxies/
│ │ │ ├── DebugSessionProxy.ts
│ │ │ ├── DebuggerProxy.ts
│ │ │ └── DebuggerViewProxy.ts
│ │ ├── types.d.ts
│ │ ├── utils/
│ │ │ ├── DebouncedRunner.ts
│ │ │ ├── IncrementalMap.ts
│ │ │ └── VsCodeSettings.ts
│ │ ├── webview/
│ │ │ ├── InternalWebviewManager.ts
│ │ │ ├── WebviewConnection.ts
│ │ │ └── WebviewServer.ts
│ │ └── webviewContract.ts
│ ├── tsconfig.json
│ └── webpack.config.ts
├── package.json
├── tslint.json
└── webview/
├── index.js
├── package.json
├── src/
│ ├── components/
│ │ ├── App.tsx
│ │ ├── ExpressionInput.tsx
│ │ ├── GUI.tsx
│ │ ├── NoData.tsx
│ │ ├── Visualizer.tsx
│ │ └── VisualizerHeaderDetails.tsx
│ ├── hotComponent.tsx
│ ├── index.tsx
│ ├── model/
│ │ ├── Model.ts
│ │ ├── MonacoBridge.ts
│ │ ├── VsCodeApi.ts
│ │ └── lib.es5.d.ts.txt
│ ├── style.scss
│ ├── vscode-dark.scss
│ └── vscode-light.scss
├── tsconfig.json
└── webpack.config.ts
SYMBOL INDEX (510 symbols across 88 files)
FILE: data-extraction/src/CommonDataTypes.ts
type KnownVisualizationData (line 3) | type KnownVisualizationData =
type TreeVisualizationData (line 18) | type TreeVisualizationData = {
type TreeNode (line 25) | type TreeNode = {
type TreeNodeItem (line 44) | type TreeNodeItem = {
type AstTreeVisualizationData (line 55) | type AstTreeVisualizationData = {
type AstTreeNode (line 66) | type AstTreeNode = {
type AstTreeNodeItem (line 77) | type AstTreeNodeItem = {
type GraphvizDotVisualizationData (line 82) | type GraphvizDotVisualizationData = {
type GraphVisualizationData (line 89) | type GraphVisualizationData = {
type GraphNode (line 97) | type GraphNode = {
type GraphEdge (line 104) | type GraphEdge = {
type GridVisualizationData (line 113) | type GridVisualizationData = {
type ImageVisualizationData (line 142) | type ImageVisualizationData = {
type MonacoTextVisualizationData (line 152) | type MonacoTextVisualizationData = {
type LineColumnRange (line 170) | type LineColumnRange = {
type LineColumnPosition (line 181) | type LineColumnPosition = {
type MonacoTextDiffVisualizationData (line 192) | type MonacoTextDiffVisualizationData = {
type TableVisualizationData (line 210) | type TableVisualizationData = {
type PlotlyVisualizationData (line 220) | type PlotlyVisualizationData = {
type SimpleTextVisualizationData (line 297) | type SimpleTextVisualizationData = {
type SvgVisualizationData (line 304) | type SvgVisualizationData = {
FILE: data-extraction/src/DataExtractionResult.ts
type DataExtractionResult (line 1) | interface DataExtractionResult {
type VisualizationData (line 10) | interface VisualizationData {
type DataExtractorInfo (line 14) | interface DataExtractorInfo {
type DataExtractorId (line 20) | type DataExtractorId = {
function isVisualizationData (line 24) | function isVisualizationData(val: unknown): val is VisualizationData {
FILE: data-extraction/src/getGlobal.ts
function getGlobal (line 1) | function getGlobal(): any {
FILE: data-extraction/src/js/api/DataExtractorApi.ts
type DataExtractorApi (line 4) | interface DataExtractorApi {
type DataResult (line 37) | type DataResult =
type JSONString (line 49) | interface JSONString<T> extends String {
type CallFramesRequest (line 53) | interface CallFramesRequest {
type CallFrameRequest (line 58) | interface CallFrameRequest {
type CallFramesSnapshot (line 63) | interface CallFramesSnapshot {
type SkippedCallFrames (line 68) | interface SkippedCallFrames {
type CallFrameInfo (line 72) | interface CallFrameInfo {
type DataExtractor (line 78) | interface DataExtractor {
type ExtractionCollector (line 91) | interface ExtractionCollector {
type DataExtractorContext (line 98) | interface DataExtractorContext {
type DataExtraction (line 115) | interface DataExtraction {
FILE: data-extraction/src/js/api/DataExtractorApiImpl.ts
class DataExtractorApiImpl (line 24) | class DataExtractorApiImpl implements DataExtractorApi {
method toJson (line 30) | private toJson<TData>(data: TData): JSONString<TData> {
method registerExtractor (line 34) | public registerExtractor(extractor: DataExtractor): void {
method registerExtractors (line 38) | public registerExtractors(extractors: DataExtractor[]): void {
method getData (line 44) | public getData(
method getExtractions (line 119) | public getExtractions(
method registerDefaultExtractors (line 179) | public registerDefaultExtractors(preferExisting: boolean = false): void {
method setDataExtractorFn (line 184) | public setDataExtractorFn(
function visualizeError (line 196) | function visualizeError(e: unknown | Error): VisualizationData {
function formatErrorStr (line 204) | function formatErrorStr(e: unknown | Error): string {
function mapExtractor (line 211) | function mapExtractor(e: DataExtraction): DataExtractorInfo {
class ContextImpl (line 219) | class ContextImpl implements DataExtractorContext {
method constructor (line 220) | constructor(
method addCallFrameRequest (line 233) | addCallFrameRequest(request: CallFrameRequest): void {
method _level (line 237) | get _level(): number {
method extract (line 241) | extract(value: any): VisualizationData | undefined {
function removeStart (line 265) | function removeStart(str: string, start: string): string {
function removeEnd (line 272) | function removeEnd(str: string, end: string): string {
function cyrb53 (line 280) | function cyrb53(str: string, seed = 0) {
FILE: data-extraction/src/js/api/LoadDataExtractorsFn.ts
type LoadDataExtractorsFn (line 4) | type LoadDataExtractorsFn = (
FILE: data-extraction/src/js/api/default-extractors/AsIsDataExtractor.ts
class AsIsDataExtractor (line 8) | class AsIsDataExtractor implements DataExtractor {
method getExtractions (line 10) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/GetDebugVisualizationDataExtractor.ts
class GetVisualizationDataExtractor (line 8) | class GetVisualizationDataExtractor implements DataExtractor {
method getExtractions (line 10) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/GridExtractor.ts
class GridExtractor (line 9) | class GridExtractor implements DataExtractor {
method getExtractions (line 11) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/MarkedGridExtractor.ts
class MarkedGridFromArrayExtractor (line 5) | class MarkedGridFromArrayExtractor implements DataExtractor {
method getExtractions (line 7) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/ObjectGraphExtractor.ts
class ObjectGraphExtractor (line 14) | class ObjectGraphExtractor implements DataExtractor {
method getExtractions (line 17) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/PlotlyDataExtractor.ts
class PlotlyDataExtractor (line 9) | class PlotlyDataExtractor implements DataExtractor {
method getExtractions (line 12) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/StringDiffExtractor.ts
class StringDiffExtractor (line 7) | class StringDiffExtractor implements DataExtractor {
method getExtractions (line 10) | public getExtractions(
FILE: data-extraction/src/js/api/default-extractors/StringRangeExtractor.ts
class StringRangeExtractor (line 5) | class StringRangeExtractor implements DataExtractor {
method getExtractions (line 7) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/TableExtractor.ts
function assert (line 6) | function assert<T>(value: unknown): asserts value {}
class TableDataExtractor (line 8) | class TableDataExtractor implements DataExtractor {
method getExtractions (line 11) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/ToStringExtractor.ts
class ToStringDataExtractor (line 9) | class ToStringDataExtractor implements DataExtractor {
method getExtractions (line 12) | getExtractions(
FILE: data-extraction/src/js/api/default-extractors/TypeScriptDataExtractors.ts
class TypeScriptAstDataExtractor (line 11) | class TypeScriptAstDataExtractor implements DataExtractor {
method getExtractions (line 14) | getExtractions(
class Helper (line 122) | class Helper {
method constructor (line 123) | constructor(private readonly tsApi: typeof ts) {}
method getPropertyNameInParent (line 125) | getPropertyNameInParent(value: any, parent: any): string | undefined {
method getChildren (line 145) | getChildren(node: ts.Node): ts.Node[] {
method toTreeNode (line 153) | toTreeNode(
method getSourceFile (line 236) | getSourceFile(node: ts.Node | any): ts.SourceFile {
FILE: data-extraction/src/js/api/default-extractors/registerDefaultDataExtractors.ts
function registerDefaultExtractors (line 19) | function registerDefaultExtractors(
FILE: data-extraction/src/js/api/injection.ts
function getExpressionToInitializeDataExtractorApi (line 13) | function getExpressionToInitializeDataExtractorApi(): string {
function getExpressionForDataExtractorApi (line 28) | function getExpressionForDataExtractorApi(): string {
function getDataExtractorApi (line 34) | function getDataExtractorApi(): DataExtractorApi {
function selfContainedGetInitializedDataExtractorApi (line 52) | function selfContainedGetInitializedDataExtractorApi(): DataExtractorApi {
function installHelpers (line 77) | function installHelpers(): void {
FILE: data-extraction/src/js/helpers/asData.ts
function asData (line 4) | function asData(data: KnownVisualizationData): VisualizationData {
FILE: data-extraction/src/js/helpers/cache.ts
function cache (line 8) | function cache<T>(
FILE: data-extraction/src/js/helpers/createGraph.ts
type CreateGraphEdge (line 7) | type CreateGraphEdge<T> = ({ to: T } | { from: T } | { include: T }) &
function createGraph (line 14) | function createGraph<T>(
FILE: data-extraction/src/js/helpers/createGraphFromPointers.ts
function createGraphFromPointers (line 8) | function createGraphFromPointers<T>(
FILE: data-extraction/src/js/helpers/find.ts
function find (line 3) | function find(predicate: (obj: unknown) => boolean): unknown {
function findVar (line 46) | function findVar(
function similarityScore (line 90) | function similarityScore(a: string, b: string): number {
function levenshteinDistance (line 100) | function levenshteinDistance(a: string, b: string): number {
FILE: data-extraction/src/js/helpers/markedGrid.ts
function markedGrid (line 3) | function markedGrid(
FILE: data-extraction/src/js/helpers/tryEval.ts
function tryEval (line 29) | function tryEval(
FILE: data-extraction/src/util.ts
function expect (line 1) | function expect<T>(data: T): T {
FILE: demos/cpp/main.cpp
function main (line 7) | int main()
FILE: demos/csharp/ExtractedData.cs
class ExtractedData (line 9) | [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
method ToString (line 29) | public override string ToString()
class TextData (line 35) | public class TextData : ExtractedData
method TextData (line 42) | public TextData(string text)
class GraphData (line 48) | public class GraphData : ExtractedData
class NodeData (line 58) | [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
method NodeData (line 61) | public NodeData(string id)
class EdgeData (line 79) | [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
method EdgeData (line 83) | public EdgeData(string from, string to)
method From (line 108) | public static GraphData From<T>(IEnumerable<T> items, Func<T, NodeInfo...
class NodeInfo (line 156) | public class NodeInfo<T>
method AddEdge (line 163) | public NodeInfo<T> AddEdge(T to, string? id = null, string? label = ...
class EdgeInfo (line 173) | public class EdgeInfo<T>
method EdgeInfo (line 179) | public EdgeInfo(T to)
FILE: demos/csharp/Program.cs
class Program (line 14) | class Program
method Main (line 16) | static void Main(string[] args)
class LinkedList (line 27) | class LinkedList<T>
class Node (line 29) | class Node
method Node (line 31) | public Node(T value) { Value = value; }
method Append (line 38) | public void Append(T item)
method Visualize (line 55) | public string Visualize()
FILE: demos/dart/debug_visualizers.dart
function graph (line 3) | String graph(List<GraphNode> nodes, List<GraphEdge> edges)
function plotly (line 11) | String plotly(List<num> values)
function tree (line 20) | String tree(TreeNode root)
class Graph (line 27) | class Graph {
class GraphEdge (line 32) | class GraphEdge {
method toJson (line 39) | Map<String, dynamic> toJson()
class GraphNode (line 46) | class GraphNode {
method toJson (line 55) | Map<String, dynamic> toJson()
class TreeNode (line 61) | class TreeNode {
method toJson (line 69) | Map<String, dynamic> toJson()
class TreeNodeItem (line 77) | class TreeNodeItem {
method toJson (line 82) | Map<String, dynamic> toJson()
FILE: demos/dart/demo.dart
function main (line 12) | void main()
function plotly_demo (line 21) | void plotly_demo()
function graph_demo (line 30) | void graph_demo()
function graphFromDoubleLinked (line 31) | graphFromDoubleLinked<T>(
function node (line 33) | node(T s)
function edge (line 34) | edge(DoubleLinkedQueueEntry<T> e)
function tree_demo (line 64) | void tree_demo()
function createNode (line 66) | TreeNode createNode(int levels)
FILE: demos/golang/demo.go
function main (line 35) | func main() {
type Graph (line 58) | type Graph struct
method toString (line 88) | func (this *Graph) toString() string {
type NodeGraphData (line 64) | type NodeGraphData struct
type EdgeGraphData (line 71) | type EdgeGraphData struct
function NewGraph (line 80) | func NewGraph() *Graph {
FILE: demos/java/src/app/App.java
class App (line 5) | public class App {
method main (line 7) | public static void main(String[] args) {
class LinkedList (line 17) | class LinkedList<T> {
method append (line 20) | public void append(T value) {
method visualize (line 32) | public String visualize() {
class Node (line 50) | static class Node<T> {
method Node (line 54) | public Node(T value) {
FILE: demos/java/src/app/ExtractedData.java
class ExtractedData (line 9) | public abstract class ExtractedData {
method getKind (line 10) | public HashMap<String, Boolean> getKind() {
method getTags (line 18) | @JsonIgnore
method toString (line 21) | @Override
FILE: demos/java/src/app/GraphData.java
class GraphData (line 11) | public class GraphData extends ExtractedData {
method getTags (line 15) | @Override
method getNodes (line 20) | public List<NodeData> getNodes() {
method getEdges (line 24) | public List<EdgeData> getEdges() {
class NodeData (line 28) | @JsonInclude(Include.NON_NULL)
method NodeData (line 35) | public NodeData(String id) {
method getId (line 39) | public String getId() {
method setId (line 43) | public void setId(String id) {
method getLabel (line 47) | public String getLabel() {
method setLabel (line 51) | public void setLabel(String label) {
method getColor (line 55) | public String getColor() {
method setColor (line 59) | public void setColor(String color) {
method getShape (line 63) | public String getShape() {
method setShape (line 67) | public void setShape(String shape) {
class EdgeData (line 72) | @JsonInclude(Include.NON_NULL)
method EdgeData (line 81) | public EdgeData(String from, String to) {
method getFrom (line 86) | public String getFrom() {
method setFrom (line 90) | public void setFrom(String from) {
method getTo (line 94) | public String getTo() {
method setTo (line 98) | public void setTo(String to) {
method getLabel (line 102) | public String getLabel() {
method setLabel (line 106) | public void setLabel(String label) {
method getId (line 110) | public String getId() {
method setId (line 114) | public void setId(String id) {
method getColor (line 118) | public String getColor() {
method setColor (line 122) | public void setColor(String color) {
method getDashes (line 126) | public Boolean getDashes() {
method setDashes (line 130) | public void setDashes(Boolean dashes) {
type NodeInfoProvider (line 135) | public interface NodeInfoProvider<T> {
method getNodeInfo (line 136) | public NodeInfo<T> getNodeInfo(T item, NodeInfo<T> nodeInfo);
method from (line 139) | public static <T> GraphData from(T item, NodeInfoProvider<T> f) {
class FromState (line 168) | static class FromState<T> {
method FromState (line 173) | public FromState(NodeInfoProvider<T> provider) {
method getId (line 177) | public String getId(NodeInfo<T> nodeInfo) {
method getNodeInfo (line 184) | public NodeInfo<T> getNodeInfo(T item) {
class NodeInfo (line 195) | public static class NodeInfo<T> {
method addEdge (line 201) | public EdgeInfo<T> addEdge(T to) {
class EdgeInfo (line 208) | public static class EdgeInfo<T> {
method EdgeInfo (line 213) | public EdgeInfo(T to) {
FILE: demos/java/src/app/TextData.java
class TextData (line 3) | public class TextData extends ExtractedData {
method TextData (line 6) | public TextData(String text) {
method getTags (line 10) | @Override
method getText (line 15) | public String getText() {
FILE: demos/js/custom-visualizer.js
method getExtractions (line 8) | getExtractions(data, collector, context) {
method getExtractions (line 29) | getExtractions(data, collector, context) {
FILE: demos/js/src/MockLanguageServiceHost.ts
class MockLanguageServiceHost (line 3) | class MockLanguageServiceHost implements ts.LanguageServiceHost {
method constructor (line 4) | constructor(
method getScriptFileNames (line 9) | getScriptFileNames(): string[] {
method getScriptVersion (line 13) | getScriptVersion(fileName: string): string {
method getScriptSnapshot (line 17) | getScriptSnapshot(fileName: string): ts.IScriptSnapshot | undefined {
method getCompilationSettings (line 30) | getCompilationSettings(): ts.CompilerOptions {
method getCurrentDirectory (line 33) | getCurrentDirectory(): string {
method getDefaultLibFileName (line 36) | getDefaultLibFileName(options: ts.CompilerOptions): string {
FILE: demos/js/src/demo_address_book.ts
class Person (line 2) | class Person {
method constructor (line 3) | constructor(public id: number, public firstName: string, public lastNa...
class Company (line 8) | class Company {
method constructor (line 9) | constructor(public id: number, public name: string, public street: str...
class AddressBook (line 12) | class AddressBook {
method loadPersons (line 13) | public static loadPersons(): Person[] {
method loadCompanies (line 722) | public static loadCompanies() {
method loadContacts (line 788) | public static loadContacts() {
FILE: demos/js/src/demo_custom-data-extractor.ts
class Foo (line 24) | class Foo {}
class Main (line 26) | class Main {
method run (line 27) | run() {
FILE: demos/js/src/demo_doubly-linked-list.ts
class Main (line 12) | class Main {
method run (line 14) | run() {
function reverse (line 26) | function reverse(list: DoublyLinkedList) {
class DoublyLinkedList (line 61) | class DoublyLinkedList {
method constructor (line 62) | constructor(
class DoublyLinkedListNode (line 69) | class DoublyLinkedListNode {
method constructor (line 71) | constructor(public name: string) { }
method setNext (line 76) | public setNext(val: DoublyLinkedListNode): void {
FILE: demos/js/src/demo_random-walks.ts
function addManyRandomValues (line 9) | function addManyRandomValues() {
function addRandomValue (line 15) | function addRandomValue() {
FILE: demos/js/src/demo_singly-linked-list.js
class LinkedList (line 27) | class LinkedList {
method constructor (line 28) | constructor() {
class Node (line 33) | class Node {
method constructor (line 34) | constructor(data, next = null) {
FILE: demos/js/src/demo_sorting.ts
function main (line 17) | function main() {
function swap (line 24) | function swap(array: Array<number>, i: number, j: number) {
function partition (line 36) | function partition(
function quickSort (line 73) | function quickSort(
FILE: demos/js/src/demo_stack-frames.js
function test (line 2) | function test() {
FILE: demos/js/src/demo_typescript-asts.ts
class Main (line 12) | class Main {
method run (line 13) | run() {
FILE: demos/js/src/playground.ts
function run (line 21) | function run() {
class Demo (line 25) | class Demo {
method run (line 30) | run() {
class Foo (line 35) | class Foo {
method constructor (line 36) | constructor(public readonly next: Foo | undefined) {}
FILE: demos/python/Person.py
class Person (line 1) | class Person:
method __init__ (line 2) | def __init__(self, name, parents=None) -> None:
method addParent (line 6) | def addParent(self, parent: "Person"):
FILE: demos/python/debugvisualizer.py
class PersonVisualizer (line 6) | class PersonVisualizer:
method checkType (line 7) | def checkType(self, t):
method visualizePerson (line 10) | def visualizePerson(self, person: Person, nodes=[], edges=[]):
method visualize (line 32) | def visualize(self, person: Person):
FILE: demos/python/insertion_sort.py
function serialize (line 4) | def serialize(arr):
FILE: demos/ruby/src/demo_custom_visualizer.rb
class Foo (line 3) | class Foo; end
FILE: demos/rust/src/main.rs
type Label (line 8) | pub type Label = String;
type Grid (line 12) | pub struct Grid {
type Kind (line 22) | pub struct Kind {
type Row (line 27) | pub struct Row {
type Column (line 35) | pub struct Column {
function show_arr (line 49) | fn show_arr(a: &[i32]) -> String {
function main (line 80) | fn main() {
FILE: extension/src/Config.ts
class Config (line 7) | class Config {
method useChromeKioskMode (line 15) | public get useChromeKioskMode(): boolean {
method customScriptPaths (line 29) | public get customScriptPaths(): string[] {
method customVisualizerScriptPaths (line 52) | public get customVisualizerScriptPaths(): string[] {
method theme (line 73) | public get theme(): "light" | "dark" {
method constructor (line 82) | constructor() {
method getDebugAdapterConfig (line 90) | public getDebugAdapterConfig(
type DebugAdapterConfigs (line 109) | type DebugAdapterConfigs = {
type DebugAdapterConfig (line 116) | interface DebugAdapterConfig {
function evaluateTemplate (line 124) | function evaluateTemplate(
class SimpleTemplate (line 135) | class SimpleTemplate {
method constructor (line 136) | constructor(private readonly str: string) {}
method render (line 138) | render(data: Record<string, () => string>): string {
FILE: extension/src/VisualizationBackend/ComposedVisualizationSupport.ts
class ComposedVisualizationSupport (line 7) | class ComposedVisualizationSupport
method constructor (line 9) | constructor(public readonly engines: DebugSessionVisualizationSupport[...
method createBackend (line 11) | createBackend(
FILE: extension/src/VisualizationBackend/ConfigurableVisualizationSupport.ts
class ConfigurableVisualizationSupport (line 15) | class ConfigurableVisualizationSupport
method constructor (line 17) | constructor(
method createBackend (line 22) | createBackend(
class ConfiguredVisualizationBackend (line 37) | class ConfiguredVisualizationBackend extends GenericVisualizationBackend {
method constructor (line 38) | constructor(
method getContext (line 46) | protected getContext() {
method getFinalExpression (line 50) | protected getFinalExpression({
FILE: extension/src/VisualizationBackend/DispatchingVisualizationBackend.ts
class DispatchingVisualizationBackend (line 15) | class DispatchingVisualizationBackend implements VisualizationBackend {
method constructor (line 25) | constructor(
method getVisualizationBackend (line 62) | private getVisualizationBackend(
method activeVisualizationBackend (line 87) | private get activeVisualizationBackend(): VisualizationBackend | undef...
method getVisualizationData (line 96) | public async getVisualizationData(
method expressionLanguageId (line 119) | public get expressionLanguageId(): string | undefined {
method getCompletions (line 123) | public async getCompletions(
FILE: extension/src/VisualizationBackend/GenericVisualizationSupport.ts
class GenericVisualizationSupport (line 22) | class GenericVisualizationSupport
method constructor (line 24) | constructor(private readonly debuggerView: DebuggerViewProxy) { }
method createBackend (line 26) | createBackend(
class GenericVisualizationBackend (line 33) | class GenericVisualizationBackend extends VisualizationBackendBase {
method constructor (line 36) | constructor(
method getVisualizationData (line 43) | public async getVisualizationData({
method constructGraphFromVariablesReference (line 135) | private async constructGraphFromVariablesReference(
method getFinalExpression (line 224) | protected getFinalExpression(args: {
method getContext (line 231) | protected getContext(): "watch" | "repl" {
FILE: extension/src/VisualizationBackend/JsVisualizationSupport.ts
class JsEvaluationEngine (line 29) | class JsEvaluationEngine implements DebugSessionVisualizationSupport {
method constructor (line 30) | constructor(private readonly debuggerView: DebuggerViewProxy, private ...
method createBackend (line 32) | createBackend(session: DebugSessionProxy): VisualizationBackend | unde...
class CallFrameState (line 52) | class CallFrameState {
class JsVisualizationBackend (line 56) | class JsVisualizationBackend extends VisualizationBackendBase {
method constructor (line 60) | constructor(debugSession: DebugSessionProxy, debuggerView: DebuggerVie...
method getContext (line 64) | private getContext(): "copy" | "repl" {
method getVisualizationData (line 71) | public async getVisualizationData(
method getVisualizationDataIfInitialized (line 90) | private async getVisualizationDataIfInitialized(
method evaluateVisualizationDataRequest (line 165) | private async evaluateVisualizationDataRequest(
method initializeApiOrWait (line 198) | private initializeApiOrWait(): Promise<void> {
method initializeApi (line 205) | private async initializeApi(): Promise<void> {
method initializeCustomScripts (line 220) | private async initializeCustomScripts(): Promise<void> {
function getCallFramesSnapshotValue (line 231) | async function getCallFramesSnapshotValue(
function getVariableNames (line 328) | async function getVariableNames(debugSession: DebugSessionProxy, frameId...
class CustomScripts (line 352) | class CustomScripts {
method constructor (line 355) | constructor(
FILE: extension/src/VisualizationBackend/PyVisualizationSupport.ts
class PyEvaluationEngine (line 21) | class PyEvaluationEngine implements DebugSessionVisualizationSupport {
method constructor (line 22) | constructor(
method createBackend (line 27) | createBackend(
class PyVisualizationBackend (line 43) | class PyVisualizationBackend extends VisualizationBackendBase {
method constructor (line 46) | constructor(
method getContext (line 54) | protected getContext(): "watch" | "repl" {
method getVisualizationData (line 59) | public async getVisualizationData({
method getFinalExpression (line 136) | protected getFinalExpression(args: {
FILE: extension/src/VisualizationBackend/RbVisualizationSupport.ts
class RbEvaluationEngine (line 20) | class RbEvaluationEngine implements DebugSessionVisualizationSupport {
method constructor (line 21) | constructor(
method createBackend (line 26) | createBackend(
class RbVisualizationBackend (line 42) | class RbVisualizationBackend extends VisualizationBackendBase {
method constructor (line 44) | constructor(
method getVisualizationData (line 54) | public async getVisualizationData(
method _getVisualizationData (line 64) | private async _getVisualizationData({
FILE: extension/src/VisualizationBackend/VisualizationBackend.ts
type DebugSessionVisualizationSupport (line 12) | interface DebugSessionVisualizationSupport {
type VisualizationBackend (line 16) | interface VisualizationBackend extends Disposable {
type GetVisualizationDataArgs (line 34) | interface GetVisualizationDataArgs {
method constructor (line 48) | constructor(
method getCompletions (line 73) | public async getCompletions(
FILE: extension/src/VisualizationBackend/parseEvaluationResultFromGenericDebugAdapter.ts
type ParseEvaluationResultContext (line 7) | interface ParseEvaluationResultContext {
function parseEvaluationResultFromGenericDebugAdapter (line 11) | function parseEvaluationResultFromGenericDebugAdapter(
function isEnclosedWith (line 89) | function isEnclosedWith(str: string, char: string): boolean {
function parseJson (line 93) | function parseJson(str: string, context: ParseEvaluationResultContext) {
class FormattedError (line 118) | class FormattedError {
method constructor (line 119) | constructor(public readonly message: FormattedMessage) {}
FILE: extension/src/VisualizationWatchModel/VisualizationWatchModel.ts
type VisualizationWatchModel (line 4) | interface VisualizationWatchModel {
type VisualizationWatchOptions (line 20) | interface VisualizationWatchOptions {
type VisualizationWatch (line 25) | interface VisualizationWatch {
FILE: extension/src/VisualizationWatchModel/VisualizationWatchModelImpl.ts
class VisualizationWatchModelImpl (line 13) | class VisualizationWatchModelImpl implements VisualizationWatchModel {
method constructor (line 17) | constructor(private readonly visualizationBackend: VisualizationBacken...
method createWatch (line 28) | public createWatch(expression: string, options: VisualizationWatchOpti...
method languageId (line 40) | get languageId(): string | undefined {
method getCompletions (line 44) | public getCompletions(text: string, column: number): Promise<Completio...
class ObservableVisualizationWatch (line 49) | class ObservableVisualizationWatch implements VisualizationWatch {
method constructor (line 54) | constructor(
method preferredDataExtractor (line 78) | public get preferredDataExtractor(): DataExtractorId | undefined {
method setPreferredDataExtractor (line 83) | public setPreferredDataExtractor(id: DataExtractorId | undefined): void {
method refresh (line 90) | public refresh(): void {
method _refresh (line 105) | private async _refresh(token: CancellationToken): Promise<void> {
method state (line 135) | public get state(): DataExtractionState {
FILE: extension/src/extension.ts
function activate (line 31) | function activate(context: ExtensionContext) {
function deactivate (line 37) | function deactivate() { }
class Extension (line 39) | class Extension {
method constructor (line 69) | constructor() {
FILE: extension/src/proxies/DebugSessionProxy.ts
class DebugSessionProxy (line 5) | class DebugSessionProxy {
method constructor (line 8) | constructor(public readonly session: DebugSession) {}
method getStackTrace (line 10) | public async getStackTrace(args: {
method getCompletions (line 28) | public async getCompletions(args: {
method getScopes (line 49) | public async getScopes(args: { frameId: number }): Promise<Scope[]> {
method getVariables (line 64) | public async getVariables(args: { variablesReference: number }): Promi...
method evaluate (line 84) | public async evaluate(args: {
type StackTraceInfo (line 101) | interface StackTraceInfo {
type Scope (line 106) | interface Scope {
type Variable (line 112) | interface Variable {
type StackFrame (line 118) | interface StackFrame {
FILE: extension/src/proxies/DebuggerProxy.ts
class DebuggerProxy (line 9) | class DebuggerProxy {
method getDebugSessionProxy (line 19) | public getDebugSessionProxy(session: DebugSession): DebugSessionProxy {
method constructor (line 28) | constructor() {
FILE: extension/src/proxies/DebuggerViewProxy.ts
class DebuggerViewProxy (line 11) | class DebuggerViewProxy {
method activeDebugSession (line 16) | public get activeDebugSession(): DebugSessionProxy | undefined {
method getActiveStackFrameId (line 20) | public getActiveStackFrameId(
method constructor (line 26) | constructor(private debuggerProxy: DebuggerProxy) {
method updateActiveDebugSession (line 38) | private updateActiveDebugSession(activeSession: DebugSession | undefin...
class FrameIdGetter (line 45) | class FrameIdGetter implements InlineValuesProvider {
method constructor (line 46) | constructor(
method provideInlineValues (line 51) | provideInlineValues(document: TextDocument, viewPort: Range, context: ...
FILE: extension/src/types.d.ts
type ProcessEnv (line 2) | interface ProcessEnv {
FILE: extension/src/utils/DebouncedRunner.ts
class DebouncedRunner (line 1) | class DebouncedRunner {
method constructor (line 4) | constructor(private readonly debounceTimeout: number) {}
method run (line 6) | public run(action: () => void): void {
method clear (line 11) | private clear() {
method dispose (line 18) | public dispose(): void {
FILE: extension/src/utils/IncrementalMap.ts
class IncrementalMap (line 4) | class IncrementalMap<TKey, TValue extends Disposable> {
method constructor (line 7) | constructor(
FILE: extension/src/utils/VsCodeSettings.ts
type Serializer (line 6) | interface Serializer<T> {
function serializerWithDefault (line 11) | function serializerWithDefault<T>(defaultValue: T): Serializer<T> {
class VsCodeSetting (line 18) | class VsCodeSetting<T> {
method T (line 19) | public get T(): T {
method constructor (line 27) | public constructor(
method get (line 42) | public get(): T {
method set (line 47) | public async set(value: T): Promise<void> {
class VsCodeSettingResource (line 69) | class VsCodeSettingResource {
method constructor (line 84) | constructor(
method readValue (line 89) | private readValue(): any {
method value (line 107) | public get value() {
FILE: extension/src/webview/InternalWebviewManager.ts
class InternalWebviewManager (line 9) | class InternalWebviewManager {
method constructor (line 17) | constructor(
method createNew (line 38) | public createNew(expression: string | undefined = undefined) {
method restore (line 58) | private restore(webviewPanel: WebviewPanel) {
method initializeView (line 62) | private initializeView(
class DebugVisualizerWebview (line 79) | class DebugVisualizerWebview {
method constructor (line 80) | constructor(private readonly webviewPanel: WebviewPanel) {}
function getDebugVisualizerWebviewHtml (line 83) | function getDebugVisualizerWebviewHtml(
FILE: extension/src/webview/WebviewConnection.ts
class WebviewConnection (line 16) | class WebviewConnection {
method constructor (line 24) | constructor(
method setExpression (line 162) | public setExpression(expression: string) {
method setTheme (line 166) | public setTheme(theme: "light" | "dark"): void {
function launchChrome (line 171) | async function launchChrome(url: string): Promise<boolean> {
class FileWatcher (line 184) | class FileWatcher {
method constructor (line 187) | constructor(
class SingleFileWatcher (line 232) | class SingleFileWatcher {
method constructor (line 238) | constructor(public readonly path: string, private readonly scheduleRef...
method dispose (line 242) | public dispose() {
method refresh (line 249) | public refresh() {
FILE: extension/src/webview/WebviewServer.ts
class WebviewServer (line 15) | class WebviewServer {
method constructor (line 21) | constructor(
method getWebviewPageUrl (line 64) | public getWebviewPageUrl(args: {
method publicPath (line 84) | public get publicPath(): string {
method webviewBundleUrl (line 88) | public get webviewBundleUrl(): string {
method port (line 92) | public get port(): number {
FILE: extension/src/webviewContract.ts
type WebviewConfig (line 12) | interface WebviewConfig {
type WebviewUrlParams (line 20) | interface WebviewUrlParams {
type WindowWithWebviewData (line 28) | interface WindowWithWebviewData {
function unchecked (line 96) | function unchecked<T>(): types.Type<T, any, unknown> {
type FormattedMessage (line 105) | type FormattedMessage =
type DataExtractionState (line 120) | type DataExtractionState =
type CompletionItemType (line 130) | type CompletionItemType =
type CompletionItem (line 151) | interface CompletionItem {
FILE: extension/webpack.config.ts
function includeDependency (line 52) | function includeDependency(location: string) {
FILE: webview/src/components/App.tsx
class App (line 7) | class App extends React.Component {
method constructor (line 10) | constructor(props: any) {
method render (line 22) | render() {
FILE: webview/src/components/ExpressionInput.tsx
class ExpressionInput (line 8) | class ExpressionInput extends React.Component<{ model: Model }> {
method model (line 13) | private get model() {
method render (line 24) | render() {
method componentWillUnmount (line 48) | componentWillUnmount() {
method submit (line 116) | submit() {
FILE: webview/src/components/GUI.tsx
class GUI (line 12) | class GUI extends React.Component<{ model: Model }> {
method render (line 13) | render() {
class VisualizerHeader (line 37) | class VisualizerHeader extends React.Component<{ model: Model }> {
method render (line 40) | render() {
method toggleExpanded (line 73) | toggleExpanded() {
class VisualizerHeaderMain (line 79) | class VisualizerHeaderMain extends React.Component<{ model: Model }> {
method render (line 80) | render() {
FILE: webview/src/components/NoData.tsx
class NoData (line 7) | class NoData extends React.Component<{ children: React.ReactChild }> {
method render (line 11) | render() {
FILE: webview/src/components/Visualizer.tsx
class Visualizer (line 9) | class Visualizer extends React.Component<{ model: Model }> {
method render (line 10) | render() {
method renderContent (line 18) | renderContent(): JSX.Element {
function Message (line 56) | function Message(props: { message: FormattedMessage }): React.ReactEleme...
FILE: webview/src/components/VisualizerHeaderDetails.tsx
class VisualizerHeaderDetails (line 10) | class VisualizerHeaderDetails extends React.Component<{ model: Model }> {
method render (line 11) | render() {
function NamedSelect (line 94) | function NamedSelect<T extends SelectableItem>(props: {
type SelectableItem (line 117) | interface SelectableItem {
class Select (line 121) | @observer
method selected (line 127) | get selected(): T | undefined {
method render (line 131) | render() {
FILE: webview/src/hotComponent.tsx
type ReactComponent (line 6) | type ReactComponent<P = any> =
function hotComponent (line 12) | function hotComponent(
FILE: webview/src/model/Model.ts
class Model (line 30) | class Model {
method setPreferredVisualizationId (line 56) | public setPreferredVisualizationId(id: VisualizationId) {
method setVisualizationError (line 61) | public setVisualizationError(data: VisualizationData) {
method setPolling (line 66) | public setPolling(value: boolean) {
method visualizations (line 75) | get visualizations():
method loading (line 101) | public get loading(): boolean {
method constructor (line 107) | constructor() {
method setExpression (line 167) | setExpression(newExpression: string) {
method setPreferredExtractorId (line 182) | setPreferredExtractorId(id: DataExtractorId) {
method refresh (line 190) | refresh() {
method stayConnected (line 196) | async stayConnected(): Promise<void> {
method openBrowser (line 249) | openBrowser() {
method useSelectionAsExpression (line 255) | useSelectionAsExpression() {
function setVisualizationModule (line 275) | function setVisualizationModule(id: string, moduleFn: RegisterVisualizer...
FILE: webview/src/model/MonacoBridge.ts
class MonacoBridge (line 15) | class MonacoBridge {
method constructor (line 18) | constructor(private readonly model: Model) {
class DebugSessionCompletionProvider (line 81) | class DebugSessionCompletionProvider
method constructor (line 107) | constructor(private readonly model: Model) {}
method provideCompletionItems (line 109) | public async provideCompletionItems(
FILE: webview/src/model/VsCodeApi.ts
type VSCodeApi (line 3) | interface VSCodeApi<TState> {
type IncomingCommand (line 8) | type IncomingCommand = {
type OutgoingCommand (line 13) | type OutgoingCommand =
type VsCodeApi (line 20) | interface VsCodeApi {
function getApi (line 25) | function getApi<TState>(): VSCodeApi<TState> {
class IFrameVSCodeApi (line 35) | class IFrameVSCodeApi<TState> implements VSCodeApi<TState> {
method constructor (line 38) | constructor() {
method sendCommand (line 47) | private sendCommand(command: OutgoingCommand) {
method getState (line 51) | getState(): Promise<TState | undefined> {
method setState (line 60) | async setState(state: TState): Promise<void> {
class DirectVSCodeApi (line 65) | class DirectVSCodeApi<TState> implements VSCodeApi<TState> {
method constructor (line 66) | constructor(private readonly vsCodeApi: VsCodeApi) {}
method getState (line 68) | async getState(): Promise<TState | undefined> {
method setState (line 72) | async setState(state: TState): Promise<void> {
Condensed preview — 182 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (647K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 15,
"preview": "github: hediet\n"
},
{
"path": ".github/workflows/ci.yml",
"chars": 457,
"preview": "on:\n push:\n branches:\n - master\n pull_request:\n\njobs:\n build:\n strategy:\n matrix:\n os: [macos-"
},
{
"path": ".github/workflows/opened-issues-triage.yml",
"chars": 316,
"preview": "name: Move new issues into Triage\n\non:\n issues:\n types: [opened]\n\njobs:\n automate-project-columns:\n runs-on: ubu"
},
{
"path": ".gitignore",
"chars": 1252,
"preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directo"
},
{
"path": ".prettierrc.json",
"chars": 97,
"preview": "{\n\t\"trailingComma\": \"es5\",\n\t\"tabWidth\": 4,\n\t\"semi\": true,\n\t\"useTabs\": true,\n\t\"printWidth\": 120\n}\n"
},
{
"path": ".vscode/launch.json",
"chars": 2003,
"preview": "{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"type\": \"chrome\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"name\": \"Launch Chrome\","
},
{
"path": ".vscode/settings.json",
"chars": 698,
"preview": "{\n\t\"search.exclude\": {\n\t\t\"extension/out\": true\n\t},\n\t\"plantuml.diagramsRoot\": \"docs\",\n\t\"plantuml.exportFormat\": \"png\",\n\t\""
},
{
"path": ".vscode/tasks.json",
"chars": 318,
"preview": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"type\": \"npm\",\n\t\t\t\"label\": \"npm: dev - extension\",\n\t\t\t\"script\": \"dev\",\n\t\t\t\"pro"
},
{
"path": "CONTRIBUTING.md",
"chars": 2323,
"preview": "# Contributing\n\nThis document extends the [readme](./extension/README.md) of the extension with implementation details.\n"
},
{
"path": "LICENSE.md",
"chars": 34887,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\nCopyright (C) 2007 Free S"
},
{
"path": "README.md",
"chars": 866,
"preview": "# VS Code Debug Visualizer\n\n[ 2020 Henning Dieterichs\n\nPermission is hereby granted, free of charge, to any person obtainin"
},
{
"path": "data-extraction/README.md",
"chars": 2912,
"preview": "# @hediet/debug-visualizer-data-extraction\n\n[](htt"
},
{
"path": "data-extraction/package.json",
"chars": 1288,
"preview": "{\n\t\"name\": \"@hediet/debug-visualizer-data-extraction\",\n\t\"description\": \"A library that helps implementing data extractor"
},
{
"path": "data-extraction/src/CommonDataTypes.ts",
"chars": 5488,
"preview": "// This file was created automatically. Do not edit it manually!\n\nexport type KnownVisualizationData =\n\t| TreeVisualizat"
},
{
"path": "data-extraction/src/DataExtractionResult.ts",
"chars": 749,
"preview": "export interface DataExtractionResult {\n\tdata: VisualizationData;\n\tusedExtractor: DataExtractorInfo;\n\tavailableExtractor"
},
{
"path": "data-extraction/src/getGlobal.ts",
"chars": 259,
"preview": "export function getGlobal(): any {\n\tif (typeof globalThis === \"object\") {\n\t\treturn globalThis;\n\t} else if (typeof global"
},
{
"path": "data-extraction/src/index.ts",
"chars": 97,
"preview": "export * from \"./js\";\nexport * from \"./CommonDataTypes\";\nexport * from \"./DataExtractionResult\";\n"
},
{
"path": "data-extraction/src/js/api/DataExtractorApi.ts",
"chars": 3302,
"preview": "import { DataExtractionResult, VisualizationData } from \"../../DataExtractionResult\";\r\nimport { LoadDataExtractorsFn } f"
},
{
"path": "data-extraction/src/js/api/DataExtractorApiImpl.ts",
"chars": 7526,
"preview": "import {\r\n\tDataExtractorInfo,\r\n\tVisualizationData,\r\n} from \"../../DataExtractionResult\";\r\nimport * as helpers from \"../h"
},
{
"path": "data-extraction/src/js/api/LoadDataExtractorsFn.ts",
"chars": 229,
"preview": "import { DataExtractor } from \"./DataExtractorApi\";\nimport type * as helpersTypes from \"../helpers\"\n\nexport type LoadDat"
},
{
"path": "data-extraction/src/js/api/default-extractors/AsIsDataExtractor.ts",
"chars": 554,
"preview": "import { isVisualizationData } from \"../../../DataExtractionResult\";\nimport {\n\tDataExtractor,\n\tExtractionCollector,\n\tDat"
},
{
"path": "data-extraction/src/js/api/default-extractors/GetDebugVisualizationDataExtractor.ts",
"chars": 789,
"preview": "import { VisualizationData } from \"../../../DataExtractionResult\";\nimport {\n\tDataExtractor,\n\tExtractionCollector,\n\tDataE"
},
{
"path": "data-extraction/src/js/api/default-extractors/GridExtractor.ts",
"chars": 699,
"preview": "import {\n\tDataExtractor,\n\tExtractionCollector,\n\tDataExtractorContext,\n} from \"../..\";\nimport { GridVisualizationData } f"
},
{
"path": "data-extraction/src/js/api/default-extractors/MarkedGridExtractor.ts",
"chars": 1008,
"preview": "import { DataExtractor, ExtractionCollector, DataExtractorContext } from \"..\";\r\nimport { LineColumnRange } from \"../../."
},
{
"path": "data-extraction/src/js/api/default-extractors/ObjectGraphExtractor.ts",
"chars": 2563,
"preview": "import { VisualizationData } from \"../../../DataExtractionResult\";\nimport {\n\tDataExtractor,\n\tExtractionCollector,\n\tDataE"
},
{
"path": "data-extraction/src/js/api/default-extractors/PlotlyDataExtractor.ts",
"chars": 751,
"preview": "import { PlotlyVisualizationData } from \"../../../CommonDataTypes\";\nimport { expect } from \"../../../util\";\nimport {\n\tDa"
},
{
"path": "data-extraction/src/js/api/default-extractors/StringDiffExtractor.ts",
"chars": 677,
"preview": "import {\r\n\tDataExtractor,\r\n\tDataExtractorContext,\r\n\tExtractionCollector,\r\n} from \"../..\";\r\n\r\nexport class StringDiffExtr"
},
{
"path": "data-extraction/src/js/api/default-extractors/StringRangeExtractor.ts",
"chars": 2660,
"preview": "import { DataExtractor, ExtractionCollector, DataExtractorContext } from \"..\";\r\nimport { LineColumnRange } from \"../../."
},
{
"path": "data-extraction/src/js/api/default-extractors/TableExtractor.ts",
"chars": 1187,
"preview": "import { isAssertionExpression } from \"typescript\";\nimport { DataExtractor, ExtractionCollector, DataExtractorContext } "
},
{
"path": "data-extraction/src/js/api/default-extractors/ToStringExtractor.ts",
"chars": 657,
"preview": "import { MonacoTextVisualizationData } from \"../../../CommonDataTypes\";\nimport { expect } from \"../../../util\";\nimport {"
},
{
"path": "data-extraction/src/js/api/default-extractors/TypeScriptDataExtractors.ts",
"chars": 5802,
"preview": "import * as ts from \"typescript\"; // Only compile-time import!\nimport { AstTreeNode } from \"../../..\";\nimport { AstTreeV"
},
{
"path": "data-extraction/src/js/api/default-extractors/index.ts",
"chars": 77,
"preview": "export { registerDefaultExtractors } from \"./registerDefaultDataExtractors\";\n"
},
{
"path": "data-extraction/src/js/api/default-extractors/registerDefaultDataExtractors.ts",
"chars": 1455,
"preview": "import { DataExtractorApi } from \"../DataExtractorApi\";\nimport { TypeScriptAstDataExtractor } from \"./TypeScriptDataExtr"
},
{
"path": "data-extraction/src/js/api/index.ts",
"chars": 168,
"preview": "export * from \"./DataExtractorApi\";\nexport * from \"./injection\";\nexport { DataExtractorApiImpl } from \"./DataExtractorAp"
},
{
"path": "data-extraction/src/js/api/injection.ts",
"chars": 2595,
"preview": "import * as fs from \"fs\";\nimport { getGlobal } from \"../../getGlobal\";\nimport * as globalHelpers from \"../global-helpers"
},
{
"path": "data-extraction/src/js/global-helpers.ts",
"chars": 65,
"preview": "export { getDataExtractorApi as getApi } from \"./api/injection\";\n"
},
{
"path": "data-extraction/src/js/helpers/asData.ts",
"chars": 219,
"preview": "import { KnownVisualizationData } from \"../../CommonDataTypes\";\nimport { VisualizationData } from \"../../DataExtractionR"
},
{
"path": "data-extraction/src/js/helpers/cache.ts",
"chars": 702,
"preview": "import { DataExtractorApiImpl } from \"../api\";\n\nconst cached = new Map<string, any>();\n\n/**\n * Evaluates an expression\n "
},
{
"path": "data-extraction/src/js/helpers/createGraph.ts",
"chars": 2185,
"preview": "import {\n\tGraphEdge,\n\tGraphNode,\n\tGraphVisualizationData,\n} from \"../../CommonDataTypes\";\n\nexport type CreateGraphEdge<T"
},
{
"path": "data-extraction/src/js/helpers/createGraphFromPointers.ts",
"chars": 1177,
"preview": "import { GraphNode, GraphVisualizationData } from \"../../CommonDataTypes\";\nimport { CreateGraphEdge, createGraph } from "
},
{
"path": "data-extraction/src/js/helpers/find.ts",
"chars": 2847,
"preview": "import { DataExtractorApiImpl } from \"../api\";\n\nexport function find(predicate: (obj: unknown) => boolean): unknown {\n\tc"
},
{
"path": "data-extraction/src/js/helpers/index.ts",
"chars": 206,
"preview": "export * from \"./createGraph\";\nexport * from \"./createGraphFromPointers\";\nexport * from \"./tryEval\";\nexport * from \"./ma"
},
{
"path": "data-extraction/src/js/helpers/markedGrid.ts",
"chars": 583,
"preview": "import { GridVisualizationData } from \"../../CommonDataTypes\";\n\nexport function markedGrid(\n\tarr: unknown[],\n\tmarked: Re"
},
{
"path": "data-extraction/src/js/helpers/tryEval.ts",
"chars": 1259,
"preview": "import { DataExtractorApiImpl } from \"../api/DataExtractorApiImpl\";\n\n/**\n * Takes an object and eval's its values.\n * Ea"
},
{
"path": "data-extraction/src/js/index.ts",
"chars": 120,
"preview": "export * from \"./api\";\nexport * from \"./helpers\";\nexport { registerDefaultExtractors } from \"./api/default-extractors\";\n"
},
{
"path": "data-extraction/src/util.ts",
"chars": 56,
"preview": "export function expect<T>(data: T): T {\n\treturn data;\n}\n"
},
{
"path": "data-extraction/test/main.test.ts",
"chars": 307,
"preview": "import { DataExtractorApiImpl } from \"../\";\n\ndescribe(\"extractor\", () => {\n\tit(\"should not crash\", () => {\n\t\tconst dataE"
},
{
"path": "data-extraction/test/tsconfig.json",
"chars": 295,
"preview": "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"esnext\",\n\t\t\"module\": \"commonjs\",\n\t\t\"strict\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"rootD"
},
{
"path": "data-extraction/tsconfig.json",
"chars": 306,
"preview": "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"ES2018\",\n\t\t\"module\": \"commonjs\",\n\t\t\"strict\": true,\n\t\t\"outDir\": \"./dist\",\n\t\t\"skipLib"
},
{
"path": "data-extraction/webpack.config.ts",
"chars": 844,
"preview": "import { CleanWebpackPlugin } from \"clean-webpack-plugin\";\nimport * as path from \"path\";\nimport * as webpack from \"webpa"
},
{
"path": "demos/cpp/.gitignore",
"chars": 4,
"preview": "main"
},
{
"path": "demos/cpp/.vscode/launch.json",
"chars": 1009,
"preview": "{\n // Use IntelliSense to learn about possible attributes.\n // Hover to view descriptions of existing attributes.\n"
},
{
"path": "demos/cpp/.vscode/tasks.json",
"chars": 639,
"preview": "{\n // See https://go.microsoft.com/fwlink/?LinkId=733558 \n // for the documentation about the tasks.json format\n "
},
{
"path": "demos/cpp/main.cpp",
"chars": 312,
"preview": "#include <iostream>\n#include <vector>\n#include <string>\n\nusing namespace std;\n\nint main()\n{\n // visualize `myGraphJso"
},
{
"path": "demos/csharp/.gitignore",
"chars": 6088,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": "demos/csharp/.vscode/launch.json",
"chars": 598,
"preview": "{\n\t// Use IntelliSense to find out which attributes exist for C# debugging\n\t// Use hover for the description of the exis"
},
{
"path": "demos/csharp/.vscode/settings.json",
"chars": 54,
"preview": "{\n\t\"debugVisualizer.debugAdapterConfigurations\": {}\n}\n"
},
{
"path": "demos/csharp/.vscode/tasks.json",
"chars": 314,
"preview": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"label\": \"csharp-build\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"arg"
},
{
"path": "demos/csharp/ExtractedData.cs",
"chars": 4933,
"preview": "#nullable enable\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace Hediet.DebugVisualiz"
},
{
"path": "demos/csharp/Program.cs",
"chars": 2036,
"preview": "\r\n// Install dotnet core clr see VS Code docs on how to setup VS Code so that you can debug C# applications.\r\n// The De"
},
{
"path": "demos/csharp/demo.csproj",
"chars": 280,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\r\n\r\n <PropertyGroup>\r\n <OutputType>Exe</OutputType>\r\n <TargetFramework>netcoreap"
},
{
"path": "demos/dart/debug_visualizers.dart",
"chars": 1452,
"preview": "import 'dart:convert';\n\nString graph(List<GraphNode> nodes, List<GraphEdge> edges) {\n return jsonEncode({\n 'kind': {"
},
{
"path": "demos/dart/demo.dart",
"chars": 1974,
"preview": "import 'dart:collection';\nimport 'dart:developer';\nimport 'dart:math';\n\n// ignore: unused_import\nimport 'debug_visualize"
},
{
"path": "demos/golang/.vscode/launch.json",
"chars": 542,
"preview": "{\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"name\": \"Launch\",\r\n \"type\": \"go\","
},
{
"path": "demos/golang/demo.go",
"chars": 2227,
"preview": "package main\r\n\r\nimport (\r\n\t\"encoding/json\"\r\n\t\"math/rand\"\r\n\t\"strconv\"\r\n\t\"time\"\r\n)\r\n\r\n// If you want to visualize large da"
},
{
"path": "demos/golang/go.mod",
"chars": 21,
"preview": "module demo\n\ngo 1.13\n"
},
{
"path": "demos/java/.classpath",
"chars": 554,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<classpath>\r\n\t<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CON"
},
{
"path": "demos/java/.gitignore",
"chars": 286,
"preview": "# Compiled class file\n*.class\n\n# Log file\n*.log\n\n# BlueJ files\n*.ctxt\n\n# Mobile Tools for Java (J2ME)\n.mtj.tmp/\n\n# Packa"
},
{
"path": "demos/java/.project",
"chars": 658,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>java</name>\n\t<comment></comment>\n\t<projects>\n\t</proje"
},
{
"path": "demos/java/.settings/org.eclipse.jdt.core.prefs",
"chars": 595,
"preview": "eclipse.preferences.version=1\r\norg.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r\norg.eclipse.jdt.core.com"
},
{
"path": "demos/java/.vscode/launch.json",
"chars": 536,
"preview": "{\n\t// Use IntelliSense to find out which attributes exist for C# debugging\n\t// Use hover for the description of the exis"
},
{
"path": "demos/java/.vscode/settings.json",
"chars": 151,
"preview": "{\n\t\"java.dependency.packagePresentation\": \"flat\",\n\t\"java.dependency.syncWithFolderExplorer\": true,\n\t\"debugVisualizer.deb"
},
{
"path": "demos/java/src/app/App.java",
"chars": 1403,
"preview": "package app;\r\n\r\nimport app.GraphData.EdgeInfo;\r\n\r\npublic class App {\r\n\r\n public static void main(String[] args) {\r\n "
},
{
"path": "demos/java/src/app/ExtractedData.java",
"chars": 818,
"preview": "package app;\n\nimport java.util.HashMap;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackso"
},
{
"path": "demos/java/src/app/GraphData.java",
"chars": 5317,
"preview": "package app;\n\nimport java.util.ArrayDeque;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\n"
},
{
"path": "demos/java/src/app/TextData.java",
"chars": 334,
"preview": "package app;\n\npublic class TextData extends ExtractedData {\n private final String textValue;\n\n public TextData(Str"
},
{
"path": "demos/js/.vscode/settings.json",
"chars": 208,
"preview": "{\n \"editor.minimap.enabled\": false,\n \"git.enabled\": false,\n \"typescript.tsc.autoDetect\": \"off\",\n \"debugVisua"
},
{
"path": "demos/js/.vscode/tasks.json",
"chars": 257,
"preview": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"type\": \"npm\",\n\t\t\t\"script\": \"dev\",\n\t\t\t\"problemMatcher\": \"$tsc-watch\",\n\t\t\t\"isBa"
},
{
"path": "demos/js/README.md",
"chars": 110,
"preview": "# JS Demos\n\nSimply run `yarn` and select the launch target you want to debug in the debugger pane of VS Code.\n"
},
{
"path": "demos/js/custom-visualizer.js",
"chars": 1187,
"preview": "// @ts-check\n/**\n * @type {import(\"@hediet/debug-visualizer-data-extraction\").LoadDataExtractorsFn}\n */\n module.exports "
},
{
"path": "demos/js/package.json",
"chars": 251,
"preview": "{\r\n\t\"name\": \"demo\",\r\n\t\"version\": \"1.0.0\",\r\n\t\"license\": \"MIT\",\r\n\t\"dependencies\": {\r\n\t\t\"@hediet/node-reload\": \"0.7.3\",\r\n\t\t"
},
{
"path": "demos/js/src/MockLanguageServiceHost.ts",
"chars": 973,
"preview": "import * as ts from \"typescript\";\n\nexport class MockLanguageServiceHost implements ts.LanguageServiceHost {\n\tconstructor"
},
{
"path": "demos/js/src/demo_address_book.ts",
"chars": 24956,
"preview": "\nclass Person {\n constructor(public id: number, public firstName: string, public lastName: string, public email: stri"
},
{
"path": "demos/js/src/demo_custom-data-extractor.ts",
"chars": 633,
"preview": "import { getDataExtractorApi } from \"@hediet/debug-visualizer-data-extraction\";\n\n// Registers all existing extractors.\ng"
},
{
"path": "demos/js/src/demo_doubly-linked-list.ts",
"chars": 1849,
"preview": "import {\n\tgetDataExtractorApi,\n\tcreateGraphFromPointers,\n} from \"@hediet/debug-visualizer-data-extraction\";\n\ngetDataExtr"
},
{
"path": "demos/js/src/demo_fetch.js",
"chars": 179,
"preview": "const fetch = require(\"node-fetch\");\n\nfetch(\"https://jsonplaceholder.typicode.com/users\")\n .then((response) => respon"
},
{
"path": "demos/js/src/demo_random-walks.ts",
"chars": 342,
"preview": "// visualize `data`\nconst data = new Array<number>();\nlet curValue = 0;\n\nfor (let j = 0; j < 100; j++) {\n\taddManyRandomV"
},
{
"path": "demos/js/src/demo_singly-linked-list.js",
"chars": 2419,
"preview": "// See https://codeburst.io/linked-lists-in-javascript-es6-code-part-1-6dd349c3dcc3\n/*\nAfter install the Debug Visualize"
},
{
"path": "demos/js/src/demo_sorting.ts",
"chars": 1748,
"preview": "import { getDataExtractorApi } from \"@hediet/debug-visualizer-data-extraction\";\n\ngetDataExtractorApi().registerDefaultEx"
},
{
"path": "demos/js/src/demo_stack-frames.js",
"chars": 69,
"preview": "\nfunction test() {\n let i = 1;\n debugger;\n}\n\nlet i = 0;\ntest();"
},
{
"path": "demos/js/src/demo_typescript-asts.ts",
"chars": 2149,
"preview": "import * as ts from \"typescript\";\nimport { getDataExtractorApi } from \"@hediet/debug-visualizer-data-extraction\";\nimport"
},
{
"path": "demos/js/src/playground.ts",
"chars": 796,
"preview": "import {\n\tenableHotReload,\n\tregisterUpdateReconciler,\n\tgetReloadCount,\n\thotCallExportedFunction,\n} from \"@hediet/node-re"
},
{
"path": "demos/js/tsconfig.json",
"chars": 336,
"preview": "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"esnext\",\n\t\t\"module\": \"commonjs\",\n\t\t\"strict\": true,\n\t\t\"outDir\": \"dist\",\n\t\t\"skipLibCh"
},
{
"path": "demos/nim/.vscode/launch.json",
"chars": 387,
"preview": "{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"type\": \"lldb\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"name\": \"Run your Executab"
},
{
"path": "demos/nim/.vscode/tasks.json",
"chars": 119,
"preview": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"label\": \"build\",\n\t\t\t\"type\": \"shell\",\n\t\t\t\"command\": \"nim c main.nim\"\n\t\t}\n\t]\n}"
},
{
"path": "demos/nim/LICENSE",
"chars": 1072,
"preview": "MIT License\n\nCopyright (c) 2020 Danil Yarantsev\n\nPermission is hereby granted, free of charge, to any person obtaining a"
},
{
"path": "demos/nim/main.nim",
"chars": 1935,
"preview": "import random, json, options, sugar\n\ntype\n Kind = object\n array: bool\n \n Label = object\n label: Option[string]\n"
},
{
"path": "demos/nim/nim.cfg",
"chars": 43,
"preview": "# For Nim source code lines\ndebugger:native"
},
{
"path": "demos/php/.vscode/launch.json",
"chars": 465,
"preview": "{\n\t// Use IntelliSense to find out which attributes exist for C# debugging\n\t// Use hover for the description of the exis"
},
{
"path": "demos/php/.vscode/settings.json",
"chars": 129,
"preview": "{\n\t\"debugVisualizer.debugAdapterConfigurations\": {\n\t\t\"php\": {\n\t\t\t\"context\": \"watch\",\n\t\t\t\"expressionTemplate\": \"${expr}\"\n"
},
{
"path": "demos/php/demo.php",
"chars": 910,
"preview": "<?php\n\n// Install php, xdebug and the php debug extension for VS Code\n// (https://marketplace.visualstudio.com/items?ite"
},
{
"path": "demos/python/.vscode/launch.json",
"chars": 296,
"preview": "{\n\t// Use IntelliSense to find out which attributes exist for C# debugging\n\t// Use hover for the description of the exis"
},
{
"path": "demos/python/Person.py",
"chars": 229,
"preview": "class Person:\n def __init__(self, name, parents=None) -> None:\n self.name = name\n self.parents = [] if "
},
{
"path": "demos/python/debugvisualizer.py",
"chars": 1091,
"preview": "from Person import Person\nimport json\nfrom vscodedebugvisualizer import globalVisualizationFactory\n\n\nclass PersonVisuali"
},
{
"path": "demos/python/demo.py",
"chars": 2916,
"preview": "import numpy as np\n\n\n# put \"x\" in the Debug Visualizer and use step by step\n# debugging to see the diffrent types of dat"
},
{
"path": "demos/python/graph.py",
"chars": 1088,
"preview": "# Install the python extension for VS Code\n# (https:#marketplace.visualstudio.com/items?itemName=ms-python.python).\n\n# T"
},
{
"path": "demos/python/insertion_sort.py",
"chars": 1036,
"preview": "\"\"\"Python demo for sorting using VS Code Debug Visualizer.\"\"\"\n\n\ndef serialize(arr):\n \"\"\"Serialize an array into a for"
},
{
"path": "demos/ruby/README.md",
"chars": 194,
"preview": "# Ruby Demos\n\nTo visualize Ruby objects, you need to install [debugvisualizer.gem](https://github.com/ono-max/debugvisua"
},
{
"path": "demos/ruby/src/demo_custom_visualizer.rb",
"chars": 263,
"preview": "require 'debugvisualizer'\n\nclass Foo; end\n\nDebugVisualizer.register Foo do |data|\n {\n id: \"my_visualizer\",\n name:"
},
{
"path": "demos/ruby/src/demo_random_walks.rb",
"chars": 217,
"preview": "data = []\ncurVal = 0\n\n100.times{\n 100.times{\n delta = rand > 0.5 ? 1 : -1\n data << curVal\n curVal += delta\n "
},
{
"path": "demos/rust/.gitignore",
"chars": 319,
"preview": "# Generated by Cargo\n# will have compiled files and executables\n/target/\n\n# Remove Cargo.lock from gitignore if creating"
},
{
"path": "demos/rust/.vscode/launch.json",
"chars": 757,
"preview": "{\n // Use IntelliSense to learn about possible attributes.\n // Hover to view descriptions of existing attributes.\n"
},
{
"path": "demos/rust/.vscode/settings.json",
"chars": 165,
"preview": "{\n \"debugVisualizer.debugAdapterConfigurations\": {\n \"lldb\": {\n \"expressionTemplate\": \"${expr}\",\n "
},
{
"path": "demos/rust/Cargo.toml",
"chars": 268,
"preview": "[package]\nname = \"rust_demo\"\nversion = \"0.1.0\"\nauthors = [\"hediet\"]\nedition = \"2018\"\n\n# See more keys and their definiti"
},
{
"path": "demos/rust/src/main.rs",
"chars": 2102,
"preview": "use serde::Serialize;\n\n// expected to mirror\n// https://hediet.github.io/visualization/docs/visualization-data-schema.js"
},
{
"path": "demos/swift/.gitignore",
"chars": 53,
"preview": ".DS_Store\n/.build\n/Packages\n/*.xcodeproj\nxcuserdata/\n"
},
{
"path": "demos/swift/.vscode/launch.json",
"chars": 322,
"preview": "// .vscode/launch.json\n{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t// Running executables\n\t\t{\n\t\t\t\"type\": \"lldb\",\n\t\t\t\"r"
},
{
"path": "demos/swift/.vscode/settings.json",
"chars": 229,
"preview": "{\n\t// You need to adapt this path to your swift installation.\n\t// See here for more info:\n\t// https://github.com/vadimcn"
},
{
"path": "demos/swift/.vscode/tasks.json",
"chars": 437,
"preview": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t// compile your SPM project\n\t\t{\n\t\t\t\"label\": \"swift-build\",\n\t\t\t\"type\": \"shell\",\n\t\t\t\""
},
{
"path": "demos/swift/Package.swift",
"chars": 795,
"preview": "// swift-tools-version:5.1\n// The swift-tools-version declares the minimum version of Swift required to build this packa"
},
{
"path": "demos/swift/Sources/swiftDemo/main.swift",
"chars": 159,
"preview": "let s = \"{\\\"kind\\\":{\\\"graph\\\":true},\"\n + \"\\\"nodes\\\":[{\\\"id\\\":\\\"1\\\"},{\\\"id\\\":\\\"2\\\"}],\"\n + \"\\\"edges\\\":[{\\\"fr"
},
{
"path": "demos/swift/Tests/LinuxMain.swift",
"chars": 112,
"preview": "import XCTest\n\nimport swiftTests\n\nvar tests = [XCTestCaseEntry]()\ntests += swiftTests.allTests()\nXCTMain(tests)\n"
},
{
"path": "demos/swift/Tests/swiftDemoTests/XCTestManifests.swift",
"chars": 155,
"preview": "import XCTest\n\n#if !canImport(ObjectiveC)\npublic func allTests() -> [XCTestCaseEntry] {\n return [\n testCase(sw"
},
{
"path": "demos/swift/Tests/swiftDemoTests/swiftDemoTests.swift",
"chars": 1371,
"preview": "import XCTest\nimport class Foundation.Bundle\n\nfinal class swiftTests: XCTestCase {\n func testExample() throws {\n "
},
{
"path": "demos/swift/main.swift",
"chars": 35,
"preview": "import Swift\nprint(\"Hello, World!\")"
},
{
"path": "docs/main.plantuml",
"chars": 426,
"preview": "@startuml Main\n\n[data-extraction] \n[webview]\n[extension]\n[hediet/visualization]\n\n[webview] ..> [extension]: \"Uses RPC co"
},
{
"path": "extension/.vscodeignore",
"chars": 14,
"preview": "./node_modules"
},
{
"path": "extension/CHANGELOG.md",
"chars": 3405,
"preview": "# Change Log\n\n## 2.6.0\n\n- Improved JS data extractors\n- Uses the active stack frame (instead of the top-most) for ev"
},
{
"path": "extension/LICENSE.md",
"chars": 34887,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\nCopyright (C) 2007 Free S"
},
{
"path": "extension/README.md",
"chars": 8303,
"preview": "# Debug Visualizer\n\n[](https://twitter.com/intent/"
},
{
"path": "extension/package.json",
"chars": 4417,
"preview": "{\n\t\"name\": \"debug-visualizer\",\n\t\"private\": true,\n\t\"displayName\": \"Debug Visualizer\",\n\t\"description\": \"A visual watch win"
},
{
"path": "extension/src/Config.ts",
"chars": 3743,
"preview": "import { workspace, window, ColorThemeKind } from \"vscode\";\nimport { Disposable } from \"@hediet/std/disposable\";\nimport "
},
{
"path": "extension/src/VisualizationBackend/ComposedVisualizationSupport.ts",
"chars": 575,
"preview": "import {\n\tDebugSessionVisualizationSupport,\n\tVisualizationBackend,\n} from \"./VisualizationBackend\";\nimport { DebugSessio"
},
{
"path": "extension/src/VisualizationBackend/ConfigurableVisualizationSupport.ts",
"chars": 1630,
"preview": "import { DataExtractorId } from \"@hediet/debug-visualizer-data-extraction\";\nimport { DebugSessionProxy } from \"../proxie"
},
{
"path": "extension/src/VisualizationBackend/DispatchingVisualizationBackend.ts",
"chars": 3545,
"preview": "import { DataExtractionResult } from \"@hediet/debug-visualizer-data-extraction\";\nimport { CompletionItem, FormattedMessa"
},
{
"path": "extension/src/VisualizationBackend/GenericVisualizationSupport.ts",
"chars": 6075,
"preview": "import {\n\tDataExtractionResult,\n\tDataExtractorId,\n\tGraphNode,\n\tGraphVisualizationData,\n} from \"@hediet/debug-visualizer-"
},
{
"path": "extension/src/VisualizationBackend/JsVisualizationSupport.ts",
"chars": 11598,
"preview": "import {\n\tApiHasNotBeenInitializedCode,\n\tCallFrameRequest,\n\tCallFramesRequest,\n\tDataExtractionResult,\n\tDataExtractorId,\n"
},
{
"path": "extension/src/VisualizationBackend/PyVisualizationSupport.ts",
"chars": 3998,
"preview": "import {\n\tDataExtractionResult,\n\tDataExtractorId,\n} from \"@hediet/debug-visualizer-data-extraction\";\nimport { hotClass, "
},
{
"path": "extension/src/VisualizationBackend/RbVisualizationSupport.ts",
"chars": 4206,
"preview": "import {\n\tDataExtractionResult,\n\tDataResult,\n} from \"@hediet/debug-visualizer-data-extraction\";\nimport { hotClass, regis"
},
{
"path": "extension/src/VisualizationBackend/VisualizationBackend.ts",
"chars": 2390,
"preview": "import {\n\tDataExtractionResult,\n\tDataExtractorId,\n} from \"@hediet/debug-visualizer-data-extraction\";\nimport { Disposable"
},
{
"path": "extension/src/VisualizationBackend/index.ts",
"chars": 473,
"preview": "export * from \"./VisualizationBackend\";\n\nexport { ComposedVisualizationSupport } from \"./ComposedVisualizationSupport\";\n"
},
{
"path": "extension/src/VisualizationBackend/parseEvaluationResultFromGenericDebugAdapter.ts",
"chars": 2657,
"preview": "import {\n\tDataExtractionResult,\n\tisVisualizationData,\n} from \"@hediet/debug-visualizer-data-extraction\";\nimport { Format"
},
{
"path": "extension/src/VisualizationWatchModel/VisualizationWatchModel.ts",
"chars": 1071,
"preview": "import { DataExtractorId } from \"@hediet/debug-visualizer-data-extraction\";\nimport { CompletionItem, DataExtractionState"
},
{
"path": "extension/src/VisualizationWatchModel/VisualizationWatchModelImpl.ts",
"chars": 4015,
"preview": "import { DataExtractorId } from \"@hediet/debug-visualizer-data-extraction\";\nimport { hotClass } from \"@hediet/node-reloa"
},
{
"path": "extension/src/VisualizationWatchModel/index.ts",
"chars": 90,
"preview": "export * from \"./VisualizationWatchModelImpl\";\nexport * from \"./VisualizationWatchModel\";\n"
},
{
"path": "extension/src/extension.ts",
"chars": 3667,
"preview": "import { window, ExtensionContext, commands } from \"vscode\";\nimport { Disposable } from \"@hediet/std/disposable\";\nimport"
},
{
"path": "extension/src/proxies/DebugSessionProxy.ts",
"chars": 2686,
"preview": "import { observable } from \"mobx\";\nimport { DebugSession } from \"vscode\";\nimport { CompletionItem } from \"../webviewCont"
},
{
"path": "extension/src/proxies/DebuggerProxy.ts",
"chars": 2846,
"preview": "import { Disposable } from \"@hediet/std/disposable\";\nimport { EventEmitter } from \"@hediet/std/events\";\nimport { debug, "
},
{
"path": "extension/src/proxies/DebuggerViewProxy.ts",
"chars": 1895,
"preview": "import { Disposable } from \"@hediet/std/disposable\";\nimport { CancellationToken, debug, DebugSession, InlineValue, Inlin"
},
{
"path": "extension/src/types.d.ts",
"chars": 189,
"preview": "declare namespace NodeJS {\n\tdeclare interface ProcessEnv {\n\t\tHOT_RELOAD?: \"true\";\n\t\tUSE_DEV_UI?: \"true\";\n\t}\n}\n\ndeclare m"
},
{
"path": "extension/src/utils/DebouncedRunner.ts",
"chars": 433,
"preview": "export class DebouncedRunner {\r\n\tprivate timeout: NodeJS.Timeout | undefined;\r\n\r\n\tconstructor(private readonly debounceT"
},
{
"path": "extension/src/utils/IncrementalMap.ts",
"chars": 799,
"preview": "import { Disposable } from \"@hediet/std/disposable\";\r\nimport { observable, autorun } from \"mobx\";\r\n\r\nexport class Increm"
},
{
"path": "extension/src/utils/VsCodeSettings.ts",
"chars": 2905,
"preview": "import { Uri, workspace, ConfigurationTarget, Disposable } from \"vscode\";\nimport { fromResource } from \"mobx-utils\";\nimp"
},
{
"path": "extension/src/webview/InternalWebviewManager.ts",
"chars": 4140,
"preview": "import { window, ViewColumn, WebviewPanel } from \"vscode\";\nimport { WebviewServer } from \"./WebviewServer\";\nimport { Dis"
},
{
"path": "extension/src/webview/WebviewConnection.ts",
"chars": 6522,
"preview": "import { Disposable } from \"@hediet/std/disposable\";\nimport { ConsoleRpcLogger, RequestHandlingError } from \"@hediet/typ"
},
{
"path": "extension/src/webview/WebviewServer.ts",
"chars": 2404,
"preview": "import { WebSocketStream } from \"@hediet/typed-json-rpc-websocket\";\nimport { AddressInfo } from \"net\";\nimport WebSocket "
},
{
"path": "extension/src/webviewContract.ts",
"chars": 3840,
"preview": "import {\n\tcontract,\n\tnotificationContract,\n\ttypes,\n\trequestContract,\n} from \"@hediet/typed-json-rpc\";\nimport {\n\tDataExtr"
},
{
"path": "extension/tsconfig.json",
"chars": 326,
"preview": "{\n\t\"compilerOptions\": {\n\t\t\"module\": \"commonjs\",\n\t\t\"target\": \"ES2017\",\n\t\t\"outDir\": \"dist\",\n\t\t\"lib\": [\"ES2017\"],\n\t\t\"source"
},
{
"path": "extension/webpack.config.ts",
"chars": 1509,
"preview": "import { CleanWebpackPlugin } from \"clean-webpack-plugin\";\nimport * as CopyPlugin from \"copy-webpack-plugin\";\nimport { r"
},
{
"path": "package.json",
"chars": 461,
"preview": "{\n\t\"private\": true,\n\t\"workspaces\": [\n\t\t\"./data-extraction\",\n\t\t\"./extension\",\n\t\t\"./webview\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": "
},
{
"path": "tslint.json",
"chars": 70,
"preview": "{\n\t\"extends\": \"recommended\",\n\t\"rules\": {\n\t\t\"await-promise\": true\n\t}\n}\n"
},
{
"path": "webview/index.js",
"chars": 208,
"preview": "// This is the entry point when this package is used as library from the extension.\n// This package MUST NOT be bundled."
},
{
"path": "webview/package.json",
"chars": 1459,
"preview": "{\n\t\"name\": \"debug-visualizer-webview\",\n\t\"version\": \"0.0.1\",\n\t\"license\": \"GPL-3.0\",\n\t\"scripts\": {\n\t\t\"dev\": \"webpack-dev-s"
},
{
"path": "webview/src/components/App.tsx",
"chars": 536,
"preview": "import * as React from \"react\";\nimport { hotComponent } from \"../hotComponent\";\nimport { GUI } from \"./GUI\";\nimport { Mo"
},
{
"path": "webview/src/components/ExpressionInput.tsx",
"chars": 2748,
"preview": "import * as React from \"react\";\nimport { Model } from \"../model/Model\";\nimport { observer, disposeOnUnmount } from \"mobx"
},
{
"path": "webview/src/components/GUI.tsx",
"chars": 2825,
"preview": "import { Button, Spinner } from \"@blueprintjs/core\";\nimport { action, observable } from \"mobx\";\nimport { observer } from"
},
{
"path": "webview/src/components/NoData.tsx",
"chars": 1928,
"preview": "import * as React from \"react\";\nimport { observer } from \"mobx-react\";\nimport { observable } from \"mobx\";\nimport Measure"
},
{
"path": "webview/src/components/Visualizer.tsx",
"chars": 2122,
"preview": "import * as React from \"react\";\nimport { Model } from \"../model/Model\";\nimport { observer } from \"mobx-react\";\nimport { "
},
{
"path": "webview/src/components/VisualizerHeaderDetails.tsx",
"chars": 3638,
"preview": "import * as React from \"react\";\nimport { Popover, Checkbox } from \"@blueprintjs/core\";\nimport { DataExtractorInfo } from"
},
{
"path": "webview/src/hotComponent.tsx",
"chars": 1223,
"preview": "import Module = require(\"module\");\nimport { observer } from \"mobx-react\";\nimport * as React from \"react\";\nimport { obser"
},
{
"path": "webview/src/index.tsx",
"chars": 349,
"preview": "import * as monaco from \"monaco-editor\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport {"
},
{
"path": "webview/src/model/Model.ts",
"chars": 7161,
"preview": "import { DataExtractorId, VisualizationData } from \"@hediet/debug-visualizer-data-extraction\";\nimport { Disposable } fro"
},
{
"path": "webview/src/model/MonacoBridge.ts",
"chars": 4444,
"preview": "import * as monaco from \"monaco-editor\";\nimport { Model } from \"./Model\";\nimport { Disposable } from \"@hediet/std/dispos"
},
{
"path": "webview/src/model/VsCodeApi.ts",
"chars": 1864,
"preview": "import { Barrier } from \"@hediet/std/synchronization\";\n\nexport interface VSCodeApi<TState> {\n\tgetState(): Promise<TState"
},
{
"path": "webview/src/model/lib.es5.d.ts.txt",
"chars": 202788,
"preview": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. A"
},
{
"path": "webview/src/style.scss",
"chars": 3258,
"preview": "@import \"~normalize.css\";\n@import \"~@blueprintjs/core/lib/css/blueprint.css\";\n@import \"~@blueprintjs/icons/lib/css/bluep"
},
{
"path": "webview/src/vscode-dark.scss",
"chars": 16521,
"preview": ":root {\n --background-color: #263238;\n --color: #eeffff;\n --font-family: -apple-system, BlinkMacSystemFont, \"Se"
},
{
"path": "webview/src/vscode-light.scss",
"chars": 14366,
"preview": ":root {\n\t--vscode-activityBar-background: #2c2c2c;\n\t--vscode-activityBar-dropBackground: rgba(255, 255, 255, 0.12);\n\t--v"
},
{
"path": "webview/tsconfig.json",
"chars": 389,
"preview": "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"ES2017\",\n\t\t\"module\": \"commonjs\",\n\t\t\"strict\": true,\n\t\t\"outDir\": \"dist\",\n\t\t\"lib\": [\"D"
},
{
"path": "webview/webpack.config.ts",
"chars": 1845,
"preview": "import { CleanWebpackPlugin } from \"clean-webpack-plugin\";\nimport * as HtmlWebpackPlugin from \"html-webpack-plugin\";\nimp"
}
]
About this extraction
This page contains the full source code of the hediet/vscode-debug-visualizer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 182 files (578.3 KB), approximately 151.6k tokens, and a symbol index with 510 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.