-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust api: recursivly print tree via Debug trait if alternate flag is set #3367
Comments
Debug printing a node does recursively print the S-exp. |
do you mean printing with Display? i didn't check that, but it seems unintuitive that using Debug would give less info than Display. |
Oh yeah, it's Display. What would recursively printing a node in the Debug format look like? tree-sitter/lib/binding_rust/lib.rs Lines 1484 to 1487 in 6368017
|
hmm.. i feel like i would want to use newlines and indentation to align things honestly... also it should print field names ideally. |
Well, you can submit a PR if you want. Maybe make it tree-like. |
what about also making the alternate form of Display print in an indented way? |
Already done. |
Problem
the Debug trait only shows the root node of a tree, which is frequently unhelpful.
Expected behavior
when printing
Tree
orNode
with{:#?}
, the implementation of Debug would recurse into child nodes and print the full AST. this would allow easier debugging.The text was updated successfully, but these errors were encountered: