[PATCH] D116713: [clangd] Support configuration of inlay hints.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 6 23:53:28 PST 2022


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:51
   bool VisitCXXConstructExpr(CXXConstructExpr *E) {
+    if (!Cfg.InlayHints.DeducedTypes)
+      return true;
----------------
this should be `!Cfg.InlayHints.ParameterNames`.

What do you think the idea of moving guards deeper (`processCall` and `addTypeHint`)? The code seems clearer and we don't have to add them in all Visit* implementation,  this means that we pay cost of running some necessary code, but I think it is trivial and probably worthy. 


================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:69
   bool VisitCallExpr(CallExpr *E) {
+    if (!Cfg.InlayHints.DeducedTypes)
+      return true;
----------------
`!Cfg.InlayHints.ParameterNames`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116713



More information about the cfe-commits mailing list