[PATCH] D43182: [clangd] SymbolLocation only covers symbol name.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 07:12:24 PST 2018


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

Nice!



================
Comment at: clangd/index/Index.cpp:40
 raw_ostream &operator<<(raw_ostream &OS, const Symbol &S) {
-  return OS << S.Scope << S.Name;
+  return OS << S.Scope << S.Name << " " << S.CanonicalDeclaration << ", "
+            << S.Definition << "\n";
----------------
Was this just for debugging? I had this change locally when working on this code, but reverted it.
It's not applicable in lots of places we'd like to debug with a symbol, so I'd lean towards reverting it (and if we really need a verbose version, dumping the YAML)


================
Comment at: clangd/index/Index.h:125
   SymbolLocation Definition;
-  // The location of the preferred declaration of the symbol.
+  // The location of the preferred declaration of the symbol, just covers the
+  // symbol name.
----------------
This fragment doesn't really make sense. (Semicolon might be better, but really it should be another sentence).

Can we drop "the location of" so this fits on a line?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43182





More information about the cfe-commits mailing list