mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add a bunch of new documentation to completions
This commit is contained in:
parent
576625f0a1
commit
7b548de634
3 changed files with 54 additions and 20 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue