diff options
author | Jeremy Kolb <[email protected]> | 2019-01-26 15:35:23 +0000 |
---|---|---|
committer | Jeremy Kolb <[email protected]> | 2019-01-26 15:35:23 +0000 |
commit | a89206795140209b816eb8e91fa3f1e1d6509269 (patch) | |
tree | 7706214d06fc902b5eb7e500815322ab6fa71420 /crates/ra_ide_api | |
parent | e9e0ea03986294f58c371d0329926709ae2f164c (diff) |
Make doc comments optional
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/call_info.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 7 |
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 3267fff96..7554c4aee 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide_api/src/call_info.rs | |||
@@ -120,8 +120,7 @@ impl CallInfo { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | let mut doc = None; | 122 | let mut doc = None; |
123 | let docs = node.doc_comment_text(); | 123 | if let Some(docs) = node.doc_comment_text() { |
124 | if !docs.is_empty() { | ||
125 | // Massage markdown | 124 | // Massage markdown |
126 | let mut processed_lines = Vec::new(); | 125 | let mut processed_lines = Vec::new(); |
127 | let mut in_code_block = false; | 126 | 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() |