Skip to content

Commit 5411c55

Browse files
committed
Fix tests (latest SwiftSyntax updated equality implementation of attribute syntax to be more useless)
1 parent 443e437 commit 5411c55

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sources/MacroToolkit/AttributeListElement.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ extension Sequence where Element == AttributeListElement {
6060
extension Collection where Element == AttributeListElement {
6161
/// Removes any attributes matching the specified attribute, and returns the result.
6262
public func removing(_ attribute: AttributeSyntax) -> [AttributeListElement] {
63+
// TODO: Ensure that this only removes the attribute currently being evaluated and
64+
// not other ones (in case repeated macros are allowed as things such as markers).
6365
filter { element in
64-
element.attribute?._syntax != attribute
66+
(element.attribute?._syntax.attributeName).map(Type.init)?.normalizedDescription
67+
!= Type(attribute.attributeName).normalizedDescription
6568
}
6669
}
6770
}

Sources/MacroToolkitExamplePlugin/AddCompletionHandlerMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import MacroToolkit
12
import SwiftDiagnostics
23
import SwiftSyntax
34
import SwiftSyntaxMacros
4-
import MacroToolkit
55

66
// Modified from: https://github.com/DougGregor/swift-macro-examples/blob/f61ac7cdca8dc3557e53f86e7e03df1353908d3e/MacroExamplesPlugin/AddCompletionHandlerMacro.swift
77
public struct AddCompletionHandlerMacro: PeerMacro {

0 commit comments

Comments
 (0)