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

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