mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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] == '^') {
|
||||
|
||||
Reference in New Issue
Block a user