aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model_api.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs
index 333d117f1..3ff07bd60 100644
--- a/crates/ra_hir/src/code_model_api.rs
+++ b/crates/ra_hir/src/code_model_api.rs
@@ -394,6 +394,12 @@ impl Const {
394 } 394 }
395} 395}
396 396
397impl Docs for Const {
398 fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
399 docs_from_ast(&*self.source(db).1)
400 }
401}
402
397#[derive(Debug, Clone, PartialEq, Eq, Hash)] 403#[derive(Debug, Clone, PartialEq, Eq, Hash)]
398pub struct Static { 404pub struct Static {
399 pub(crate) def_id: DefId, 405 pub(crate) def_id: DefId,
@@ -409,6 +415,12 @@ impl Static {
409 } 415 }
410} 416}
411 417
418impl Docs for Static {
419 fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
420 docs_from_ast(&*self.source(db).1)
421 }
422}
423
412#[derive(Debug, Clone, PartialEq, Eq, Hash)] 424#[derive(Debug, Clone, PartialEq, Eq, Hash)]
413pub struct Trait { 425pub struct Trait {
414 pub(crate) def_id: DefId, 426 pub(crate) def_id: DefId,
@@ -428,6 +440,12 @@ impl Trait {
428 } 440 }
429} 441}
430 442
443impl Docs for Trait {
444 fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
445 docs_from_ast(&*self.source(db).1)
446 }
447}
448
431#[derive(Debug, Clone, PartialEq, Eq, Hash)] 449#[derive(Debug, Clone, PartialEq, Eq, Hash)]
432pub struct Type { 450pub struct Type {
433 pub(crate) def_id: DefId, 451 pub(crate) def_id: DefId,
@@ -446,3 +464,9 @@ impl Type {
446 db.generic_params(self.def_id) 464 db.generic_params(self.def_id)
447 } 465 }
448} 466}
467
468impl Docs for Type {
469 fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
470 docs_from_ast(&*self.source(db).1)
471 }
472}