[clang-tools-extra] [clangd] Support go-to-definition on type hints. The protocol part (PR #85497)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 25 02:58:06 PDT 2024


================
@@ -367,7 +367,13 @@ class Checker {
     auto Hints = inlayHints(*AST, LineRange);
 
     for (const auto &Hint : Hints) {
-      vlog("  {0} {1} {2}", Hint.kind, Hint.position, Hint.label);
+      vlog("  {0} {1} [{2}]", Hint.kind, Hint.position, [&] {
+        return llvm::join(llvm::map_range(Hint.label,
+                                          [&](auto &L) {
+                                            return llvm::formatv("{{{0}}", L);
----------------
zyn0217 wrote:

I admit this is quite strange, but the current `formatv` implementation doesn't require escaping `}`s (but does require doubling `{{`s for a literal `{`). See https://reviews.llvm.org/D83888.

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


More information about the cfe-commits mailing list