mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sourcekitd-test] Make expand-placeholder iterative
Instead of getting all edits up front using the same source code, apply each replacement before calculating the next. Placeholder expansion is sensitive the surrounding code, so expanding multiple closures separately can give different results from doing so in order. To allow testing that, add a magic placeholder identifier __skip__ to skip expansion during testing. This is also required for handling multiple trailing closures.
This commit is contained in:
committed by
John McCall
parent
78b7bce3a0
commit
feaaf39206
@@ -67,24 +67,41 @@ func f1() {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }
|
||||
|
||||
// FIXME: whether we get a trailing closure or not depends on the order we
|
||||
// expand the placeholders.
|
||||
func f1() {
|
||||
bar(<#T##__skip__: () -> ()##() -> ()#>, <#T##d: () -> ()##() -> ()#>)
|
||||
}
|
||||
// CHECK: bar(<#T##__skip__: () -> ()##() -> ()#>, {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: })
|
||||
|
||||
func f1() {
|
||||
bar(<#T##d: () -> ()##() -> ()#>, <#T##d: () -> ()##() -> ()#>)
|
||||
}
|
||||
// CHECK: bar({
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }, {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: })
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }) {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }
|
||||
|
||||
// FIXME: whether we get a trailing closure or not depends on the order we
|
||||
// expand the placeholders.
|
||||
func f1() {
|
||||
bar(a : <#T##__skip__: () -> ()##() -> ()#>, b : <#T##d: () -> ()##() -> ()#>)
|
||||
}
|
||||
// CHECK: bar(a : <#T##__skip__: () -> ()##() -> ()#>, b : {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: })
|
||||
|
||||
func f1() {
|
||||
bar(a : <#T##d: () -> ()##() -> ()#>, b : <#T##d: () -> ()##() -> ()#>)
|
||||
}
|
||||
// CHECK: bar(a : {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }, b : {
|
||||
// CHECK-NEXT: }) {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: })
|
||||
// CHECK-NEXT: }
|
||||
|
||||
|
||||
func f1() {
|
||||
|
||||
Reference in New Issue
Block a user