[PATCH] D77456: [clangd] Parse `foo` in documentation comments and render as code.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 4 03:02:58 PDT 2020


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!

Regarding spaces between code and text chunks, are you suggesting we should print:

  Tests primality of`p`

if so, i do believe having a space before the backtick vs not having it is two totally different rendering decisions. And I think the former is more common, why do you think we should not put that space?
I suppose we can modify the spacing logic for markdown to only put a separator between same chunk types, but I don't think that'll look any better especially in plugins like coc.nvim.



================
Comment at: clang-tools-extra/clangd/Hover.cpp:840
+void parseDocumentationLine(llvm::StringRef Line, markup::Paragraph &Out) {
+  // Probably this is appendText(Input), but scan for something interesting.
+  for (unsigned I = 0; I < Line.size(); ++I) {
----------------
nit: s/Input/Line/


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77456





More information about the cfe-commits mailing list