Author: Haojian Wu
Date: 2021-02-17T15:41:09+01:00
New Revision: 7048cb5371f93788ee650c521995a85211f3ae46

URL: 
https://github.com/llvm/llvm-project/commit/7048cb5371f93788ee650c521995a85211f3ae46
DIFF: 
https://github.com/llvm/llvm-project/commit/7048cb5371f93788ee650c521995a85211f3ae46.diff

LOG: [clangd] IndexedFiles should include Fils from RefSlab and RelationSlab.

This looks like an oversight.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D96845

Added: 
    

Modified: 
    clang-tools-extra/clangd/index/FileIndex.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/index/FileIndex.cpp 
b/clang-tools-extra/clangd/index/FileIndex.cpp
index f497f845b42d..528630f9232a 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;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to