mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-09 03:17:54 +00:00
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:
parent
1b8c3c77af
commit
ee6753bf05
1 changed files with 8 additions and 0 deletions
|
|
@ -458,10 +458,18 @@ export const KOTLIN_QUERIES = `
|
||||||
(type_identifier) @call.name)) @call
|
(type_identifier) @call.name)) @call
|
||||||
|
|
||||||
; ── Heritage: extends / implements via delegation_specifier ──────────────
|
; ── Heritage: extends / implements via delegation_specifier ──────────────
|
||||||
|
; Interface implementation (bare user_type): class Foo : Bar
|
||||||
(class_declaration
|
(class_declaration
|
||||||
(type_identifier) @heritage.class
|
(type_identifier) @heritage.class
|
||||||
(delegation_specifier
|
(delegation_specifier
|
||||||
(user_type (type_identifier) @heritage.extends))) @heritage
|
(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> = {
|
export const LANGUAGE_QUERIES: Record<SupportedLanguages, string> = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue