[clang-tools-extra] [clangd] Document the cases in which Dex::Files and IdxContents are populated (PR #118906)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 16:47:03 PST 2024


https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/118906

This is a follow-up to https://github.com/llvm/llvm-project/pull/118324 to document that the `Dex` fields `Files` and `IdxContents` are intentionally only used in some cases, and describe what those cases are.

>From 7dcd5e96b0a27626f63368300b28c64a443b5312 Mon Sep 17 00:00:00 2001
From: Nathan Ridge <zeratul976 at hotmail.com>
Date: Thu, 5 Dec 2024 19:45:25 -0500
Subject: [PATCH] [clangd] Document the cases in which Dex::Files and
 IdxContents are populated

---
 clang-tools-extra/clangd/index/dex/Dex.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h
index 69e161d51135b6..8ae4050d004e28 100644
--- a/clang-tools-extra/clangd/index/dex/Dex.h
+++ b/clang-tools-extra/clangd/index/dex/Dex.h
@@ -121,6 +121,8 @@ class Dex : public SymbolIndex {
   llvm::DenseMap<std::pair<SymbolID, uint8_t>, std::vector<SymbolID>> Relations;
   std::shared_ptr<void> KeepAlive; // poor man's move-only std::any
   // Set of files which were used during this index build.
+  // Files and IdxContents are only populated for dynamic and background
+  // indexes, not static indexes.
   llvm::StringSet<> Files;
   // Contents of the index (symbols, references, etc.)
   IndexContents IdxContents;



More information about the cfe-commits mailing list