[clang] [clang-tools-extra] [clangd] CodeCompletion surface param names if possible (PR #206716)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 08:48:40 PDT 2026


timon-ul wrote:

Deleted my intial comment on this PR because I think I can reflect my thoughts a lot better now that I have spent some time thinking about the problems. Essentially:

1. What is desired behaviour if we happen to have 2 declarations that do not agree on a parameter name. First? Last? Most common? Quite frankly I think just surfacing any seems like the best solution because 1) it is simple and 2) as long as we are consistent I do not think users will be unhappy
2. Should all names come from the same function? What if a declaration only names half of their parameters, should we then look for one that names all of them? Is it fine to just combine them? Seems like a lot of book keeping depending on the solution.
3. Lastly I cannot fix this directly in `FormatFunctionParameter` since it lacks the function declaration, but that function has a lot of callers so question is if this adjustment should be done in more callers of this function (and which are the important ones if so).

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


More information about the cfe-commits mailing list