Open kjeremy opened 5 years ago
Triage: this still happens.
This was a bug in Rust nightly itself at some point as well (https://github.com/rust-lang/rust/issues/92872). Since this comment type is shorthand for the #[doc="..."]
attribute, would it make sense to extract the string from that attribute instead? I assume we don't need any more information about how the comment was written for the help text on mouse hover.
Relevant code is here https://github.com/rust-lang/rust-analyzer/blob/9814d798411a4b1b258c710f86626bd1997e406f/crates/hir-def/src/attr.rs#L208-L233 and here (though this we might be able to skip out on) https://github.com/rust-lang/rust-analyzer/blob/9814d798411a4b1b258c710f86626bd1997e406f/crates/hir-def/src/attr.rs#L449-L492
In looking at
struct ClientCapabilities
of lsp-types defined asI noticed that hover shows the comment as
In looking at https://docs.rs/lsp-types/0.61.0/lsp_types/struct.ClientCapabilities.html we can see that it's rendered without the leading asterisk (or bullet in markdown).
My initial thought was that maybe we need to strip leading
*
off of block dock comments if present inDocCommentsOwner::doc_comment_text
but that could also end up stripping markdown. Maybe it should be done informat_docs
instead when we look for markdown... but by then we've lost all knowledge of the comment except for it's string contents.