You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tree-sitter is doing a great job then reporting problems with the grammar (I'm currently mostly interested in conflicts), I really like the presentation and having possible resolutions, thanks!
But for the problem I'm trying to solve currently, it would be super handy to be able to get this information in machine-readable format (I was thinking about JSON, but doesn't really matter much). Of course, I can parse the current tree-sitter output to extract the needed information, but that seems a bit backwards: why would I parse strings that were pretty printed for me just moments ago?
So, I was thinking about adding something like --json-errors flag to the generate command. I could, of course, just do it in my fork, but I was wondering if that's something that could be also accepted upstream.
Expected behavior
tree-sitter generate --json-errors reports conflicts (and potentially other problems with the grammar) in JSON format, something like:
Problem
Tree-sitter is doing a great job then reporting problems with the grammar (I'm currently mostly interested in conflicts), I really like the presentation and having possible resolutions, thanks!
But for the problem I'm trying to solve currently, it would be super handy to be able to get this information in machine-readable format (I was thinking about JSON, but doesn't really matter much). Of course, I can parse the current tree-sitter output to extract the needed information, but that seems a bit backwards: why would I parse strings that were pretty printed for me just moments ago?
So, I was thinking about adding something like
--json-errors
flag to thegenerate
command. I could, of course, just do it in my fork, but I was wondering if that's something that could be also accepted upstream.Expected behavior
tree-sitter generate --json-errors
reports conflicts (and potentially other problems with the grammar) in JSON format, something like:The text was updated successfully, but these errors were encountered: