From 47304ecbfa1f3092db7ef0930215178a52867153 Mon Sep 17 00:00:00 2001 From: Changhoon Sung Date: Wed, 8 Apr 2026 12:45:36 -0700 Subject: [PATCH] fix(core-ingestion): preserve effective container in chunks Keep method chunks aligned with entity ownership so Go receiver methods and similar cases retain the computed effective container. --- core-ingestion/src/__tests__/queries.go.test.ts | 7 +++++++ core-ingestion/src/index.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core-ingestion/src/__tests__/queries.go.test.ts b/core-ingestion/src/__tests__/queries.go.test.ts index 273cdcb3..e4e53ca2 100644 --- a/core-ingestion/src/__tests__/queries.go.test.ts +++ b/core-ingestion/src/__tests__/queries.go.test.ts @@ -38,6 +38,13 @@ func (s *Service) Run() { dstName: 'fmt', predicate: 'IMPORTS', }); + + expect(result!.entities).toContainEqual( + expect.objectContaining({ name: 'Run', kind: 'method', container: 'Service' }), + ); + expect(result!.chunks).toContainEqual( + expect.objectContaining({ name: 'Run', chunkKind: 'method', container: 'Service' }), + ); }); it('captures REFERENCES edges for pointer-typed struct fields (Bug 2)', () => { diff --git a/core-ingestion/src/index.ts b/core-ingestion/src/index.ts index d0a141b0..770ab422 100644 --- a/core-ingestion/src/index.ts +++ b/core-ingestion/src/index.ts @@ -480,7 +480,7 @@ export function parseFile(filePath: string, source: string): FileParseResult | n startByte, endByte, language, - container: enclosing ?? undefined, + container: effectiveContainer, }); if (kind === 'class' || kind === 'interface' || kind === 'trait') {