feat(repo-map): add swift, java and php support (#1446)
This commit is contained in:
25
crates/avante-repo-map/queries/tree-sitter-java-defs.scm
Normal file
25
crates/avante-repo-map/queries/tree-sitter-java-defs.scm
Normal file
@@ -0,0 +1,25 @@
|
||||
;; Capture exported functions, arrow functions, variables, classes, and method definitions
|
||||
|
||||
(class_declaration
|
||||
name: (identifier) @class)
|
||||
|
||||
(interface_declaration
|
||||
name: (identifier) @class)
|
||||
|
||||
(enum_declaration
|
||||
name: (identifier) @enum)
|
||||
|
||||
(enum_constant
|
||||
name: (identifier) @enum_item)
|
||||
|
||||
(class_body
|
||||
(field_declaration) @class_variable)
|
||||
|
||||
(class_body
|
||||
(constructor_declaration) @method)
|
||||
|
||||
(class_body
|
||||
(method_declaration) @method)
|
||||
|
||||
(interface_body
|
||||
(method_declaration) @method)
|
||||
20
crates/avante-repo-map/queries/tree-sitter-php-defs.scm
Normal file
20
crates/avante-repo-map/queries/tree-sitter-php-defs.scm
Normal file
@@ -0,0 +1,20 @@
|
||||
;; Capture exported functions, arrow functions, variables, classes, and method definitions
|
||||
|
||||
(class_declaration) @class
|
||||
(interface_declaration) @class
|
||||
|
||||
(function_definition) @function
|
||||
|
||||
(assignment_expression) @assignment
|
||||
|
||||
(const_declaration
|
||||
(const_element
|
||||
(name) @variable))
|
||||
|
||||
(_
|
||||
body: (declaration_list
|
||||
(property_declaration) @class_variable))
|
||||
|
||||
(_
|
||||
body: (declaration_list
|
||||
(method_declaration) @method))
|
||||
37
crates/avante-repo-map/queries/tree-sitter-swift-defs.scm
Normal file
37
crates/avante-repo-map/queries/tree-sitter-swift-defs.scm
Normal file
@@ -0,0 +1,37 @@
|
||||
(property_declaration) @variable
|
||||
|
||||
(function_declaration) @function
|
||||
|
||||
|
||||
(class_declaration
|
||||
_?
|
||||
[
|
||||
"struct"
|
||||
"class"
|
||||
]) @class
|
||||
|
||||
(class_declaration
|
||||
_?
|
||||
"enum"
|
||||
) @enum
|
||||
|
||||
(class_body
|
||||
(property_declaration) @class_variable)
|
||||
|
||||
(class_body
|
||||
(function_declaration) @method)
|
||||
|
||||
(class_body
|
||||
(init_declaration) @method)
|
||||
|
||||
(protocol_declaration
|
||||
body: (protocol_body
|
||||
(protocol_function_declaration) @function))
|
||||
|
||||
(protocol_declaration
|
||||
body: (protocol_body
|
||||
(protocol_property_declaration) @class_variable))
|
||||
|
||||
(class_declaration
|
||||
body: (enum_class_body
|
||||
(enum_entry) @enum_item))
|
||||
Reference in New Issue
Block a user