Skip to content

Commit 6412ec7

Browse files
committed
Add fix-it handling tests for macro examples
It introduces an enhancement to our macro expansion functionality with the addition of fix-it tests. In `AddBlockerTests`, a new test case has been added to validate the scenario where an addition operation should be a subtraction, including a diagnostic message and the application of the suggested fix-it. Similarly, `AddCompletionHandlerMacroTests` is now equipped with a test case that applies a fix-it for adding the 'async' keyword to functions that are missing it but have the `@AddCompletionHandler` attribute.
1 parent 7c1c56c commit 6412ec7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Examples/Sources/MacroExamples/Implementation/Peer/AddCompletionHandlerMacro.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public struct AddCompletionHandlerMacro: PeerMacro {
3838
} else {
3939
newEffects = FunctionEffectSpecifiersSyntax(asyncSpecifier: .keyword(.async, trailingTrivia: .space))
4040
}
41+
newEffects.asyncSpecifier?.trailingTrivia = [.spaces(1)]
4142

4243
var newSignature = funcDecl.signature
4344
newSignature.effectSpecifiers = newEffects

0 commit comments

Comments
 (0)