Can I use treesitter to intercept parse errors to correct the error? #3285
Unanswered
kendalldita
asked this question in
Q&A
Replies: 1 comment
-
This is certainly something you could build on top of tree-sitter! You could parse a document with tree-sitter, use the query api on the resulting tree to find error nodes (and their corresponding position within the document), and then (via your own implementation, as tree-sitter doesn't support that specific functionality) insert the corresponding default values based on the node's parents, siblings, or some other context. |
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
-
I have not yet tried setting up treesitter. I have documents which conform to a grammar, I want to parse the documents, assume that parse errors are only because of missing elements (this will be true). Then supply default versions of what is missing.
Is that something there is support for, with treesitter?
Beta Was this translation helpful? Give feedback.
All reactions