Replies: 1 comment
-
There's no easy way to simulate incremental parsing via the test format, but you can easily do so yourself if you're familiar with nodejs or rust in your grammar repo. You can also "fuzz" edits, take a look here to see how we test that for every upstream language: tree-sitter/cli/src/tests/corpus_test.rs Line 210 in 7147c72 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible, in a test, to simulate incremental parsing with character insertion?
I develop and maintain a Tree-sitter grammar https://github.com/uben0/tree-sitter-typst and the issue uben0/tree-sitter-typst#23 only appears in incremental parsing. It's very hard to understand what's going on without the this testing feature.
If this feature doesn't exist, is there a work around or a technique? More in general what are the debug tool provided by Tree-sitter?
At the moment, I use
tree-sitter test
with-d
or-D
, andtree-sitter parse
to see nodes' ranges. By the way, is there a way to specify nodes' ranges in the expected tree?Beta Was this translation helpful? Give feedback.
All reactions