Commit Graph

18 Commits

Author SHA1 Message Date
Dmitri Gribenko
feacbc4433 Rename ErrorType to ErrorProtocol 2015-12-09 17:12:19 -08:00
Ben Langmuir
1992bb08b2 [CodeCompletion] Add keyword kind to code completion results
This lets us reliably distinguish keywords we care about without
resorting to string comparisons.  Also driveby fix throw to be a
statement keyword.
2015-11-02 13:27:34 -08:00
Dmitri Hrybenko
4375a463a7 stdlib: rename Int**.value and Float**.value to _value per naming convention
rdar://21357661

Swift SVN r32096
2015-09-20 00:01:13 +00:00
Argyrios Kyrtzidis
658d852f68 [IDE] When printing stdlib interface, hide underscored members of protocols, and subscript
decls that have underscored parameters.

Dmitri verified that the removals after this change are ok.

Swift SVN r29177
2015-05-31 00:41:09 +00:00
Ben Langmuir
d4448b5c6d Re-enable test/IDE/complete_exception.swift with 32bit fix
Use Int32 instead of Int per suggestion from Dmitri.

Swift SVN r29088
2015-05-27 22:39:04 +00:00
Greg Parker
9ce2b998e5 [test] Disable test IDE/complete_exception.swift.
It fails on 32-bit architectures.


Swift SVN r29087
2015-05-27 22:21:55 +00:00
Ben Langmuir
4c83738657 Address review feedback on r29070
* Make CHECK-NOT lines more robust
* Remove redundant assertion

Swift SVN r29079
2015-05-27 21:25:10 +00:00
Ben Langmuir
8ccaa86806 [CodeCompletion] Complete variables bound by catch
Make sure we build the CatchStmt and DoCatchStmt AST nodes when
code-completing inside the body of a catch so that we can complete the
bindings from the catch.

It's often a good idea to early-exit once we see a code completion
token, but not when we skip building an AST node that provides variable
bindings.  In code completion, we don't have Scope-based lookup, and
rely on having reachable AST nodes for patterns so that we can dig the
out the bindings we need.

Also extend the pattern checking to handle "IsPattern", since we
apparently weren't handling "let x as Foo", and that affects all complex
catch patterns because of an implicit "as ErrorType" or explicit
"as NSError".

rdar://problem/21116164

Swift SVN r29070
2015-05-27 19:01:16 +00:00
Jordan Rose
fa5bd4c6c8 [ClangImporter] Allow apinotes to affect inherited initializers.
Then use that to ban NSError.init(), because it doesn't create a valid
NSError. In the long run Foundation will hopefully add this to their
headers, but they can't yet (rdar://problem/19977891).

rdar://problem/21042412

Swift SVN r28881
2015-05-21 18:11:17 +00:00
Ben Langmuir
fb7dd7698a Fix linux testing after r28716
Cargo cult over a requirement from the clang importer tests.  It seems a
bit more semantic than XFAIL: linux.

Swift SVN r28717
2015-05-18 19:53:45 +00:00
Ben Langmuir
882959b60d [CodeCompletion] Remove incorrect special-casing for throw/catch
It's not okay to filter to only ErrorType results, since we may be
trying to chain to an error type result foo.bar.getError().  And the
existing logic had no way to handle results from other modules, so we
were missing key results like 'NSError'.

Eventually we'll want to bring back something like this that handles all
modules, but as a way to bump the priority of ErrorType results rather
than to filter out everything else.

rdar://problem/20985515

Swift SVN r28716
2015-05-18 19:00:04 +00:00
Ted Kremenek
9f9bb725cf Rename '_ErrorType' to 'ErrorType'.
Swift SVN r28293
2015-05-07 21:59:29 +00:00
Xi Ge
90cf8aec22 [CodeCompletion] Add types whose extensions
conform _ErrorType protocol to the completions of throw statement.

Swift SVN r26691
2015-03-29 05:56:06 +00:00
Xi Ge
256e038edf [CodeCompletion] Add exception handle clauses to catch stmt completion.
Swift SVN r26597
2015-03-26 18:32:13 +00:00
Xi Ge
0d9fb1aaa5 [CodeCompletion] Make sure only instantiable types are included
in code completion options when completing a throw statement.

Swift SVN r26571
2015-03-26 00:58:19 +00:00
Xi Ge
381e9ebe40 [test] Add a missing run line.
Swift SVN r26567
2015-03-26 00:02:56 +00:00
Xi Ge
6f43e545fb [CodeCompletion] Auto-completing the throw statement.
When the code completion token appears after throw keyword,
a set of visible decls and instances conforming _ErrorType are
recommended as completion.

Swift SVN r26565
2015-03-25 23:46:26 +00:00
Xi Ge
8a64deb828 [codecompletion] auto-completing the catch statement.
When the code completion token is seen after the catch keyword, a set of
visible error types are suggested as completion.

Swift SVN r26519
2015-03-25 04:16:57 +00:00