Files
vscode-debug-visualizer/example-project/src/demo_custom-data-extractor.ts
Henning Dieterichs d4c6e942d0 * Updates Dependencies
* Uses webpack to bundle runtime library into a single file
* Inject the entire file into the Debugee
* Register runtime helpers (hediet_dbgVis)
2020-02-12 14:20:45 +01:00

32 lines
608 B
TypeScript

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();
debugger;
}
}