[Sema] Maintain the implicitness of call argument tuple/parens in coerceCallArguments

If any arguments were defaulted the tuple/paren was made implicit, even though
the original tuple/paren was present in the source.

This prevented some sourcekit ASTWalkers from considering them, making
refactorings, documentation info, jump-to-definition and other features
unavailable when queried via their argument labels.

Resolves rdar://problem/62118957
This commit is contained in:
Nathan Hawes
2020-04-21 11:47:12 -07:00
parent 82d73b531b
commit 7c0a17803d
5 changed files with 36 additions and 20 deletions

View File

@@ -106,6 +106,13 @@ struct TestDefaultedParen {
TestDefaultedParen.init()
struct HasInitWithDefaultArgs {
init(x: Int = 10, y: Int = 20, z: Int = 10)
}
HasInitWithDefaultArgs(z: 45)
HasInitWithDefaultArgs(y: 45, z: 89)
// RUN: %sourcekitd-test -req=cursor -pos=3:1 -end-pos=5:13 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK1
// CHECK1: ACTIONS BEGIN
@@ -139,6 +146,11 @@ TestDefaultedParen.init()
// RUN: %sourcekitd-test -req=cursor -pos=107:20 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-NORENAME
// RUN: %sourcekitd-test -req=cursor -pos=113:24 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-GLOBAL
// RUN: %sourcekitd-test -req=cursor -pos=114:24 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-GLOBAL
// RUN: %sourcekitd-test -req=cursor -pos=114:31 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-GLOBAL
// RUN: %sourcekitd-test -req=cursor -pos=114:31 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-GLOBAL
// RUN: %sourcekitd-test -req=cursor -pos=35:10 -end-pos=35:16 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-RENAME-EXTRACT
// RUN: %sourcekitd-test -req=cursor -pos=35:10 -end-pos=35:16 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK-RENAME-EXTRACT