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:
@@ -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> = {
|
||||
|
||||
Reference in New Issue
Block a user