diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp --- a/clang-tools-extra/clangd/XRefs.cpp +++ b/clang-tools-extra/clangd/XRefs.cpp @@ -2112,6 +2112,7 @@ // FIXME: Consider also using AST information when feasible. RefsRequest Request; Request.IDs.insert(*ID); + Request.WantContainer = true; // We could restrict more specifically to calls by introducing a new RefKind, // but non-call references (such as address-of-function) can still be // interesting as they can indicate indirect calls. diff --git a/clang-tools-extra/clangd/index/Index.h b/clang-tools-extra/clangd/index/Index.h --- a/clang-tools-extra/clangd/index/Index.h +++ b/clang-tools-extra/clangd/index/Index.h @@ -72,6 +72,8 @@ /// choose to return less than this, e.g. it tries to avoid returning stale /// results. llvm::Optional Limit; + /// If set, populates the SymbolID for the container of the reference. + bool WantContainer; }; struct RelationsRequest {