[clang-tools-extra] [clangd][RFC] Add container field to remote index Refs grpc method (PR #71605)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 7 15:52:02 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangd

Author: dupes (tdupes)

<details>
<summary>Changes</summary>

call hierarchy cannot be enhanced via the remote index because the Refs returned by the remote index do not have the ID of its container. 

---
Full diff: https://github.com/llvm/llvm-project/pull/71605.diff


2 Files Affected:

- (modified) clang-tools-extra/clangd/index/remote/Index.proto (+1) 
- (modified) clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp (+1) 


``````````diff
diff --git a/clang-tools-extra/clangd/index/remote/Index.proto b/clang-tools-extra/clangd/index/remote/Index.proto
index 3072299d8f345f2..33bf095d88598f5 100644
--- a/clang-tools-extra/clangd/index/remote/Index.proto
+++ b/clang-tools-extra/clangd/index/remote/Index.proto
@@ -81,6 +81,7 @@ message Symbol {
 message Ref {
   optional SymbolLocation location = 1;
   optional uint32 kind = 2;
+  optional string container = 3;
 }
 
 message SymbolInfo {
diff --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
index 7e31ada18a65797..192d6d08fe58cb1 100644
--- a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
+++ b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
@@ -189,6 +189,7 @@ llvm::Expected<clangd::Ref> Marshaller::fromProtobuf(const Ref &Message) {
     return Location.takeError();
   Result.Location = *Location;
   Result.Kind = static_cast<RefKind>(Message.kind());
+  Result.Container = SymbolId(Ref.container());
   return Result;
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/71605


More information about the cfe-commits mailing list