Implements GenericDataExtractionProviderFactory. With this, the debug visualizer can be used with every language that can be debugged in VS Code.

This commit is contained in:
Henning Dieterichs
2020-02-18 03:04:59 +01:00
parent 5a4678b876
commit 5bc4347f3c
15 changed files with 466 additions and 253 deletions

View File

@@ -1,4 +1,4 @@
import { ExtractedData } from "../../../DataExtractionResult";
import { ExtractedData, isExtractedData } from "../../../DataExtractionResult";
import {
DataExtractor,
ExtractionCollector,
@@ -12,17 +12,7 @@ export class AsIsDataExtractor implements DataExtractor<ExtractedData> {
extractionCollector: ExtractionCollector<ExtractedData>,
context: DataExtractorContext
): void {
if (typeof data !== "object" || !data || !("kind" in data)) {
return;
}
const obj = data as any;
if (typeof obj.kind !== "object" || !obj.kind) {
return;
}
const areAllTrue = Object.values(obj.kind).every(val => val === true);
if (!areAllTrue) {
if (!isExtractedData(data)) {
return;
}
@@ -31,7 +21,7 @@ export class AsIsDataExtractor implements DataExtractor<ExtractedData> {
name: "As Is",
priority: 500,
extractData() {
return obj;
return data;
},
});
}