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.
This commit is contained in:
Gary Magyar 2026-02-27 09:28:58 +00:00
parent 1b8c3c77af
commit ee6753bf05

View file

@ -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<SupportedLanguages, string> = {