diff --git a/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift b/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift index f97497262..f2a3fcfc2 100644 --- a/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift +++ b/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift @@ -1751,7 +1751,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor { before(node.firstToken(viewMode: .sourceAccurate), tokens: .printerControl(kind: .disableBreaking(allowDiscretionary: false))) arrangeAttributeList(node.attributes) - after(node.importTok, tokens: .space) + after(node.importKeyword, tokens: .space) after(node.importKind, tokens: .space) after(node.lastToken(viewMode: .sourceAccurate), tokens: .printerControl(kind: .enableBreaking)) diff --git a/Sources/SwiftFormatRules/ReturnVoidInsteadOfEmptyTuple.swift b/Sources/SwiftFormatRules/ReturnVoidInsteadOfEmptyTuple.swift index baa0a8223..74d47d2bb 100644 --- a/Sources/SwiftFormatRules/ReturnVoidInsteadOfEmptyTuple.swift +++ b/Sources/SwiftFormatRules/ReturnVoidInsteadOfEmptyTuple.swift @@ -39,12 +39,12 @@ public final class ReturnVoidInsteadOfEmptyTuple: SyntaxFormatRule { return super.visit(node) } - // Make sure that function types nested in the argument list are also rewritten (for example, + // Make sure that function types nested in the parameter list are also rewritten (for example, // `(Int -> ()) -> ()` should become `(Int -> Void) -> Void`). - let arguments = visit(node.arguments) + let parameters = visit(node.parameters) let voidKeyword = makeVoidIdentifierType(toReplace: returnType) var rewrittenNode = node - rewrittenNode.arguments = arguments + rewrittenNode.parameters = parameters rewrittenNode.output.returnType = TypeSyntax(voidKeyword) return TypeSyntax(rewrittenNode) } diff --git a/Sources/SwiftFormatRules/UseShorthandTypeNames.swift b/Sources/SwiftFormatRules/UseShorthandTypeNames.swift index 95fc0c343..9b6535173 100644 --- a/Sources/SwiftFormatRules/UseShorthandTypeNames.swift +++ b/Sources/SwiftFormatRules/UseShorthandTypeNames.swift @@ -417,7 +417,7 @@ public final class UseShorthandTypeNames: SyntaxFormatRule { case .functionType(let functionType): let result = makeFunctionTypeExpression( leftParen: functionType.leftParen, - argumentTypes: functionType.arguments, + parameters: functionType.parameters, rightParen: functionType.rightParen, effectSpecifiers: functionType.effectSpecifiers, arrow: functionType.output.arrow, @@ -458,14 +458,14 @@ public final class UseShorthandTypeNames: SyntaxFormatRule { private func makeFunctionTypeExpression( leftParen: TokenSyntax, - argumentTypes: TupleTypeElementListSyntax, + parameters: TupleTypeElementListSyntax, rightParen: TokenSyntax, effectSpecifiers: TypeEffectSpecifiersSyntax?, arrow: TokenSyntax, returnType: TypeSyntax ) -> SequenceExprSyntax? { guard - let argumentTypeExprs = expressionRepresentation(of: argumentTypes), + let parameterExprs = expressionRepresentation(of: parameters), let returnTypeExpr = expressionRepresentation(of: returnType) else { return nil @@ -473,7 +473,7 @@ public final class UseShorthandTypeNames: SyntaxFormatRule { let tupleExpr = TupleExprSyntax( leftParen: leftParen, - elements: argumentTypeExprs, + elements: parameterExprs, rightParen: rightParen) let arrowExpr = ArrowExprSyntax( effectSpecifiers: effectSpecifiers,