| ... | ... | @@ -1933,12 +1933,15 @@ fn renderContainerDecl( |
| 1933 | 1933 | break :one_line; |
| 1934 | 1934 | } |
| 1935 | 1935 | |
| 1936 | | // 2. A member of the container has a doc comment. |
| 1936 | // 2. The container has a container comment. |
| 1937 | if (token_tags[lbrace + 1] == .container_doc_comment) break :one_line; |
| 1938 | |
| 1939 | // 3. A member of the container has a doc comment. |
| 1937 | 1940 | for (token_tags[lbrace + 1 .. rbrace - 1]) |tag| { |
| 1938 | 1941 | if (tag == .doc_comment) break :one_line; |
| 1939 | 1942 | } |
| 1940 | 1943 | |
| 1941 | | // 3. The container has non-field members. |
| 1944 | // 4. The container has non-field members. |
| 1942 | 1945 | for (container_decl.ast.members) |member| { |
| 1943 | 1946 | if (!node_tags[member].isContainerField()) break :one_line; |
| 1944 | 1947 | } |
| ... | ... | @@ -2358,7 +2361,7 @@ fn renderSpace(ais: *Ais, tree: Ast, token_index: Ast.TokenIndex, lexeme_len: us |
| 2358 | 2361 | } |
| 2359 | 2362 | } |
| 2360 | 2363 | |
| 2361 | | /// Returns true if there exists a comment between any of the tokens from |
| 2364 | /// Returns true if there exists a line comment between any of the tokens from |
| 2362 | 2365 | /// `start_token` to `end_token`. This is used to determine if e.g. a |
| 2363 | 2366 | /// fn_proto should be wrapped and have a trailing comma inserted even if |
| 2364 | 2367 | /// there is none in the source. |