fix(repo-map): only return top level definitions (#659)

This commit is contained in:
yetone
2024-09-27 22:23:45 +08:00
committed by GitHub
parent d74c9d0417
commit ac959ccbbe
2 changed files with 79 additions and 14 deletions

View File

@@ -1,18 +1,30 @@
;; Capture top-level functions and struct definitions
(var_declaration
(var_spec) @variable
(source_file
(var_declaration
(var_spec) @variable
)
)
(const_declaration
(const_spec) @variable
(source_file
(const_declaration
(const_spec) @variable
)
)
(function_declaration) @function
(type_declaration
(type_spec (struct_type)) @class
(source_file
(function_declaration) @function
)
(type_declaration
(type_spec
(struct_type
(field_declaration_list
(field_declaration) @class_variable)))
(source_file
(type_declaration
(type_spec (struct_type)) @class
)
)
(source_file
(type_declaration
(type_spec
(struct_type
(field_declaration_list
(field_declaration) @class_variable)))
)
)
(source_file
(method_declaration) @method
)
(method_declaration) @method