Commit Graph

883 Commits

Author SHA1 Message Date
Doug Gregor
f7b84d4f41 Code completion: add chunks for <, >, and generic parameters.
Swift SVN r9107
2013-10-09 23:11:42 +00:00
Jordan Rose
cba6b2cc70 Use SourceFile in REPL code completion.
Swift SVN r9074
2013-10-09 18:38:19 +00:00
Dmitri Hrybenko
6895c34741 Code completion: report "semantic context" for every code completion result
Semantic context describes the origin of the declaration and serves the same
purpose as opaque numeric "priority" in Clang -- to determine the most likely
completion.

This is the initial implementation.  There are a few opportunities to bump the
priority of a certain decl by giving it SemanticContextKind::ExprSpecific
context that are not implemented yet.


Swift SVN r9052
2013-10-09 02:08:05 +00:00
Dmitri Hrybenko
6f4cb05603 Code completion: basic support for completing memebrs of DynamicLookup (id)
Only tested with functions (instance/class functions) declared in swift
classes.  Need more testcases.


Swift SVN r8800
2013-10-01 02:14:25 +00:00
Argyrios Kyrtzidis
efe3d94e6b [AST] Introduce DeclContext::walkContext(), used for ASTWalking a DeclContext.
Swift SVN r8776
2013-09-30 15:43:09 +00:00
Argyrios Kyrtzidis
f32167d166 [AST] Introduce a walk() method for TranslationUnit.
Swift SVN r8729
2013-09-27 17:24:35 +00:00
Argyrios Kyrtzidis
e68201fa66 [IDE] Replace ide::findSemanticSourceEntities() with a more general SourceEntityWalker abstract class.
Swift SVN r8699
2013-09-26 21:36:03 +00:00
Argyrios Kyrtzidis
e287701749 [IDE] Fix annotation of constructors.
Swift SVN r8688
2013-09-26 01:43:35 +00:00
Argyrios Kyrtzidis
1d27584ef8 [swift-ide-test] Rename option '-terminal-output' -> '-terminal'.
Swift SVN r8619
2013-09-25 01:35:38 +00:00
Argyrios Kyrtzidis
0fe6d45e62 [IDE] Introduce semantic annotation functionality and test.
Swift SVN r8618
2013-09-25 01:35:36 +00:00
Ted Kremenek
8f5b8ccb02 Rename "This" to "Self" and "this" to "self".
This was not likely an error-free change.  Where you see problems
please correct them.  This went through a fairly tedious audit
before committing, but comments might have been changed incorrectly,
not changed at all, etc.

Swift SVN r7631
2013-08-27 21:58:27 +00:00
Sonny Falk
417a162f2c Rename enum class SyntaxColor to SyntaxNodeKind, since this represents more than color.
Set the size for SyntaxNodeKind to uint_8_t, since we're packing it together with length in a 32-bit value in SourceKit.
Add SyntaxNodeKind::Identifier.



Swift SVN r7609
2013-08-26 23:49:03 +00:00
Dmitri Hrybenko
2786c30dd8 Code completion: add a parser hook to inform code completion about generic
parameters while parsing the function signature.  Generic parameters are not
accessible at that time through the AST node, because the FuncDecl AST node was
not constructed yet.


Swift SVN r7222
2013-08-14 02:16:55 +00:00
Argyrios Kyrtzidis
0d7fc0aa1d [ide] Use the newly introduce CharSourceRange inside ide::SyntaxNode.
Swift SVN r7174
2013-08-12 20:58:20 +00:00
Dmitri Hrybenko
a6519a907d Code completion: implement code completion for dot member access on clang modules
Because we don't want FooModule.#^A^# to show completion results for other
clang modules, global completion cache was replaced with a per-module cache.


Swift SVN r6951
2013-08-06 21:15:23 +00:00
Argyrios Kyrtzidis
7c9831df88 [IDE] Handle string interpolation for syntax-coloring.
Swift SVN r6894
2013-08-05 15:21:58 +00:00
Argyrios Kyrtzidis
885c9ce119 [IDE] Highlight type identifiers.
Swift SVN r6862
2013-08-02 22:44:59 +00:00
Dmitri Hrybenko
99b626e8dd Fix indentation
Swift SVN r6844
2013-08-02 17:35:31 +00:00
Argyrios Kyrtzidis
df96177b36 [IDE] Add hasText() convenience method in the code-completion chunk.
Swift SVN r6839
2013-08-02 16:56:02 +00:00
Argyrios Kyrtzidis
49389348ac [IDE] Introduce the "syntax-coloring" action.
Swift SVN r6837
2013-08-02 02:50:32 +00:00
Argyrios Kyrtzidis
cff4cf4e16 [IDE] Add CodeCompletionResult::getKind().
Swift SVN r6835
2013-08-02 02:50:31 +00:00
Argyrios Kyrtzidis
7e81b4919a [IDE] Rename "code_completion" namespace to "ide"
Swift SVN r6834
2013-08-02 02:50:28 +00:00
Dmitri Hrybenko
bea606fc4b CodeCompletionString: replace CallParameter*Annotation chunks with an
"IsAnnotation" flag on the Chunk.  This flag is also set on the TypeAnnotation
chunk.

This revised design makes it easy for the client to find out if a particular
chunk should be inserted into the editor buffer or not.


Swift SVN r6809
2013-08-01 18:08:34 +00:00
Dmitri Hrybenko
2dc2182e61 Code completion: add an API to sort code completion results and use it in REPL
Swift SVN r6780
2013-07-31 20:52:11 +00:00
Dmitri Hrybenko
9d832569bd Move REPL code completion wrapper to libIDE so that it can be reused and we can
add tests for it


Swift SVN r6763
2013-07-30 22:54:00 +00:00
Dmitri Hrybenko
72c531b3d5 Make CodeCompletionString::Chunk class a public member of CodeCompletionString
It is used in CodeCompletionString public APIs which happen to be unused
outside libIDE right now.


Swift SVN r6623
2013-07-25 23:34:33 +00:00
Dmitri Hrybenko
dcd26e8a1f Code completion: implement completion of imported Clang declarations by first
importing them

Because going through the import for every code completion request is slow,
Clang code completion results are cached in the CodeCompletionContext.  The
cache needs to be invalidated whenever a new Clang module is loaded.  In order
to implement this, ModuleLoadListener class was added.


Swift SVN r6505
2013-07-23 18:12:58 +00:00
Dmitri Hrybenko
909352879a Code completion: recognize and print the correct signature for implicitly
curried functions


Swift SVN r6470
2013-07-22 21:18:09 +00:00
Dmitri Hrybenko
189ffc49a5 Code completion: don't crash on functions with selector-style arguments
Swift SVN r6269
2013-07-15 20:11:22 +00:00
Dmitri Hrybenko
f28d4a081a Refactor CodeCompletionString and CodeCompletionResult stringification
functions to use raw_ostream like the rest of clang and swift.  Also add a
comment that these functions are intended for debugging only.


Swift SVN r6212
2013-07-12 20:50:26 +00:00
Dmitri Hrybenko
c4f33c89a8 Add code completion for subscript operators
Swift SVN r6202
2013-07-12 18:03:15 +00:00
Dmitri Hrybenko
02084efab7 Implement code completion for some function calls and member variable accesses
in expr-dot and expr-postfix that can be typechecked without typechecking the
beginning of the function body.


Swift SVN r6198
2013-07-12 02:00:41 +00:00
Dmitri Hrybenko
3c5b12fc0f Code completion: add a lot of infrastructure code
* Added a mode in swift-ide-test to test code completion.  Unlike c-index-test,
  the code completion token in tests is a real token -- we don't need to
  count lines and columns anymore.

* Added support in lexer to produce a code completion token.

* Added a parser interface to code completion.  It is passed down from the
  libFrontend to the parser, but its functions are not called yet.

* Added a sketch of the interface of code completion consumer and code
  completion results.

Note: all this is not doing anything useful yet.


Swift SVN r6128
2013-07-10 20:53:40 +00:00