and remove DeclContext base class from FuncDecl, ConstructorDecl and
DestructorDecl
This decreases the number of DeclContexts to 7 and allows us to apply
alignas(8) to DeclContext.
Swift SVN r8186
ConstructorDecl::getBody() and DestructorDecl::getBody() return 'BraceStmt *'.
After changing the AST representation for functions, FuncDecl::getBody() will
return 'BraceStmt *' and FuncDecl::getFuncExpr() will be gone.
Swift SVN r8050
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
This ensures that we parse the next statement we don't see the code completion
token.
Allows to remove an ugly workaround in the code completion engine.
Swift SVN r7598
Previously, TypeAliasDecl was used for typealiases, generic
parameters, and assocaited types, which is hideous and the source of
much confusion. Factor the latter two out into their own decl nodes,
with a common abstract base for "type parameters", and push these
nodes throughout the frontend.
No real functionality change, but this is a step toward uniquing
polymorphic types, among other things.
Swift SVN r7345
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
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
addZzz(). The 'Swift' part of the name was added because there was a codepath
for completing swift decls and a different one for completing clang decls. Now
we complete clang decls by first importing them, so the 'Swift' part of the
name is just redundant.
Swift SVN r7195
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
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
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
Decouple splitting an interpolated string to segments, from encoding the string segments.
This allows us to tokenize or re-lex a string literal without having to allocate memory for
encoding the string segments when we don't need them encoded.
Swift SVN r6940
constructing the MetaTypeType. LValueness of the expression does not matter
for the metatype type. (And it also makes the type annotations very long in
many cases.)
Swift SVN r6857
around everywhere
Fixes:
rdar://14585108 Code completion does not work at the beginning of the file
rdar://14592634 Code completion returns zero results at EOF in a function
without a closing brace
Swift SVN r6820
"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