[clang-tools-extra] d2135df - [clangd] Hover: Only drop UsingDecl instead of BaseUsingDecl

Tom Praschan via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 01:53:50 PDT 2022


Author: Tom Praschan
Date: 2022-10-26T12:51:36+02:00
New Revision: d2135df4b5fb7eb5ca9135318adc3e20536301c0

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

LOG: [clangd] Hover: Only drop UsingDecl instead of BaseUsingDecl

Since https://reviews.llvm.org/D135506 it's sufficient to only drop UsingDecl here

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

Added: 
    

Modified: 
    clang-tools-extra/clangd/Hover.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp
index b587d9c5f1e76..555cefd7d07fe 100644
--- a/clang-tools-extra/clangd/Hover.cpp
+++ b/clang-tools-extra/clangd/Hover.cpp
@@ -1017,7 +1017,7 @@ const NamedDecl *pickDeclToUse(llvm::ArrayRef<const NamedDecl *> Candidates) {
   // which isn't really useful for Hover. So use the other one,
   // which in this example would be the actual declaration of foo.
   if (Candidates.size() <= 2) {
-    if (llvm::isa<BaseUsingDecl>(Candidates.front()))
+    if (llvm::isa<UsingDecl>(Candidates.front()))
       return Candidates.back();
     return Candidates.front();
   }
@@ -1029,7 +1029,7 @@ const NamedDecl *pickDeclToUse(llvm::ArrayRef<const NamedDecl *> Candidates) {
   // we actually want to show the using declaration,
   // it's not clear which declaration to pick otherwise.
   auto BaseDecls = llvm::make_filter_range(Candidates, [](const NamedDecl *D) {
-    return llvm::isa<BaseUsingDecl>(D);
+    return llvm::isa<UsingDecl>(D);
   });
   if (std::distance(BaseDecls.begin(), BaseDecls.end()) == 1)
     return *BaseDecls.begin();


        


More information about the cfe-commits mailing list