diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp --- a/clang-tools-extra/clangd/AST.cpp +++ b/clang-tools-extra/clangd/AST.cpp @@ -223,8 +223,11 @@ // Come up with a presentation for an anonymous entity. if (isa(ND)) return "(anonymous namespace)"; - if (auto *Cls = llvm::dyn_cast(&ND)) + if (auto *Cls = llvm::dyn_cast(&ND)) { + if (Cls->isLambda()) + return "(lambda)"; return ("(anonymous " + Cls->getKindName() + ")").str(); + } if (isa(ND)) return "(anonymous enum)"; return "(anonymous)"; diff --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp b/clang-tools-extra/clangd/unittests/HoverTests.cpp --- a/clang-tools-extra/clangd/unittests/HoverTests.cpp +++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -362,8 +362,7 @@ } )cpp", [](HoverInfo &HI) { - // FIXME: Special case lambdas. - HI.Name = "(anonymous class)"; + HI.Name = "(lambda)"; HI.Kind = index::SymbolKind::Class; }}, // auto on template instantiation