Commit Graph

12 Commits

Author SHA1 Message Date
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Ben Langmuir
3fbaa1af6d [CodeCompletion] Disallow type variables in result of typeCheckUnresolvedExpr
Fixes a use-after-free when doing code-completion where the expected
type is an array of generic type (or any bound generic type).

takeArray<T>(x: [T]) {}
takeArray(foo.<here>)

rdar://problem/24521470
2016-02-09 11:10:10 -08:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Dmitri Gribenko
73ce9ae7e9 Collection.count => .length
And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
2015-12-17 15:55:29 -08:00
Dmitri Gribenko
b7f3d54f4d removeAll(keepCapacity:) => removeAll(keepingCapacity:) 2015-12-09 17:18:08 -08:00
Ben Langmuir
83cfbae905 [CodeCompletion] Add labels for first argument when not showing patterns
When not completing a full call pattern for the first argument, such as
here:
  foo(<here>, arg2: blah)

we now show the argument label if appropriate.

For rdar://problem/22804670

Swift SVN r32774
2015-10-20 16:28:45 +00:00
Ben Langmuir
a03da9e792 [CodeCompletion] Show expected nominal types from other modules
Since other module results are cache, manually add the type names of
expected nominal types in call arguments so that we can get the type
relationship correct

For rdar://problem/22271094

Swift SVN r31959
2015-09-15 17:36:22 +00:00
Xi Ge
8d67a4ad12 [CodeComplete] Propagate type relation descriptor to the first argument, or the only argument, of call exprs.
rdar://22688827

Swift SVN r31928
2015-09-14 19:43:36 +00:00
Xi Ge
7b90c4f9e8 [test] Add several tests suggested by Argyrios.
Swift SVN r31855
2015-09-10 17:46:24 +00:00
Xi Ge
65ce0a36b8 [CodeComplete] Add type relation descriptor to member access syntax. rdar://22629291
By analyzing the context of a member access expression, we can prioritize the member
completion results by the expected type. As the initial step, we support call arguments
as context.

Swift SVN r31837
2015-09-10 00:28:14 +00:00
Xi Ge
afb46aa8e0 [CodeComplete] When completing call args, not consider those overloads that are unlikely to be selected.
rdar://22528276

Swift SVN r31613
2015-09-01 22:54:19 +00:00
Xi Ge
ef3b45871b [CodeComplete] Complete arguments of call expressions.
When users invoke code completion at an argument position, we suggest argument names,
if required however not specified, or a list of argument values. These values are annotated
with their type relation to the expected argument types, so that
Xcode can prioritize those values that apply over those that do not.
This also fixes: rdar://21727063

Swift SVN r31505
2015-08-26 22:01:25 +00:00