Commit Graph

8 Commits

Author SHA1 Message Date
Alexander Cyon
a80b8ae06f [test/IDE] Fix typos 2024-08-08 19:35:00 +02:00
Alex Hoppen
9b31e9a69f Merge pull request #68595 from ahoppen/ahoppen/batch-completion
[tests] Add a `%batch-code-completion` lit substitution
2023-09-20 17:26:09 -07:00
Alex Hoppen
ebcdb6d008 [CodeCompletion] Suggest init as accessor
rdar://115500788
2023-09-18 17:35:54 -07:00
Alex Hoppen
a5a17aa955 [tests] Add a %batch-code-completion lit substitution
I could never remember the command to run batch code completion tests. Add a lit substitution for it.
2023-09-18 13:57:49 -07:00
Alex Hoppen
5d01a097e1 [CodeCompletion] Don't distinguish convertible and idenical type relation
I think that preferring identical over convertible makes sense in e.g. C++ where we have implicit user-defined type conversions but since we don’t have them in Swift, I think the distinction doesn’t make too much sense, because if we have a `func foo(x: Int?)`, want don’t really want to  prioritize variables of type `Int?` over `Int` Similarly if we have `func foo(x: View)`, we don’t want to prioritize a variable of type `View` over e.g. `Text`.

rdar://91349364
2022-04-13 08:28:17 +02:00
Rintaro Ishizaki
6e84c01a48 [CodeCompletion] Migrate some tests to batch completion test 2021-04-01 22:18:49 -07:00
Ben Langmuir
e255bac6be [code-completion] Fix type context for single-expression implicit getter
This adds an implicit body so that we can dig out the return type
context the same way as a normal function. For now, we are also treating
the first expression in a multi-statement implicit getter body the same
way; we'll need to refactor how we complete in accessors to
differentiate those cases.
2019-03-26 16:45:32 -07:00
Rintaro Ishizaki
90fe0a7e86 [CodeCompletion] Implement completion for 'get', 'set', 'willSet', 'didSet'
Implement 'get', 'set', 'willSet', 'didSet' completion at the beginning
of accessor position.

  var value: Ty {
    <HERE> // 'get', 'set', 'willSet' and 'didSet' along with normal
           // completion.
  }

  var value: Ty {
    get { return ... }
    <HERE> // 'get', 'set', 'willSet' and 'didSet' only.
  }

rdar://problem/20957182
2018-10-19 14:28:56 +09:00