Commit Graph

14 Commits

Author SHA1 Message Date
Ben Langmuir
a2c7298af5 [CodeCompletion] Don't complete entire call patterns inside existing calls
Peek at the token following the code completion location to decide
whether or not to provide completions for entire call patterns.  When
the next token looks like it's part of an existing call we don't show
the patterns because they will "push out" the existing arguments.

We should now get:
  Foo<here> =>  (blah, blah)
  Foo(<here> =>  ['(']blah, blah)
  Foo(<here>) => ['(']blah, blah[')']
  Foo(<here>, blah) => just complete the values for arg1**
  Foo(<here>blah, blah) => just complete the values for arg1

** A further improvement will be to add the argument label completion
for the first argument (if applicable) when we aren't showing a full
call pattern.

rdar://problem/22804670

Swift SVN r32765
2015-10-19 21:47:01 +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
7b6b26a46d [CodeCompletion] Only filter out non-required inits for class type.
Swift SVN r30893
2015-08-01 00:05:03 +00:00
Xi Ge
29fcee3f0b [CodeCompletion] Show only required init() as members of dynamic metatype.
rdar://22074073

Swift SVN r30888
2015-07-31 22:49:55 +00:00
Xi Ge
33611bfe33 [Test] Update test to use locally defined types instead of those from stdlib.
Swift SVN r30803
2015-07-30 17:16:26 +00:00
Xi Ge
d0b61a8bd7 [Test][CodeCompletion] Add a test for dynamic type.
Swift SVN r30782
2015-07-30 00:35:07 +00:00
Xi Ge
5a1946eb53 [CodeCompletion] Add init() to the code completion results after metatype + dot.
rdar://21474100

Swift SVN r30781
2015-07-30 00:10:43 +00:00
Denis Vnukov
152df92966 [CodeCompletion] Code Completion String getName should always return non-empty string value for
valid code completions. Code completion tests call and validate getName’s result. 

A minor fix for code completion fro subscripts.



Swift SVN r25101
2015-02-09 22:32:05 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Doug Gregor
e9037bcfa7 Default swift-ide-test to -implicit-objc-with like the rest of the world.
We require some level of consistency between the way the overlays were
built and what we work with in our mock SDK. The IDE/sdk_sugar.swift
test failure was because the overlay referenced "init(coder:)" while
the test was looking for "init(withCoder:)". Hilarity ensued
<rdar://problem/17791048>.

This only impacts testing.

Swift SVN r20564
2014-07-25 22:13:43 +00:00
Ben Langmuir
dfbd8b794f Don't desugar paren type when code-completing func params
We want to complete foo(p: (Int, Int)) as foo({#(p): (Int, Int)#}), not
as foo({#Int#}, {#Int#}).  Also, make initializers go through the
function parameter code path rather than the enum one, since we don't
want to recursively find parameters in tuples.

<rdar://problem/17461862>

Swift SVN r19514
2014-07-03 15:45:05 +00:00
Sonny Falk
22633c2d83 [IDE/CodeCompletion] Make code completion include the leading paren in calls.
The leading paren is included for display purposes only, not inserted
in the code if already present. It makes the displayed text in the
code completion list symmetrical with respect to open/close parens.

Add markups when printing annotation chunks so it becomes testable.
Update tests accordingly, and include tests for leading parens.

This addresses <rdar://problem/16918310>.

Swift SVN r18126
2014-05-15 21:09:56 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dmitri Hrybenko
a813e14b6d Code completion: complete 'super.init' in constructors
Also add tests for completing constructors declared with selector syntax.


Swift SVN r8412
2013-09-18 19:05:39 +00:00