diff --git a/Sources/SwiftRefactor/CallToTrailingClosures.swift b/Sources/SwiftRefactor/CallToTrailingClosures.swift index 2d5cf49b51d..9729573a465 100644 --- a/Sources/SwiftRefactor/CallToTrailingClosures.swift +++ b/Sources/SwiftRefactor/CallToTrailingClosures.swift @@ -95,7 +95,7 @@ extension FunctionCallExprSyntax { ) } - var converted = self.detach() + var converted = self.detached // Remove parens if there's no non-closure arguments left and remove the // last comma otherwise. Makes sure to keep the trivia of any removed node. diff --git a/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift b/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift index 372e8edf30c..4382c68247e 100644 --- a/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift +++ b/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift @@ -169,9 +169,9 @@ extension FunctionTypeSyntax { /// ``` fileprivate var closureExpansion: ClosureExprSyntax { let closureSignature: ClosureSignatureSyntax? - if !arguments.isEmpty { + if !parameters.isEmpty { let args = ClosureParamListSyntax { - for arg in arguments { + for arg in parameters { ClosureParamSyntax(name: arg.expansionNameToken()) } } @@ -261,13 +261,13 @@ extension FunctionCallExprSyntax { var parser = Parser(edit.replacement) let expr = ExprSyntax.parse(from: &parser) expandedArgs.append( - arg.detach().with(\.expression, expr) + arg.detached.with(\.expression, expr) ) } let originalArgs = argumentList.dropLast(argsToExpand) return ( - detach().with(\.argumentList, TupleExprElementListSyntax(originalArgs + expandedArgs)), + detached.with(\.argumentList, TupleExprElementListSyntax(originalArgs + expandedArgs)), expandedArgs.count ) }