[clang] [clang-tools-extra] [clangd] show lambda name instead of operator() in signature help (PR #101857)

Timothy Akintilo via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 8 19:10:17 PDT 2024


================
@@ -6292,11 +6298,16 @@ SemaCodeCompletion::ProduceCallSignatureHelp(Expr *Fn, ArrayRef<Expr *> Args,
         SmallVector<Expr *, 12> ArgExprs(1, NakedFn);
         ArgExprs.append(ArgsWithoutDependentTypes.begin(),
                         ArgsWithoutDependentTypes.end());
+        auto *const LambdaName =
+            DC->isLambda() ? cast<VarDecl>(NakedFn->getReferencedDeclOfCallee())
+                           : nullptr;
         SemaRef.AddFunctionCandidates(R.asUnresolvedSet(), ArgExprs,
                                       CandidateSet,
                                       /*ExplicitArgs=*/nullptr,
                                       /*SuppressUserConversions=*/false,
-                                      /*PartialOverloading=*/true);
+                                      /*PartialOverloading=*/true,
+                                      /*FirstArgumentIsBase=*/false,
+                                      /*LambdaName=*/LambdaName);
----------------
tilobyte wrote:

i see, renamed to `LambdaDecl`

https://github.com/llvm/llvm-project/pull/101857


More information about the cfe-commits mailing list