mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Merge #662
662: Preserve indentation in doc comments r=matklad a=kjeremy Fixes #502 Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
This commit is contained in:
commit
ffcf618842
4 changed files with 65 additions and 27 deletions
|
@ -27,10 +27,5 @@ pub trait Docs {
|
|||
}
|
||||
|
||||
pub(crate) fn docs_from_ast(node: &impl ast::DocCommentsOwner) -> Option<Documentation> {
|
||||
let comments = node.doc_comment_text();
|
||||
if comments.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(Documentation::new(&comments))
|
||||
}
|
||||
node.doc_comment_text().map(|it| Documentation::new(&it))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue