From ee6753bf055ee862eb42562fa709c8fbfeccdb09 Mon Sep 17 00:00:00 2001 From: Gary Magyar Date: Fri, 27 Feb 2026 09:28:58 +0000 Subject: [PATCH] fix(kotlin): capture constructor-based heritage (class Foo : Bar()) The heritage query only matched bare user_type delegation specifiers (interface implementation), missing constructor_invocation patterns used for class extension. Adds a second heritage pattern for constructor invocations, capturing ~3x more heritage edges. --- gitnexus/src/core/ingestion/tree-sitter-queries.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gitnexus/src/core/ingestion/tree-sitter-queries.ts b/gitnexus/src/core/ingestion/tree-sitter-queries.ts index 747836617..66644a6d0 100644 --- a/gitnexus/src/core/ingestion/tree-sitter-queries.ts +++ b/gitnexus/src/core/ingestion/tree-sitter-queries.ts @@ -458,10 +458,18 @@ export const KOTLIN_QUERIES = ` (type_identifier) @call.name)) @call ; ── Heritage: extends / implements via delegation_specifier ────────────── +; Interface implementation (bare user_type): class Foo : Bar (class_declaration (type_identifier) @heritage.class (delegation_specifier (user_type (type_identifier) @heritage.extends))) @heritage + +; Class extension (constructor_invocation): class Foo : Bar() +(class_declaration + (type_identifier) @heritage.class + (delegation_specifier + (constructor_invocation + (user_type (type_identifier) @heritage.extends)))) @heritage `; export const LANGUAGE_QUERIES: Record = {