[clang] [clang-tools-extra] [clangd] show lambda name instead of operator() in signature help (PR #101857)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 6 08:33:23 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);
----------------
zyn0217 wrote:
The name of the argument is confusing. We usually use "Name" for something like a DeclarationName rather than a Decl.
https://github.com/llvm/llvm-project/pull/101857
More information about the cfe-commits
mailing list