[PATCH] D138425: [clangd] Parameter hints for template specialization

v1nh1shungry via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 21 07:06:19 PST 2022


v1nh1shungry added a comment.

@sammccall Thank you for reviewing and giving suggestions!

I must admit I didn't use it for very long. But I do think this is helpful, at least for templates I'm unfamiliar with.

Yes, there is a common situation where people use a meaningless template parameter name, but I think the same for functions. I have seen many meaningless parameter names like `D`, `E` even in the LLVM codebase. Since we can tolerate these, why can't we bear the template parameter?

And yes, it is a serious problem this is unconfigurable.



================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:434
+        break;
+      if (auto Name = TP[I]->getName(); shouldHintName(TA[I], Name))
+        addInlayHint(TA[I].getSourceRange(), HintSide::Left,
----------------
sammccall wrote:
> we're missing some mangling of the name to remove the leading `_`
> (stripLeadingUnderscore?)
I don't think we should, since we don't do this for function parameters, are there any special reasons for us to do this for template parameters?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138425/new/

https://reviews.llvm.org/D138425



More information about the cfe-commits mailing list