Make doc comments optional

This commit is contained in:
Jeremy Kolb 2019-01-26 10:35:23 -05:00
parent e9e0ea0398
commit a892067951
4 changed files with 27 additions and 19 deletions

View file

@ -120,8 +120,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;

View file

@ -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()