diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-03-18 23:19:01 +0000 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-03-19 14:24:59 +0000 |
commit | aca2048bcd57937ea1c7b7f0325f25d5b82588db (patch) | |
tree | 74f26cf464e6ce345cb296c07477cb38c088f613 /test/functional/api/vim_spec.lua | |
parent | 16a416cb3c17ed3a7f21d35da5d211fcad947768 (diff) | |
download | rneovim-aca2048bcd57937ea1c7b7f0325f25d5b82588db.tar.gz rneovim-aca2048bcd57937ea1c7b7f0325f25d5b82588db.tar.bz2 rneovim-aca2048bcd57937ea1c7b7f0325f25d5b82588db.zip |
refactor(treesitter): redesign query iterating
Problem:
`TSNode:_rawquery()` is complicated, has known issues and the Lua and
C code is awkwardly coupled (see logic with `active`).
Solution:
- Add `TSQueryCursor` and `TSQueryMatch` bindings.
- Replace `TSNode:_rawquery()` with `TSQueryCursor:next_capture()` and `TSQueryCursor:next_match()`
- Do more stuff in Lua
- API for `Query:iter_captures()` and `Query:iter_matches()` remains the same.
- `treesitter.c` no longer contains any logic related to predicates.
- Add `match_limit` option to `iter_matches()`. Default is still 256.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
0 files changed, 0 insertions, 0 deletions