Skip to content

Commit 1139f60

Browse files
committed
Replace deprecated code
1 parent d1c7701 commit 1139f60

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
17511751
before(node.firstToken(viewMode: .sourceAccurate), tokens: .printerControl(kind: .disableBreaking(allowDiscretionary: false)))
17521752

17531753
arrangeAttributeList(node.attributes)
1754-
after(node.importTok, tokens: .space)
1754+
after(node.importKeyword, tokens: .space)
17551755
after(node.importKind, tokens: .space)
17561756

17571757
after(node.lastToken(viewMode: .sourceAccurate), tokens: .printerControl(kind: .enableBreaking))

Sources/SwiftFormatRules/ReturnVoidInsteadOfEmptyTuple.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public final class ReturnVoidInsteadOfEmptyTuple: SyntaxFormatRule {
3939
return super.visit(node)
4040
}
4141

42-
// Make sure that function types nested in the argument list are also rewritten (for example,
42+
// Make sure that function types nested in the parameter list are also rewritten (for example,
4343
// `(Int -> ()) -> ()` should become `(Int -> Void) -> Void`).
44-
let arguments = visit(node.arguments)
44+
let parameters = visit(node.parameters)
4545
let voidKeyword = makeVoidIdentifierType(toReplace: returnType)
4646
var rewrittenNode = node
47-
rewrittenNode.arguments = arguments
47+
rewrittenNode.parameters = parameters
4848
rewrittenNode.output.returnType = TypeSyntax(voidKeyword)
4949
return TypeSyntax(rewrittenNode)
5050
}

Sources/SwiftFormatRules/UseShorthandTypeNames.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ public final class UseShorthandTypeNames: SyntaxFormatRule {
417417
case .functionType(let functionType):
418418
let result = makeFunctionTypeExpression(
419419
leftParen: functionType.leftParen,
420-
argumentTypes: functionType.arguments,
420+
parameters: functionType.parameters,
421421
rightParen: functionType.rightParen,
422422
effectSpecifiers: functionType.effectSpecifiers,
423423
arrow: functionType.output.arrow,
@@ -458,22 +458,22 @@ public final class UseShorthandTypeNames: SyntaxFormatRule {
458458

459459
private func makeFunctionTypeExpression(
460460
leftParen: TokenSyntax,
461-
argumentTypes: TupleTypeElementListSyntax,
461+
parameters: TupleTypeElementListSyntax,
462462
rightParen: TokenSyntax,
463463
effectSpecifiers: TypeEffectSpecifiersSyntax?,
464464
arrow: TokenSyntax,
465465
returnType: TypeSyntax
466466
) -> SequenceExprSyntax? {
467467
guard
468-
let argumentTypeExprs = expressionRepresentation(of: argumentTypes),
468+
let parameterExprs = expressionRepresentation(of: parameters),
469469
let returnTypeExpr = expressionRepresentation(of: returnType)
470470
else {
471471
return nil
472472
}
473473

474474
let tupleExpr = TupleExprSyntax(
475475
leftParen: leftParen,
476-
elements: argumentTypeExprs,
476+
elements: parameterExprs,
477477
rightParen: rightParen)
478478
let arrowExpr = ArrowExprSyntax(
479479
effectSpecifiers: effectSpecifiers,

0 commit comments

Comments
 (0)