From ad9f8386f51deda753ed479af8178600bda4d6b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Apr 2026 19:07:13 +0000 Subject: [PATCH] refactor: address code review feedback on heritage extractor - Simplify makeNode test helper parameter type - Use !== null check in parse worker for extractFromCall result Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/b55df80d-758a-48cd-96de-a7657bdc2acb Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> --- gitnexus/src/core/ingestion/workers/parse-worker.ts | 2 +- gitnexus/test/unit/heritage-extraction.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index f982788ae..c123a9d90 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -1706,7 +1706,7 @@ const processFileGroup = ( captureMap['call']!, { filePath: file.path, language }, ); - if (heritageItems && heritageItems.length > 0) { + if (heritageItems !== null) { for (const item of heritageItems) { result.heritage.push({ filePath: file.path, diff --git a/gitnexus/test/unit/heritage-extraction.test.ts b/gitnexus/test/unit/heritage-extraction.test.ts index 77ed930a1..787971f07 100644 --- a/gitnexus/test/unit/heritage-extraction.test.ts +++ b/gitnexus/test/unit/heritage-extraction.test.ts @@ -40,7 +40,7 @@ interface MockNode { } /** Create a minimal mock SyntaxNode for capture map entries. */ -function makeNode(text: string, type = 'identifier', parent?: MockNode | null): MockNode { +function makeNode(text: string, type = 'identifier', parent?: MockNode): MockNode { return { type, text, parent: parent ?? null }; }