Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
u-abyss committed Sep 10, 2024
1 parent 4dd6b3f commit 337358f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ private extension CodeBlockItemSyntax {
return false
}
if let codeBlockItemListSyntax = ifExprSytax.parent?.parent?.parent?.as(CodeBlockItemListSyntax.self),
let expressionStmtSyntax = codeBlockItemListSyntax.last?.item.as(ExpressionStmtSyntax.self)
{
return parent.children(viewMode: .sourceAccurate).count == 1 && ( codeBlockItemListSyntax.count == 1 || expressionStmtSyntax.expression.is(IfExprSyntax.self)) && funcDecl.signature.allowsImplicitReturns
let expressionStmtSyntax = codeBlockItemListSyntax.last?.item.as(ExpressionStmtSyntax.self) {
return parent.children(viewMode: .sourceAccurate).count == 1 &&
( codeBlockItemListSyntax.count == 1 || expressionStmtSyntax.expression.is(IfExprSyntax.self)) &&
funcDecl.signature.allowsImplicitReturns
}
return false
}
Expand All @@ -288,7 +289,9 @@ private extension CodeBlockItemSyntax {
guard let funcDecl = switchExprSytax.parent?.parent?.parent?.parent?.parent?.as(FunctionDeclSyntax.self) else {
return false
}
return parent.children(viewMode: .sourceAccurate).count == 1 && funcDecl.signature.allowsImplicitReturns && switchExprSytax.parent?.parent?.parent?.as(CodeBlockItemListSyntax.self)?.count == 1
return parent.children(viewMode: .sourceAccurate).count == 1 &&
funcDecl.signature.allowsImplicitReturns &&
switchExprSytax.parent?.parent?.parent?.as(CodeBlockItemListSyntax.self)?.count == 1
}
}

Expand Down

0 comments on commit 337358f

Please sign in to comment.