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

Allow short for loops in macros #12168

Open
Tracked by #13002
sanks02 opened this issue Jun 29, 2022 · 0 comments
Open
Tracked by #13002

Allow short for loops in macros #12168

sanks02 opened this issue Jun 29, 2022 · 0 comments

Comments

@sanks02
Copy link
Contributor

sanks02 commented Jun 29, 2022

At the moment, crystal tool format aligns multi-line code to the level of in:

{% for item in [
                 Something,
               ] %}
  {{p(item)}}
{% end %}

It becomes lengthy very quickly:

{% for array in [
                  [Something, "something", "@SOMETHING"],
                  [SomethingElse, "something_else", "@SOMETHING_ELSE"],
                  [SomethingElseElse, "something_else_else", "@SOMETHING_ELSE_ELSE"],
                ] %}
  {{p(array)}}
{% end %}

I would like to have a shorter version:

{% for array in [
  [Something, "something", "@SOMETHING"],
  [SomethingElse, "something_else", "@SOMETHING_ELSE"],
  [SomethingElseElse, "something_else_else", "@SOMETHING_ELSE_ELSE"],
] %}
  {{p(array)}}
{% end %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants