[PATCH] D54529: [clangd] Add USR to textDocument/definition response

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 14 08:39:19 PST 2018


sammccall added a comment.

Hi Jan,

Clangd uses SymbolIDs rather than USRs, to identify symbols.

However these are used only internally, and for extension point APIs (SymbolIndex), and not actually exposed over the wire.
Can you explain more about the need to identify the symbol in go-to-definition?

Conceptually the idea of providing at least an opaque identifier when naming symbols makes sense - the cursor position can often be ambiguous.
However LSP decided not to go this route, and we risk diverging (e.g. should "hover" be able to accept such an identifier too? etc).

Giving particular semantics to the identifiers seems much more risky.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54529





More information about the cfe-commits mailing list