Skip to content

Better print format#1157

Merged
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
GlassBricks:better-print-format
Nov 16, 2021
Merged

Better print format#1157
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
GlassBricks:better-print-format

Conversation

@GlassBricks
Copy link
Copy Markdown
Contributor

This adds some improvements to improve readability of output lua:

  • Parenthesis are omitted if operator precedence allows it
  • Expressions list are always printed on 1 line if there is only 1 expression, always printed on multiple lines if there are > 4 expressions, and following old logic otherwise. This solves the following:
    • functions that take only another function don't double indent
    • a(b(c)), [a(b)] is printed on one line
    • Large object literals are printed on multiple lines (instead of one giant line)

Feel free to discuss these changes.

@Perryvw Perryvw requested a review from tomblind November 8, 2021 20:05
@Perryvw Perryvw merged commit 8a6241c into TypeScriptToLua:master Nov 16, 2021
@GlassBricks GlassBricks deleted the better-print-format branch March 16, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants