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

Improve table stringifier when line breaks enabled #488

Merged
merged 4 commits into from
Jun 14, 2022

Conversation

JohnnyMorganz
Copy link
Contributor

Improves Luau::toString() on tables when useLineBreaks and indent is enabled, by adding linebreaks after the first brace, and before the last brace.

Do note the increase in vertical lines in the large example below - I think it improves readability, but not sure if the increase is too big. (In VSCode the hover is scrollable so isn't really an issue, but I know the hover display is a bit primitive in Studio, so not sure what the impact will be)

Before:
After:

@andyfriesen
Copy link
Collaborator

Hello! Thanks for the patch!

Could you add a feature flag for this change? CONTRIBUTING.md has a quick outline of how to do this.

@JohnnyMorganz
Copy link
Contributor Author

Could you add a feature flag for this change? CONTRIBUTING.md has a quick outline of how to do this.

Done! Apologies for the delay. Please let me know if this isn't the right way to add the FFlags.

Copy link
Collaborator

@andyfriesen andyfriesen left a comment

Choose a reason for hiding this comment

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

Looks good!

Thanks!

@andyfriesen andyfriesen merged commit c30ab06 into luau-lang:master Jun 14, 2022
@JohnnyMorganz JohnnyMorganz deleted the to-string-tables branch June 18, 2022 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants