Commit 7d5d41e
authored
This pull request adds support for formatting `case/in` statements.
Previously it would only format the `case` line and omit all `in` nodes.
Now an input like:
```erb
<% case { hash: { nested: '4' } } %>
<% in { hash: { nested: } } %>
<span>there</span>
<% in { another: } %>
<span>there</span>
<% in { yet_another: { nested: } } %>
<span>hi</span>
<% else %>
<span>there</span>
<% end %>
```
Will now format as:
```erb
<% case { hash: { nested: '4' } } %>
<% in { hash: { nested: } } %>
<span>there</span>
<% in { another: } %>
<span>there</span>
<% in { yet_another: { nested: } } %>
<span>hi</span>
<% else %>
<span>there</span>
<% end %>
```
1 parent 99a86f5 commit 7d5d41e
File tree
2 files changed
+59
-0
lines changed- javascript/packages/formatter
- src
- test/erb
2 files changed
+59
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
895 | 896 | | |
896 | 897 | | |
897 | 898 | | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
898 | 903 | | |
899 | 904 | | |
900 | 905 | | |
901 | 906 | | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
902 | 912 | | |
903 | 913 | | |
904 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
54 | 103 | | |
0 commit comments