@@ -1229,6 +1229,9 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
1229
1229
}
1230
1230
1231
1231
override func visit( _ node: ObjectLiteralExprSyntax ) -> SyntaxVisitorContinueKind {
1232
+ // TODO: Remove this; it has been subsumed by `MacroExpansionDeclSyntax`. But that feature is
1233
+ // still in flux and this node type is still present in the API, even though nothing in the
1234
+ // parser currently creates it.
1232
1235
arrangeFunctionCallArgumentList (
1233
1236
node. arguments,
1234
1237
leftDelimiter: node. leftParen,
@@ -1237,6 +1240,15 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
1237
1240
return . visitChildren
1238
1241
}
1239
1242
1243
+ override func visit( _ node: MacroExpansionDeclSyntax ) -> SyntaxVisitorContinueKind {
1244
+ arrangeFunctionCallArgumentList (
1245
+ node. argumentList,
1246
+ leftDelimiter: node. leftParen,
1247
+ rightDelimiter: node. rightParen,
1248
+ forcesBreakBeforeRightDelimiter: false )
1249
+ return . visitChildren
1250
+ }
1251
+
1240
1252
override func visit( _ node: ParameterClauseSyntax ) -> SyntaxVisitorContinueKind {
1241
1253
// Prioritize keeping ") throws -> <return_type>" together. We can only do this if the function
1242
1254
// has arguments.
@@ -1307,7 +1319,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
1307
1319
// Unlike other code blocks, where we may want a single statement to be laid out on the same
1308
1320
// line as a parent construct, the content of an `#if` block must always be on its own line;
1309
1321
// the newline token inserted at the end enforces this.
1310
- if let lastElemTok = node. elements. lastToken {
1322
+ if let lastElemTok = node. elements? . lastToken {
1311
1323
after ( lastElemTok, tokens: . break( breakKindClose, newlines: . soft) , . close)
1312
1324
} else {
1313
1325
before ( tokenToOpenWith. nextToken ( viewMode: . all) , tokens: . break( breakKindClose, newlines: . soft) , . close)
0 commit comments