We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dca8bec commit c7d8018Copy full SHA for c7d8018
Sources/SwiftFormat/Core/SyntaxProtocol+Convenience.swift
@@ -154,10 +154,7 @@ extension SyntaxProtocol {
154
var hasTestAncestor: Bool {
155
var parent = self.parent
156
while let existingParent = parent {
157
- if let functionDecl = existingParent.as(FunctionDeclSyntax.self),
158
- functionDecl.attributes.contains(where: {
159
- $0.as(AttributeSyntax.self)?.attributeName.as(IdentifierTypeSyntax.self)?.name.text == "Test"
160
- }) {
+ if let functionDecl = existingParent.as(FunctionDeclSyntax.self), functionDecl.hasAttribute("Test") {
161
return true
162
}
163
parent = existingParent.parent
0 commit comments