Code completion: insert a zero character into the buffer to mark the code

completion token

This is required to handle cases like fooObject.#^A^#.bar where code completion
is invoked inside the ".." token.  Previously, the token would not be split and
the lexer would produce an incorrect tokenization for this case.  Now we
produce ".", tok::code_complete, ".".


Swift SVN r6635
This commit is contained in:
Dmitri Hrybenko
2013-07-26 00:45:57 +00:00
parent ea24dbd9db
commit f9fa6aa8fc
4 changed files with 43 additions and 22 deletions

View File

@@ -32,6 +32,7 @@ std::string swift::code_completion::removeCodeCompletionTokens(
StringRef(Ptr, Token.size()) == Token) {
Ptr += Token.size() - 1;
*CompletionOffset = CleanFile.size();
CleanFile += '\0';
continue;
}
if (C == '#' && Ptr <= End - 2 && Ptr[1] == '^') {