================
@@ -118,8 +138,8 @@ class Document {
   BulletList &addBulletList();
 
   /// Doesn't contain any trailing newlines.
-  /// We try to make the markdown human-readable, e.g. avoid extra escaping.
-  /// At least one client (coc.nvim) displays the markdown verbatim!
----------------
tcottin wrote:

Thanks for the reply. I did not think about it this way.
The issue that you dont want your documentation to be rendered as markdown by 
the client seems different from the coc.nvim issue.

The old behaviour was to treat all documentation as non-markdown independent of 
client render capabilities.
Hence to even make this work for clients requesting markdown as the MarkupKind, 
markdown syntax in the documentation string was escaped.
This way, only information which was added by clangd (like the declaration of 
the hover point) is rendered in markdown, if the client supports it.

With this change, the documentation is taken as-is which leads to rendered 
markdown on clients requesting markdown.

If viewed this way, the escaping behaviour is actually not a client decision 
and independent of the clients capabilities.
Therefore we could introduce a server option to control the escaping behaviour 
I think.

Just for reference: [doxygen supports markdown since 
1.8.0](https://www.doxygen.nl/manual/markdown.html). There is a 
[MARKDOWN_SUPPORT configuration 
option](https://www.doxygen.nl/manual/config.html#cfg_markdown_support) which 
is set to `YES` by default.
This means in a doxygen comment, all markdown syntax will be rendered as 
markdown in the final documentation by default.
Hence the default doxygen behaviour is the same as the behaviour proposed with 
this change.

I would argue that for the markdown rendering behaviour of clangd it should be 
the same:
the proposed behaviour should be the default but could be switched off with a 
server option.

https://github.com/llvm/llvm-project/pull/140498
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to