Commit Graph

113 Commits

Author SHA1 Message Date
Dmitri Hrybenko
278cbad8a4 Code completion: don't produce any results in enum case. Only integer literals
are allowed in that context.


Swift SVN r9383
2013-10-15 22:45:54 +00:00
Dmitri Hrybenko
af4ad7e9b7 Code completion: assign a special semantic context for iteration variables
in a C-style for loop


Swift SVN r9111
2013-10-09 23:32:59 +00:00
Dmitri Hrybenko
b91b4b61e1 Code completion: complete type-ident without dot, for example Foo#^A^#
Swift SVN r7499
2013-08-23 01:30:04 +00:00
Dmitri Hrybenko
cdb1df51a3 Code completion: completion of type-ident in type contexts (like Foo.#^A^#)
This introduces the required code completion callbacks which pass partially
parsed TypeReprs to code completion.  These types can refer to generic function
parameters.  Because we need to typecheck these types, we need to typecheck
generic parameters first.  Because exposing fine-grained typechecker interface
just for code completion is bad, we create a function declaration based on the
limited information we have (i.e., just the function name and generic
parameters) and pass that to the typechecker.  This approach (in theory) should
work uniformly for function decls and nominal type decls, but the nominal type
decl case is not tested yet.  Eventually we will also want to use a similar
approach for normal parser recovery as well.


Swift SVN r7313
2013-08-17 02:35:32 +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
Dmitri Hrybenko
b2a5e2c11a Code completion: complete in type contexts -- basic implementation
Swift SVN r7207
2013-08-13 20:36:48 +00:00
Dmitri Hrybenko
66a447adb8 Code completion: code completion on a different line that the expr-postfix:
use the Tok.isAtStartOfLine() check instead of comparing line numbers


Swift SVN r7192
2013-08-13 03:17:54 +00:00
Dmitri Hrybenko
8a7628d795 Code completion: fix a bug where code completing in a function body on the next
line after a var decl with initializer would complete based on the initializer
expression.

These are technically valid completions, but confusing.  Now this suggests
unqualified completions.


Swift SVN r7188
2013-08-13 02:25:00 +00:00
Dmitri Hrybenko
2bbef342f0 Code completion: refactor code completion callbacks so that actual name lookups
happen after delayed parsing is finished.  This ensures that the AST for
delayed parsed code (for example, function body) is constructed.  This is
required for partial type checking of function bodies.


Swift SVN r7010
2013-08-07 22:42:36 +00:00
Dmitri Hrybenko
e650f2f8fc Implement basic code completion at the beginning of the expr-postfix
We produce only names that are found by name lookup, no keywords or types yet.


Swift SVN r6276
2013-07-16 00:49:08 +00:00
Dmitri Hrybenko
98aaf3bb45 Add code completion for expr-super: 'super#^A^#' and 'super.#^A^#'
Swift SVN r6264
2013-07-15 18:11:48 +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