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
This commit is contained in:
Dmitri Hrybenko
2013-07-10 20:53:40 +00:00
parent 4bbf608e8f
commit 3c5b12fc0f
25 changed files with 546 additions and 25 deletions

View File

@@ -104,7 +104,8 @@ void swift::CompilerInstance::doIt() {
parseIntoTranslationUnit(TU, BufferID, &Done, nullptr, &TheParser);
assert(Done && "Parser returned early?");
(void) Done;
performDelayedParsing(TU, TheParser.get());
performDelayedParsing(TU, TheParser.get(),
Invocation->getCodeCompletionFactory());
TheParser.reset(nullptr);
}
@@ -135,5 +136,7 @@ void swift::CompilerInstance::doIt() {
performTypeChecking(TU, CurTUElem);
CurTUElem = TU->Decls.size();
} while (!Done);
performDelayedParsing(TU, TheParser.get(),
Invocation->getCodeCompletionFactory());
}