-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
Added Tree.__rich__() method to make Tree a Rich renderable #1117
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1117 +/- ##
==========================================
- Coverage 89.44% 89.32% -0.12%
==========================================
Files 52 52
Lines 7373 7385 +12
==========================================
+ Hits 6595 6597 +2
- Misses 778 788 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK rich, so I can't offer suggestions/feedback for that.
Maybe an extra mode extra install in the form lark[rich]
similar to how regex
is handle? Although I am not sure how useful this would be.
Also, based on this code, rich might be a good basis for an extended version of this showcasing how to use the Interpreter
class to do top down visiting, but I am not sure about that.
Are we testing Tree.pretty
? If yes, we should try to create similar tests for Tree.rich
as well IMO. Maybe just making sure that all children are visited?
I think that because it's just a utility function, and not something that will be used in production code, we don't have to be too judicious about it. Also we don't have tests for pretty() afaik. I don't know if the extra install is worth it. Maybe if we added more rich methods to other objects, like Token and InteractiveParser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update the docs file
Thanks! |
No description provided.