Add a bunch of new documentation to completions

This commit is contained in:
Jeremy A. Kolb 2019-01-23 17:46:14 -05:00
parent 576625f0a1
commit 7b548de634
3 changed files with 54 additions and 20 deletions

View file

@ -394,6 +394,12 @@ impl Const {
}
}
impl Docs for Const {
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
docs_from_ast(&*self.source(db).1)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Static {
pub(crate) def_id: DefId,
@ -409,6 +415,12 @@ impl Static {
}
}
impl Docs for Static {
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
docs_from_ast(&*self.source(db).1)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Trait {
pub(crate) def_id: DefId,
@ -428,6 +440,12 @@ impl Trait {
}
}
impl Docs for Trait {
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
docs_from_ast(&*self.source(db).1)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Type {
pub(crate) def_id: DefId,
@ -446,3 +464,9 @@ impl Type {
db.generic_params(self.def_id)
}
}
impl Docs for Type {
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
docs_from_ast(&*self.source(db).1)
}
}