File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
MacroToolkitExamplePlugin Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,11 @@ extension Sequence where Element == AttributeListElement {
6060extension 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}
Original file line number Diff line number Diff line change 1+ import MacroToolkit
12import SwiftDiagnostics
23import SwiftSyntax
34import SwiftSyntaxMacros
4- import MacroToolkit
55
66// Modified from: https://github.com/DougGregor/swift-macro-examples/blob/f61ac7cdca8dc3557e53f86e7e03df1353908d3e/MacroExamplesPlugin/AddCompletionHandlerMacro.swift
77public struct AddCompletionHandlerMacro : PeerMacro {
You can’t perform that action at this time.
0 commit comments