@c4a/extract-go 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -12861,7 +12861,9 @@ function semanticExtractionPayload(extraction) {
|
|
|
12861
12861
|
stats: extraction.stats
|
|
12862
12862
|
};
|
|
12863
12863
|
}
|
|
12864
|
-
function relationSourceFile(relation, symbols) {
|
|
12864
|
+
function relationSourceFile(relation, symbols, filePaths) {
|
|
12865
|
+
if (filePaths.has(relation.from))
|
|
12866
|
+
return relation.from;
|
|
12865
12867
|
const candidates = symbols.filter((symbol) => symbol.name === relation.from);
|
|
12866
12868
|
if (candidates.length === 1)
|
|
12867
12869
|
return candidates[0].file;
|
|
@@ -12891,6 +12893,7 @@ function extractionResultToEvidenceAdapterResult(extraction, invocation) {
|
|
|
12891
12893
|
}
|
|
12892
12894
|
const coverageByPath = new Map(coverage.files.map((file) => [file.path, file]));
|
|
12893
12895
|
const fileInfoByPath = new Map(extraction.files.map((file) => [file.path, file]));
|
|
12896
|
+
const filePaths = new Set([...coverageByPath.keys(), ...fileInfoByPath.keys()]);
|
|
12894
12897
|
for (const file of extraction.files) {
|
|
12895
12898
|
if (!coverageByPath.has(file.path)) {
|
|
12896
12899
|
throw new TypeError(`ExtractionResult file ${file.path} has no coverage disposition`);
|
|
@@ -12907,7 +12910,7 @@ function extractionResultToEvidenceAdapterResult(extraction, invocation) {
|
|
|
12907
12910
|
const generatedDiagnostics = [];
|
|
12908
12911
|
const relationsByFile = new Map;
|
|
12909
12912
|
for (const relation of extraction.relations) {
|
|
12910
|
-
const file = relationSourceFile(relation, extraction.symbols);
|
|
12913
|
+
const file = relationSourceFile(relation, extraction.symbols, filePaths);
|
|
12911
12914
|
if (file === null || coverageByPath.get(file)?.disposition !== "analyzed") {
|
|
12912
12915
|
generatedDiagnostics.push({
|
|
12913
12916
|
code: "relation-locator-unresolved",
|