Commit Graph

3980 Commits

Author SHA1 Message Date
Xi Ge
0df10311a0 [CodeCompletion] Add the initial support for unresolved members.
This commit completes an unresolved member with all visible enum elements.
We need future work to reduce the list to those that are guaranteed to be
resolved under the current context.

Swift SVN r31063
2015-08-06 23:15:14 +00:00
Xi Ge
f9a621e6f5 [SyntaxHighlight] Highlight #line as keyword. rdar://22163375
Swift SVN r31040
2015-08-06 01:34:25 +00:00
Xi Ge
21e8a93761 [CodeCompletion] Add specific semantic context kind to 'super', 'self' and 'nil'.
This change gives these keywords a boost of priority when SourceKit sorts code completion
results.
rdar://21796980

Swift SVN r31037
2015-08-06 01:03:16 +00:00
Jordan Rose
0dbf9b2780 Add 'try?' (and 'try!') as statement-level completions.
Also, if 'else' is a statement-keyword, so is 'catch'.

More rdar://problem/21692467

Swift SVN r31033
2015-08-05 22:17:39 +00:00
Argyrios Kyrtzidis
f46b8a7b8a [IDE] For clang header interface printing, adjust the cc1 triple string we got from clang, to make sure it will be accepted
when it goes throught the swift clang importer.

rdar://22139338

Swift SVN r31017
2015-08-04 22:49:27 +00:00
Ben Langmuir
c011b9f54c Add method to get first chunk in code completion string with punctuation
The client may or may not want to include the leading punctuation in a
result e.g. in "?.foo()".

Swift SVN r31013
2015-08-04 22:13:25 +00:00
Xi Ge
87018e516f [CodeCompletion] No crashing when function name is empty. rdar://21149908
Swift SVN r31011
2015-08-04 22:09:58 +00:00
Jordan Rose
953424072e Guard "object literals" feature with SWIFT_ENABLE_OBJECT_LITERALS.
This is not a feature we're releasing at the moment, so provide a way
to turn it off.

rdar://problem/21935551

Swift SVN r30966
2015-08-04 00:16:52 +00:00
Xi Ge
d7e07b1d4d [CodeCompletion] When code completing import decls, we only show the module names that are not yet imported in previous import decls.
Swift SVN r30964
2015-08-03 22:54:58 +00:00
Chris Willmore
7f12c9ffd5 [CodeCompletion] Add the initial support for code completing import declaration.
When a user invoke code completion after import keywords, the names of
visible top level clang modules were recommended for finishing the import decl.

(Undoing revert r30961 of r30957, which just required lockstep commit to
SourceKit -- cwillmore)

Swift SVN r30962
2015-08-03 21:08:32 +00:00
Chris Willmore
e4d1ac9c24 Revert "[CodeCompletion] Add the initial support for code completing import declaration."
This reverts r30957 because it broke the following tests on Jenkins:

    SourceKit :: CodeComplete/complete_open.swift
    SourceKit :: CodeComplete/complete_test.swift

<rdar://problem/22120345> swift-incremental-RA #8289 failed to build

Swift SVN r30961
2015-08-03 21:04:46 +00:00
Xi Ge
5e0014bcc4 [CodeCompletion] Add the initial support for code completing import declaration.
When a user invoke code completion after import keywords, the names of
visible top level clang modules were recommended for finishing the import decl.

Swift SVN r30957
2015-08-03 20:02:17 +00:00
Argyrios Kyrtzidis
b3dd0fa461 [IDE] When doing ObjC header interface printing, make sure to handle -include properly.
rdar://20893507

Swift SVN r30939
2015-08-03 02:12:14 +00:00
Argyrios Kyrtzidis
0bb52f0621 [IDE] Fix the 'preamble' top-comment printing when printing the swift source interface.
It erroneously printed out accessibility keyword of the first decl and did not take into
account comment whitespacing.

Swift SVN r30933
2015-08-02 20:46:38 +00:00
Argyrios Kyrtzidis
84e27fa26d [IDE] Properly annotate subscript brackets as references to subscript decls and enable jump-to-definition for them.
rdar://22099838

Swift SVN r30910
2015-08-01 05:36:13 +00:00
Argyrios Kyrtzidis
76f1a06913 [sdk-analyzer] Remove modules that have become unavailable for swift.
Swift SVN r30909
2015-08-01 05:36:03 +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
61c1e99304 [IDE] Expose an API to extract plain text from given comments. rdar://22021120
Swift SVN r30834
2015-07-31 01:36:53 +00:00
Xi Ge
c5ebe153d1 [CleanUp] Use DC as the abbreviation of DeclContext.
Swift SVN r30804
2015-07-30 17:16:28 +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
Xi Ge
903bf976b2 Chop overly long lines.
Swift SVN r30780
2015-07-30 00:10:39 +00:00
Xi Ge
0743f07150 [CodeCompletion] Address Argyrios' and Ben's comments.
Swift SVN r30772
2015-07-29 18:01:40 +00:00
Xi Ge
32667fdbf9 [CodeCompletion] Add "super" keyword to code completion results when "super" is meaningful in the current decl context.
rdar://20401979

Swift SVN r30749
2015-07-29 01:37:23 +00:00
Xi Ge
3e9357a9bb [CodeCompletion] When completing init calls, stick to the type alias name given by the user instead of (smartly) showing the underlying type name. rdar://18586415
Swift SVN r30723
2015-07-28 20:45:12 +00:00
Xi Ge
da69adbb09 [SyntaxHighlighting] Fix a issue when detecting multiple urls exist in one line of commit.
Swift SVN r30682
2015-07-27 01:12:30 +00:00
Xi Ge
f51335ac65 [SyntaxHighlighting] Highlight platform keywords inside available attributes. rdar://21905215
Swift SVN r30681
2015-07-27 01:12:28 +00:00
Xi Ge
af589ebaa7 [InterfacePrinting] Print missing import decls from Swift module instance. rdar://20695897
Swift SVN r30588
2015-07-24 20:44:21 +00:00
Xi Ge
61ccc5f48e Move radar number out of source file.
Swift SVN r30546
2015-07-23 20:23:04 +00:00
Xi Ge
72df884348 [SyntaxColoring] Correct the node kind of attributes and comment on the special case.
Swift SVN r30544
2015-07-23 19:49:17 +00:00
Doug Gregor
f00e5bc6ab Allow a variadic parameter anywhere in the parameter list.
Requiring a variadic parameter to come at the end of the parameter
list is an old restriction that makes no sense nowadays, and which we
had all thought we had already lifted. It made variadic parameters
unusable with trailing closures or defaulted arguments, and made our
new print() design unimplementable.

Remove this restriction, replacing it with a less onerous and slightly
less silly restriction that we not have more than one variadic
parameter in a given parameter clause. Fixes rdar://problem/20127197.

Swift SVN r30542
2015-07-23 18:45:29 +00:00
Xi Ge
95dc5b5607 [SyntaxColoring] Address Jordan's comments.
Highlight all decl modifiers for enum element decls, not just "indirect", as keywords.

Swift SVN r30524
2015-07-23 02:24:43 +00:00
Xi Ge
d980700f17 [SyntaxColoring] Add syntax coloring to indirect keyword of enum element decl. rdar://21927124
Swift SVN r30521
2015-07-23 01:37:22 +00:00
Xi Ge
6471303c12 [InterfacePrinting] Alter PrintOptions for interface printing so that user-defined internal decls are visible in the generated interfaces.
Also, we always print accessibility keywords in the printed interfaces, so that users can differentiate public and
internal decls.
rdar://20680375

Swift SVN r30520
2015-07-23 01:37:20 +00:00
Chris Lattner
0001dc27bb remove support for the experiemental "character literals" feature.
Swift SVN r30509
2015-07-22 22:35:19 +00:00
Xi Ge
c783def2f5 [CodeCompletion] Add code completion for platform names inside #available() condition.
The code for generating the code completion string reuses that of the @available attribute.
rdar://21467109

Swift SVN r30346
2015-07-18 00:10:37 +00:00
Xi Ge
2f3a77ab40 Address Ben's comments on r30290
Swift SVN r30325
2015-07-17 20:27:17 +00:00
Xi Ge
42ecad7903 [SyntaxModel] Improve the efficiency of url regex search.
We improve the efficiency through two ways: 1. read the protocol keywords, such as
http, radar, or im, to select the right regex pattern to search for instead of
trying every known patterns; and 2. reduce the regex search space by truncating
text before protocol keywords. rdar://21009781

Swift SVN r30290
2015-07-17 00:03:22 +00:00
Xi Ge
57489ceb0f [SyntaxHighlighting] Give ASTWalker the option to walk into generic params of function decls.
Therefore, generic params can also benefit from syntax highlighting and semantic annotation
in SourceKit. rdar://20529255

Swift SVN r30220
2015-07-15 18:28:09 +00:00
Xi Ge
0ad59157ae Revert "[InterfacePrinting] Print stdlib internal protocols whose names start with no '_'"
This reverts commit ca7c1e5692bdd51cb0800be42c964462a3c84436.

Swift SVN r30191
2015-07-14 18:39:49 +00:00
Xi Ge
a6e43171e3 [InterfacePrinting] Print stdlib internal protocols whose names start with no '_'
rdar://21515803

Swift SVN r30178
2015-07-14 00:30:45 +00:00
Xi Ge
1eac2874b1 [InterfacePrinting] Move utf8 sanitizer from SourceKit to ASTPrinter.
We sanitize comments by replacing invalid utf8 subsequence with � .

Swift SVN r30031
2015-07-09 18:26:02 +00:00
Xi Ge
fedf76577b [ASTWalker] Allow client to specify whether SourceEntityWalker should walk into inactive regions.
Swift SVN r30003
2015-07-09 00:36:44 +00:00
Xi Ge
6f33efd5f9 [InterfacePrinting] Printing non-doc comments at the beginning of a file, rdar://21710187.
When printing the interface extracted from a Swift file, we print every comments before
Swift code starts.

Swift SVN r29989
2015-07-08 20:10:57 +00:00
Xi Ge
09c1d8f308 [DocCommentPrint] For quick help, print objc declarations in Swift. rdar://21097812
Swift SVN r29949
2015-07-08 00:05:52 +00:00
David Farler
dd44dad017 Add 'throws' keyword to doc comments
Adding the following to a doc comment:

- throws: ...

Will create a description about what/when the function will throw.
This should be a peer to "- returns:" and "- parameter:" and not appear
inline in the description.

rdar://problem/21621679

Swift SVN r29831
2015-07-01 02:03:25 +00:00
Dmitri Hrybenko
7ee84ed6b3 stdlib: rename Reflectable.{getMirror() -> _getMirror()}
Start removing the old mirrors.

rdar://21428474

Swift SVN r29823
2015-07-01 00:31:32 +00:00
Dmitri Hrybenko
ec9af44fe8 Adjust for new macro API in Clang
Swift SVN r29706
2015-06-25 22:01:45 +00:00
Dave Abrahams
3ce2df990b Squash a release build warning
Swift SVN r29687
2015-06-25 21:34:25 +00:00
Ben Langmuir
1be2a778c1 [CodeCompletion] Avoid choking on a doubly-typechecked expr
First, fix a case of type checking an expression twice, which is against
the design of the type checker. We hit this because we can type check
the "context" in
  let x = foo.#^COMPLETE^#
and then type check the "parsed expression", which is contained in the
context here.

Second, make the hack from rdar://20738314 more robust so that if we
*do* double typecheck for some reason we won't just choke on an
AutoClosureExpr.  I filed rdar://21466394 to audit for other cases of
double typechecking and remove this hack.

Fixes rdar://21346928

Swift SVN r29527
2015-06-19 22:16:07 +00:00