[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 2 22:06:38 PDT 2024
https://github.com/HighCommander4 requested changes to this pull request.
Apologies for the slow response time, it's been quite a busy summer.
High-level feedback:
* Let's definitely split the default arguments part from the lambda captures part. Even if we decide we want both, it helps to have separate features in separate patches, so that e.g. if one causes a problem and needs to be reverted, it's easy to do that without affecting the other.
* I tend to agree with @zyn0217 that lambda captures might be a better fit for hovers than inlay hints. I think we could solve the problem targeting the capture-default token: if `SelectionTree` selects the `LambdaExpr`, massage the input position into the `SourceLocation`, compare it to `getCaptureDefaultLoc()`, and if so then take a different branch (in `Hover.cpp` code). (This doesn't prevent us from potentially also pursuing the idea of adding a "captures" section to the hover for the lambda variable.)
* For the default argument hints, what do you think about using `name: value` syntax instead of `name = value` syntax, for consistency with parameter hints?
https://github.com/llvm/llvm-project/pull/95712
More information about the cfe-commits
mailing list