Commit graph

39 commits

Author SHA1 Message Date
Riley Bruins
b36ef4b7f4 fix(lib)!: child_containing_descendant now returns direct children
Previously, `child_containing_descendant` would return `null` when
called on a node's direct parent. In my opinion, this doesn't make much
sense; it seems like a node would contain itself. This (breaking)
commit changes the function so that it can return direct children.
2024-09-29 17:44:37 -04:00
Amaan Qureshi
31f24395b4 feat: move generate logic to its own crate 2024-09-27 17:04:21 -04:00
Amaan Qureshi
0c43988a5e fix(lib): correct descendant-for-range behavior with zero-width tokens 2024-09-27 00:37:13 -04:00
Amaan Qureshi
0a85744eba fix(lib): peek at the next sibling when iterating to find the child that contains a given descendant
This issue shows up when we have a zero-width token that is the target
descendant node, previously the previous sibling would be returned as
the child that contains the descendant, which is incorrect.
2024-09-17 04:37:43 +02:00
Amaan Qureshi
7e3f572655 feat: add field_name_for_named_child 2024-09-09 11:05:29 -04:00
Amaan Qureshi
e553578696 feat: add fuzz subcommand 2024-05-30 23:00:45 -04:00
Amaan Qureshi
61d0395543 fix(lib): do not return field names for extras 2024-04-30 19:23:11 -04:00
Amaan Qureshi
627617edb4 refactor(tests): migrate remaining grammar.json tests to grammar.js 2024-04-29 00:01:35 -04:00
vanaigr
90e0e28b95
feat: reverse iteration through node parents (#3214) 2024-04-23 15:19:57 +01:00
Amaan Qureshi
5825e24d56 style: wrap comments 2024-04-11 22:35:43 -04:00
Amaan Qureshi
b35efa8f33 style: format imports 2024-04-11 22:35:43 -04:00
Amaan Qureshi
62cd13a3de test: add regression test for node parent + string bug 2024-03-20 19:23:08 -04:00
dundargoc
c8bd6705cf
chore: clippy 2024-02-06 23:34:14 -05:00
Max Brunsfeld
da16cb1459 Introduce language ref-count management C APIs, remove Copy impl for Language in Rust 2023-12-27 14:59:16 -08:00
Andrew Hlynskyi
a5a7564818 chore(rust): add error reporting for position funcs 2023-10-05 17:24:01 +03:00
Max Brunsfeld
8310fd423e Update node unit test to reflect C grammar change 2023-07-18 17:58:19 -07:00
Amaan Qureshi
76f5f81aee
chore: update test 2023-07-18 19:29:40 -04:00
Max Brunsfeld
3375527a89 Fix bug in ts_tree_cursor_goto_descendant 2023-06-12 14:45:30 -07:00
Max Brunsfeld
9dd725b4e3 Start work on exposing APIs for node descendant counts and indices 2023-06-09 08:51:47 -07:00
Max Brunsfeld
477b667753 Add ts_tree_root_node_with_offset API 2022-08-18 13:48:47 -07:00
Niranjan Hasabnis
c0e2b43d34 Fixing Rust formatting issue 2021-05-21 15:43:10 +00:00
Niranjan Hasabnis
c31acb8fec Changing API name; Adding unit test and Rust bindings 2021-05-21 01:50:10 +00:00
Max Brunsfeld
73e252e39b Add unit test for child_by_field_name w/ hidden nodes 2021-02-10 16:14:24 -08:00
Max Brunsfeld
b267f90e64 Update unit tests to reflect python and ruby grammar changes 2020-11-16 10:51:08 -08:00
Max Brunsfeld
35f82ce301 Fix incorrect parent values after call to child_by_field_name
Refs tree-sitter/node-tree-sitter#61
Refs tree-sitter/tree-sitter-javascript#127
2020-04-03 11:21:51 -07:00
Max Brunsfeld
d426f46087 Add unit test for symbols respecting simple aliases 2019-12-06 12:47:27 -08:00
Max Brunsfeld
1909ae2cee binding_rust: Improve node children APIs
Closes #480
2019-11-08 14:20:10 -08:00
Max Brunsfeld
0955c5b3d7 Handle named nodes aliased as anonymous nodes
Fixes #401
2019-08-29 14:28:44 -07:00
Max Brunsfeld
ea515b6967 Fix ts_node_string behavior for anonymous leaf nodes
Refs tree-sitter/py-tree-sitter#8
2019-07-18 12:39:15 -07:00
Max Brunsfeld
28011b1e60 Add ts_node_is_extra API 2019-06-19 15:58:29 -07:00
Max Brunsfeld
80b785daee Improve behavior of node descendant queries with single positions 2019-06-13 10:53:59 -07:00
Max Brunsfeld
58e1a0fee7 In node range queries, treat the end coordinate as exclusive 2019-04-26 13:36:28 -07:00
Max Brunsfeld
701d63dab7 Add --edit flag to parse command 2019-04-08 09:21:03 -07:00
Max Brunsfeld
9f608435ee Fix errors in when languages have no fields 2019-02-12 17:20:12 -08:00
Max Brunsfeld
a7206b1b8b Add some assertions to node field test 2019-02-08 16:25:27 -08:00
Max Brunsfeld
1d1674811c Fully implement ts_node_child_by_field_id 2019-02-08 15:16:56 -08:00
Max Brunsfeld
18a13b457d Get basic field API working 2019-02-08 15:16:56 -08:00
Max Brunsfeld
50281637d7 binding: Make parse methods more convenient
* Rename parse_str to parse and make it polymorphic.
* Rename parse_utf8 to parse_with, since it is now the callback-based
  version of parse
* Add a parse_utf16 method analogous to parse
* Rename existing parse_utf16 method to parse_utf16_with

This brings in the changes from tree-sitter/rust-tree-sitter#5
2019-02-05 10:59:33 -08:00
Max Brunsfeld
efe79889be Port node tests 2019-02-04 20:42:56 -08:00