Skip to content
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

Refactor hierarchy printers #10791

Merged

Conversation

HertzDevil
Copy link
Contributor

Tidies up the code for the hierarchy printers a bit, in preparation for #3457.

The main result is that the hierarchy printers now accept any IO instance, which makes it much easier to write specs for them (in fact there were none before). Those specs are obviously incomplete, so further contributions are welcome.

The text and JSON printers are now subclasses of HierarchyPrinter. Some of the common printing logic is not moved into this new abstract base class yet, namely the part about nesting subclasses when printing a type, since nesting implies namespacing instead for #3457.

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @HertzDevil 🙏

@straight-shoota straight-shoota added this to the 1.2.0 milestone Jul 23, 2021
@straight-shoota straight-shoota merged commit 78b6cfb into crystal-lang:master Jul 24, 2021
@HertzDevil HertzDevil deleted the refactor/hierarchy-printers branch July 24, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants