[PATCH] D74844: [clangd] Get rid of Lexer usage in CodeComplete

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 19 09:21:32 PST 2020


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:593
+  llvm::StringRef SpelledSpecifier =
+      syntax::FileRange(CCSema.SourceMgr, SemaSpecifier->getBeginLoc(),
+                        SemaSpecifier->getEndLoc())
----------------
what if beginLoc and endLoc are in different files?
(this is most of what Lexer deals with, I think)

I think you want TokenBuffer::expandedTokens(SourceRange), then spelledForExpanded, and then FileRange(...).text().


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74844/new/

https://reviews.llvm.org/D74844





More information about the cfe-commits mailing list