[PATCH] D50896: [clangd] Add xrefs LSP boilerplate implementation.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 17 12:04:23 PDT 2018


ioeric added a comment.

Agreed with Ilya. I'd probably also make this depend on the ongoing implementation, as exposing LSP endpoints without proper implementation might be confusing to clangd users who only look at the the LSP endpoints. Users need to dig two levels of abstraction to find out that it's not implemented.



================
Comment at: clangd/ClangdServer.h:158
+  /// Retrieve locations for symbol references.
+  void references(PathRef File, Position Pos, bool includeDeclaration,
+                  Callback<std::vector<Location>> CB);
----------------
I think the C++ API can return `SymbolOccurrence` in the callback, which would allow C++ API users to get richer information about the occurrences e.g. kind, relationship, code snippet.


================
Comment at: clangd/ClangdServer.h:158
+  /// Retrieve locations for symbol references.
+  void references(PathRef File, Position Pos, bool includeDeclaration,
+                  Callback<std::vector<Location>> CB);
----------------
ioeric wrote:
> I think the C++ API can return `SymbolOccurrence` in the callback, which would allow C++ API users to get richer information about the occurrences e.g. kind, relationship, code snippet.
nit: s/includeDeclaration/IncludeDeclaration/


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50896





More information about the cfe-commits mailing list