aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-27 08:21:04 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-27 08:21:04 +0000
commitffcf61884245ca515f08f8685dc324b9db727e53 (patch)
tree99fe4420fe14a036323efe553e609268929df599 /crates/ra_ide_api/src
parent2577a65684a61fe8ef9159809ca5352c9ac2e61d (diff)
parenta89206795140209b816eb8e91fa3f1e1d6509269 (diff)
Merge #662
662: Preserve indentation in doc comments r=matklad a=kjeremy Fixes #502 Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/call_info.rs3
-rw-r--r--crates/ra_ide_api/src/hover.rs7
2 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs
index f203a6bf1..ee1e13799 100644
--- a/crates/ra_ide_api/src/call_info.rs
+++ b/crates/ra_ide_api/src/call_info.rs
@@ -126,8 +126,7 @@ impl CallInfo {
126 }; 126 };
127 127
128 let mut doc = None; 128 let mut doc = None;
129 let docs = node.doc_comment_text(); 129 if let Some(docs) = node.doc_comment_text() {
130 if !docs.is_empty() {
131 // Massage markdown 130 // Massage markdown
132 let mut processed_lines = Vec::new(); 131 let mut processed_lines = Vec::new();
133 let mut in_code_block = false; 132 let mut in_code_block = false;
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index ff9ae2d9c..f993a461c 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -100,12 +100,7 @@ impl NavigationTarget {
100 fn docs(&self, db: &RootDatabase) -> Option<String> { 100 fn docs(&self, db: &RootDatabase) -> Option<String> {
101 let node = self.node(db)?; 101 let node = self.node(db)?;
102 fn doc_comments<N: ast::DocCommentsOwner>(node: &N) -> Option<String> { 102 fn doc_comments<N: ast::DocCommentsOwner>(node: &N) -> Option<String> {
103 let comments = node.doc_comment_text(); 103 node.doc_comment_text()
104 if comments.is_empty() {
105 None
106 } else {
107 Some(comments)
108 }
109 } 104 }
110 105
111 visitor() 106 visitor()