[PATCH] D40897: [clangd] Introduce a "Symbol" class.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 01:27:41 PST 2017


ioeric added inline comments.


================
Comment at: clangd/Symbol.h:23
+  // The path of the source file where a symbol occurs.
+  std::string FilePath;
+  // The offset to the first character of the symbol from the beginning of the
----------------
Is this relative or absolute?


================
Comment at: clangd/Symbol.h:26
+  // source file.
+  unsigned StartOffset;
+  // The offset to the last character of the symbol from the beginning of the
----------------
0-based or 1-based?


================
Comment at: clangd/Symbol.h:39
+  // The symbol identifier, using USR.
+  std::string Identifier;
+  // The qualified name of the symbol, e.g. Foo::bar.
----------------
It might make sense to just call this `USR` to be more explicit.


================
Comment at: clangd/Symbol.h:51
+  //   * For classes, the canonical location is where they are defined.
+  SymbolLocation CanonicalLocation;
+  // Information for code completion.
----------------
For functions and classes, should we store both declaration and definition locations?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D40897





More information about the cfe-commits mailing list