[PATCH] D75474: [clangd] Get rid of getTokenRange helper

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 05:02:31 PST 2020


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:170
+  // outside the main file.
+  L.range = halfOpenToRange(
+      SM, CharSourceRange::getCharRange(
----------------
(nit: consider extracting a variable for end loc or token length just for readability)


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:449
+    DocumentHighlight DH;
+    DH.range = halfOpenToRange(SM, Ref.SpelledTok.range(SM).toCharRange(SM));
+    if (Ref.Role & index::SymbolRoleSet(index::SymbolRole::Write))
----------------
Ref.range(SM)


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:525
+      Location Result;
+      Result.range =
+          halfOpenToRange(SM, Ref.SpelledTok.range(SM).toCharRange(SM));
----------------
Ref.range(SM)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75474





More information about the cfe-commits mailing list