Open bqv opened 1 week ago
My attempt:
(source_file
(#set! "kind" "File")) @symbol
; Package
(package_header
(identifier) @name
(#set! "kind" "Package")) @symbol
; Enums
(class_declaration
(type_identifier) @name
(enum_class_body)
(#set! "kind" "Enum")) @symbol
(enum_entry
(simple_identifier) @name
(#set! "kind" "EnumMember")) @symbol
; Classes
(class_declaration
(type_identifier) @name
(#set! "kind" "Class")) @symbol
(object_declaration
(type_identifier) @name
(#set! "kind" "Object")) @symbol
; Functions
(function_declaration
(simple_identifier) @name
(#set! "kind" "Function")) @symbol
(anonymous_initializer
(#offset! @name 0 0 0 4)
(#set! "kind" "Constructor")) @symbol
(secondary_constructor
(#offset! @name 0 1 0 -1)
(#set! "kind" "Constructor")) @symbol
; Properties
(property_declaration
(variable_declaration
(simple_identifier) @name
)
(#set! "kind" "Property")) @symbol
(getter
(#offset! @name 0 1 0 -1)
(#set! "kind" "Method")) @symbol
(setter
(#offset! @name 0 1 0 -1)
(#set! "kind" "Method")) @symbol
; Blocks
(call_expression
(call_expression
(simple_identifier) @name
)
(call_suffix
(annotated_lambda)
)
(#set! "kind" "Namespace")) @symbol
(call_expression
(simple_identifier) @name
(call_suffix
(annotated_lambda)
)
(#set! "kind" "Namespace")) @symbol
(call_expression
(navigation_expression
(navigation_suffix
(simple_identifier) @name
)
)
(call_suffix
(annotated_lambda)
)
(#set! "kind" "Namespace")) @symbol
(boolean_literal
(#set! "kind" "Boolean")) @symbol
(string_literal
(#set! "kind" "String")) @symbol
(integer_literal
(#set! "kind" "Number")) @symbol
Language: Kotlin