| ... | @@ -1879,23 +1879,23 @@ fn renderCall( | ... | @@ -1879,23 +1879,23 @@ fn renderCall( |
| 1879 | const after_last_param_tok = tree.lastToken(last_param) + 1; | 1879 | const after_last_param_tok = tree.lastToken(last_param) + 1; |
| 1880 | if (token_tags[after_last_param_tok] == .comma) { | 1880 | if (token_tags[after_last_param_tok] == .comma) { |
| 1881 | ais.pushIndentNextLine(); | 1881 | ais.pushIndentNextLine(); |
| 1882 | try renderToken(ais, tree, lparen, Space.newline); // ( | 1882 | try renderToken(ais, tree, lparen, .newline); // ( |
| 1883 | for (params) |param_node, i| { | 1883 | for (params) |param_node, i| { |
| 1884 | if (i + 1 < params.len) { | 1884 | if (i + 1 < params.len) { |
| 1885 | try renderExpression(ais, tree, param_node, Space.none); | 1885 | try renderExpression(ais, tree, param_node, .none); |
| 1886 | | 1886 | |
| 1887 | // Unindent the comma for multiline string literals | 1887 | // Unindent the comma for multiline string literals. |
| 1888 | const is_multiline_string = node_tags[param_node] == .multiline_string_literal; | 1888 | const is_multiline_string = node_tags[param_node] == .multiline_string_literal; |
| 1889 | if (is_multiline_string) ais.popIndent(); | 1889 | if (is_multiline_string) ais.popIndent(); |
| 1890 | | 1890 | |
| 1891 | const comma = tree.lastToken(param_node) + 1; | 1891 | const comma = tree.lastToken(param_node) + 1; |
| 1892 | try renderToken(ais, tree, comma, Space.newline); // , | 1892 | try renderToken(ais, tree, comma, .newline); // , |
| 1893 | | 1893 | |
| 1894 | if (is_multiline_string) ais.pushIndent(); | 1894 | if (is_multiline_string) ais.pushIndent(); |
| 1895 | | 1895 | |
| 1896 | try renderExtraNewline(ais, tree, params[i + 1]); | 1896 | try renderExtraNewline(ais, tree, params[i + 1]); |
| 1897 | } else { | 1897 | } else { |
| 1898 | try renderExpression(ais, tree, param_node, Space.comma); | 1898 | try renderExpression(ais, tree, param_node, .comma); |
| 1899 | } | 1899 | } |
| 1900 | } | 1900 | } |
| 1901 | ais.popIndent(); | 1901 | ais.popIndent(); |
| ... | @@ -1903,14 +1903,23 @@ fn renderCall( | ... | @@ -1903,14 +1903,23 @@ fn renderCall( |
| 1903 | } | 1903 | } |
| 1904 | | 1904 | |
| 1905 | ais.pushIndentNextLine(); | 1905 | ais.pushIndentNextLine(); |
| 1906 | try renderToken(ais, tree, lparen, Space.none); // ( | 1906 | try renderToken(ais, tree, lparen, .none); // ( |
| 1907 | | 1907 | |
| 1908 | for (params) |param_node, i| { | 1908 | for (params) |param_node, i| { |
| 1909 | try renderExpression(ais, tree, param_node, Space.none); | 1909 | try renderExpression(ais, tree, param_node, .none); |
| 1910 | | 1910 | |
| 1911 | if (i + 1 < params.len) { | 1911 | if (i + 1 < params.len) { |
| 1912 | const comma = tree.lastToken(param_node) + 1; | 1912 | const comma = tree.lastToken(param_node) + 1; |
| 1913 | try renderToken(ais, tree, comma, Space.space); | 1913 | const this_multiline_string = node_tags[param_node] == .multiline_string_literal; |
| | 1914 | const next_multiline_string = node_tags[params[i + 1]] == .multiline_string_literal; |
| | 1915 | const comma_space: Space = if (next_multiline_string) .none else .space; |
| | 1916 | if (this_multiline_string) { |
| | 1917 | ais.popIndent(); |
| | 1918 | try renderToken(ais, tree, comma, comma_space); |
| | 1919 | ais.pushIndent(); |
| | 1920 | } else { |
| | 1921 | try renderToken(ais, tree, comma, comma_space); |
| | 1922 | } |
| 1914 | } | 1923 | } |
| 1915 | } | 1924 | } |
| 1916 | | 1925 | |