[PATCH] D79142: [clangd] Render doc-comment code spans with `backticks` in plaintext mode

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 03:01:43 PDT 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/FormattedString.cpp:365
+    llvm::StringRef Marker = "";
+    if (C.Preserve && C.Kind == Chunk::InlineCode)
+      Marker = "`";
----------------
should we rather use `renderInlineBlock` here ? because in presence of backticks inside the C.Contents it might become confusing e.g:

```
this is`foo(`x`)`
```

this would become:
```
this is `foo(``x``)`
```

and instead of keeping a marker maybe just:

```
if (Preserve && ..)
 OS << Sep << "`" << C.Contents << "`";
else
  OS << Sep << C.Contents;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79142





More information about the cfe-commits mailing list