forked from Mirrors/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94346356e7
The current `:tree-sitter-subtree` has a bug for field-names when the field name belongs to an unnamed child node. Take this ruby example: def self.method_name true end The subtree given by tree-sitter-cli is: (singleton_method [2, 0] - [4, 3] object: (self [2, 4] - [2, 8]) name: (identifier [2, 9] - [2, 20]) body: (body_statement [3, 2] - [3, 6] (true [3, 2] - [3, 6]))) But the `:tree-sitter-subtree` output was (singleton_method object: (self) body: (identifier) (body_statement (true))) The `singleton_method` rule defines the `name` and `body` fields in an unnamed helper rule `_method_rest` and the old implementation of `pretty_print_tree_impl` would pass the `field_name` down from the named `singleton_method` node. To fix it we switch to the [TreeCursor] API which is recommended by the tree-sitter docs for traversing the tree. `TreeCursor::field_name` accurately determines the field name for the current cursor position even when the node is unnamed. [TreeCursor]: https://docs.rs/tree-sitter/0.20.9/tree_sitter/struct.TreeCursor.html |
2 years ago | |
---|---|---|
.. | ||
increment | 2 years ago | |
auto_pairs.rs | 2 years ago | |
chars.rs | 3 years ago | |
comment.rs | 2 years ago | |
config.rs | 3 years ago | |
diagnostic.rs | 2 years ago | |
diff.rs | 3 years ago | |
graphemes.rs | 2 years ago | |
history.rs | 2 years ago | |
indent.rs | 2 years ago | |
lib.rs | 2 years ago | |
line_ending.rs | 2 years ago | |
macros.rs | 4 years ago | |
match_brackets.rs | 3 years ago | |
movement.rs | 2 years ago | |
object.rs | 2 years ago | |
path.rs | 2 years ago | |
position.rs | 2 years ago | |
register.rs | 2 years ago | |
search.rs | 3 years ago | |
selection.rs | 2 years ago | |
shellwords.rs | 2 years ago | |
surround.rs | 2 years ago | |
syntax.rs | 2 years ago | |
test.rs | 2 years ago | |
textobject.rs | 2 years ago | |
transaction.rs | 2 years ago | |
wrap.rs | 3 years ago |