removeCodeCompletionTokens(): return a 0-based offset of the code completion token

Documentation comment says that it should return a 0-based offset, but it
actually returns a 1-based offest.

Code completion tests did not catch this bug because the only consequence is
that the code completion token is shifted one character to the right, and in
all code completion tests we had a space after the code completion token.


Swift SVN r6566
This commit is contained in:
Dmitri Hrybenko
2013-07-24 22:30:24 +00:00
parent af2ffca8a2
commit 96b0f31ae7
2 changed files with 5 additions and 5 deletions

View File

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