Skip to content

fix deprecation warnings #1781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftRefactor/CallToTrailingClosures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftRefactor/ExpandEditorPlaceholder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Expand Down Expand Up @@ -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
)
}
Expand Down