[SourceKit] Handle CustomAttrs arguments for placeholder expansion

Introduce a new ASTWalker option for walking CustomAttrs and use it
for the placeholder scanner to ensure we can expand placeholders in
attribute arguments.
This commit is contained in:
Hamish Knight
2025-05-21 18:06:54 +01:00
parent 5823154444
commit 26517a1239
4 changed files with 76 additions and 0 deletions

View File

@@ -315,3 +315,23 @@ struct ExpandDeclMacro {
// CHECK-NEXT: <#code#>
// CHECK-NEXT: }))
}
@Foo(<#Int#>)
func testDeclAttr1() {}
// CHECK: @Foo(<#Int#>)
// CHECK-NEXT: func testDeclAttr1() {}
@Foo(<#T##() -> ()#>)
func testDeclAttr2() {}
// CHECK: @Foo({
// CHECK-NEXT: <#code#>
// CHECK-NEXT: })
// CHECK-NEXT: func testDeclAttr2() {}
func testTypeAttr1(x: @Foo(<#Int#>) String) {}
// CHECK: func testTypeAttr1(x: @Foo(<#Int#>) String) {}
func testTypeAttr2(x: @Foo(<#T##() -> ()#>) Int) {}
// CHECK: func testTypeAttr2(x: @Foo({
// CHECK-NEXT: <#code#>
// CHECK-NEXT: }) Int) {}