[clangd] Fix parseNamespaceEvents to parse the last token
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68020
llvm-svn: 372875
diff --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp
index 95f250c..ee0b74a 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -659,6 +659,9 @@
while (!Lex.LexFromRawLexer(Tok))
A(Tok);
+ // LexFromRawLexer returns true after it lexes last token, so we still have
+ // one more token to report.
+ A(Tok);
}
llvm::StringMap<unsigned> collectIdentifiers(llvm::StringRef Content,