Skip to content

Commit

Permalink
feat(repo-map): zig support (yetone#663)
Browse files Browse the repository at this point in the history
* feature: zig support for repo map

* Update crates/avante-repo-map/Cargo.toml

Co-authored-by: yetone <yetoneful@gmail.com>

* fix: update lint error

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Co-authored-by: Aaron Pham <Aaronpham0103@gmail.com>
Co-authored-by: yetone <yetoneful@gmail.com>
Co-authored-by: Aaron Pham <contact@aarnphm.xyz>
  • Loading branch information
4 people authored Sep 29, 2024
1 parent d28fece commit bac46ce
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 7 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/avante-repo-map/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tree-sitter-c = "0.23"
tree-sitter-cpp = "0.23"
tree-sitter-lua = "0.2"
tree-sitter-ruby = "0.23"
tree-sitter-zig = "1.0.2"

[lints]
workspace = true
Expand Down
23 changes: 23 additions & 0 deletions crates/avante-repo-map/queries/tree-sitter-zig-defs.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
;; Capture functions, structs, methods, variable definitions, and unions in Zig
(variable_declaration (identifier)
(struct_declaration
(container_field) @class_variable))

(variable_declaration (identifier)
(struct_declaration
(function_declaration
name: (identifier) @method)))

(variable_declaration (identifier)
(enum_declaration
(container_field
type: (identifier) @enum_item)))

(variable_declaration (identifier)
(union_declaration
(container_field
name: (identifier) @union_item)))

(source_file (function_declaration) @function)

(source_file (variable_declaration (identifier) @variable))
Loading

0 comments on commit bac46ce

Please sign in to comment.