[PATCH] D64562: [clangd] Fixed toHalfOpenFileRange
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 11 07:08:40 PDT 2019
kadircet added inline comments.
================
Comment at: clang-tools-extra/clangd/SourceCode.cpp:252
-llvm::Optional<SourceRange> toHalfOpenFileRange(const SourceManager &Mgr,
+// FIXME: Here we check whether the token at the location is a greatergreater
+// (>>) token and consider it as a single greater (>). This is to get it working
----------------
maybe move the comment to just before `if(thetok.is(greatergreater))` check?
================
Comment at: clang-tools-extra/clangd/SourceCode.cpp:260
+ Token TheTok;
+ if (!Lexer::getRawToken(Loc, TheTok, SM, LangOpts)) {
+ if (TheTok.is(tok::greatergreater))
----------------
re-arrange for less indentation:
```
if(Lexer::getRawToken(...))
return 0;
if(TheTok.is(tok::greater...)
return 1;
return TheTok...;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64562/new/
https://reviews.llvm.org/D64562
More information about the cfe-commits
mailing list