From 69a611e0f54ac430ec7272c6ac612fb1d8b970cd Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Wed, 18 Mar 2026 09:36:14 +0000 Subject: [PATCH] fix: Go tree-sitter query captures field_declaration not field_declaration_list Post-review fix: the Go struct field query incorrectly put @definition.property on field_declaration_list (the list container) instead of field_declaration (the individual field). Also removed unused `language` parameter from extractPropertyDeclaredType. --- gitnexus/src/core/ingestion/tree-sitter-queries.ts | 2 +- gitnexus/src/core/ingestion/workers/parse-worker.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gitnexus/src/core/ingestion/tree-sitter-queries.ts b/gitnexus/src/core/ingestion/tree-sitter-queries.ts index f6613af4e..9cdae7986 100644 --- a/gitnexus/src/core/ingestion/tree-sitter-queries.ts +++ b/gitnexus/src/core/ingestion/tree-sitter-queries.ts @@ -255,7 +255,7 @@ export const GO_QUERIES = ` ; Struct fields — named field declarations inside struct types (field_declaration_list (field_declaration - name: (field_identifier) @name)) @definition.property + name: (field_identifier) @name) @definition.property) ; Struct embedding (anonymous fields = inheritance) (type_declaration diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index 96d5285f4..ab0a9799e 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -64,7 +64,7 @@ import { extractSimpleTypeName } from '../type-extractors/shared.js'; * * Returns the normalized type name, or undefined if no type can be extracted. */ -const extractPropertyDeclaredType = (definitionNode: any, language: SupportedLanguages): string | undefined => { +const extractPropertyDeclaredType = (definitionNode: any): string | undefined => { if (!definitionNode) return undefined; // Strategy 1: Look for a `type` or `type_annotation` named field @@ -1218,7 +1218,7 @@ const processFileGroup = ( } else if (nodeLabel === 'Property' && definitionNode) { // Extract the declared type for property/field nodes. // Walk the definition node for type annotation children. - declaredType = extractPropertyDeclaredType(definitionNode, language); + declaredType = extractPropertyDeclaredType(definitionNode); } result.nodes.push({