Skip to content

[clangd] Add clarifying comment about when Dex::IdxContents is populated #118906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

HighCommander4
Copy link
Collaborator

This is a follow-up to #118324 to document that the Dex fields Files and IdxContents are intentionally only used in some cases, and describe what those cases are.

@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-clang-tools-extra

Author: Nathan Ridge (HighCommander4)

Changes

This is a follow-up to #118324 to document that the Dex fields Files and IdxContents are intentionally only used in some cases, and describe what those cases are.


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

1 Files Affected:

  • (modified) clang-tools-extra/clangd/index/dex/Dex.h (+2)
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;

@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-clangd

Author: Nathan Ridge (HighCommander4)

Changes

This is a follow-up to #118324 to document that the Dex fields Files and IdxContents are intentionally only used in some cases, and describe what those cases are.


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

1 Files Affected:

  • (modified) clang-tools-extra/clangd/index/dex/Dex.h (+2)
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;

@HighCommander4 HighCommander4 changed the title [clangd] Document the cases in which Dex::Files and IdxContents are populated [clangd] Add clarifying comment about when Dex::IdxContents is populated Dec 8, 2024
@HighCommander4 HighCommander4 merged commit 26760c7 into llvm:main Dec 9, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants