[PATCH] D66590: [clangd] Fix toHalfOpenFileRange where start/end endpoints are in different files due to #include

Shaurya Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 05:49:09 PDT 2019


SureYeaah accepted this revision.
SureYeaah added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang-tools-extra/clangd/SourceCode.cpp:284
+      return SM.getComposedLoc(IncludingFile, Offset);
+    if (Buf[Offset] == '\n' || Offset == 0) // no hash, what's going on?
+      return SourceLocation();
----------------
nit: use this as a while condition?

```
while(Offset-- && Buf[Offset] != '\n')
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66590





More information about the cfe-commits mailing list