[PATCH] D72458: [clangd] Adjust diagnostic range to be inside main file

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 08:49:41 PST 2020


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:342
+    llvm::Optional<Note> NoteInsideMainFile;
+    for (auto &N : D.Notes) {
+      if (!N.InsideMainFile)
----------------
NIT: arguably simpler with the standard algorithm
```
auto It = llvm::find_if(D.Notes, [](const Node&N) { return N.InsideMainFile; });
assert(It != D.Notes.end());
```

Up to you.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72458





More information about the cfe-commits mailing list