From 7048cb5371f93788ee650c521995a85211f3ae46 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 17 Feb 2021 15:40:12 +0100 Subject: [PATCH] [clangd] IndexedFiles should include Fils from RefSlab and RelationSlab. This looks like an oversight. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D96845 --- clang-tools-extra/clangd/index/FileIndex.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp index f497f84..528630f 100644 --- a/clang-tools-extra/clangd/index/FileIndex.cpp +++ b/clang-tools-extra/clangd/index/FileIndex.cpp @@ -280,11 +280,14 @@ FileSymbols::buildIndex(IndexType Type, DuplicateHandling DuplicateHandle, } for (const auto &FileAndRefs : RefsSnapshot) { RefSlabs.push_back(FileAndRefs.second.Slab); + Files.insert(FileAndRefs.first()); if (FileAndRefs.second.CountReferences) MainFileRefs.push_back(RefSlabs.back().get()); } - for (const auto &FileAndRelations : RelationsSnapshot) + for (const auto &FileAndRelations : RelationsSnapshot) { + Files.insert(FileAndRelations.first()); RelationSlabs.push_back(FileAndRelations.second); + } if (Version) *Version = this->Version; -- 2.7.4