mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +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
|
@ -126,8 +126,7 @@ impl CallInfo {
|
|||
};
|
||||
|
||||
let mut doc = None;
|
||||
let docs = node.doc_comment_text();
|
||||
if !docs.is_empty() {
|
||||
if let Some(docs) = node.doc_comment_text() {
|
||||
// Massage markdown
|
||||
let mut processed_lines = Vec::new();
|
||||
let mut in_code_block = false;
|
||||
|
|
|
@ -100,12 +100,7 @@ impl NavigationTarget {
|
|||
fn docs(&self, db: &RootDatabase) -> Option<String> {
|
||||
let node = self.node(db)?;
|
||||
fn doc_comments<N: ast::DocCommentsOwner>(node: &N) -> Option<String> {
|
||||
let comments = node.doc_comment_text();
|
||||
if comments.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(comments)
|
||||
}
|
||||
node.doc_comment_text()
|
||||
}
|
||||
|
||||
visitor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue