Thread documentation through FnSignature and CompletionItem

This commit is contained in:
Jeremy Kolb 2019-01-21 21:42:37 -05:00
parent 5d110c0ee2
commit b77d780f0e
3 changed files with 15 additions and 1 deletions

View file

@ -2,7 +2,7 @@ mod scope;
use std::sync::Arc;
use ra_syntax::{TreeArc, ast::{self, NameOwner}};
use ra_syntax::{TreeArc, ast::{self, NameOwner, DocCommentsOwner}};
use crate::{
DefId, HirDatabase, Name, AsName, Function, FnSignature, Module,
@ -72,11 +72,15 @@ impl FnSignature {
} else {
TypeRef::unit()
};
let comments = node.doc_comment_text();
let sig = FnSignature {
name,
params,
ret_type,
has_self_param,
documentation: comments,
};
Arc::new(sig)
}