about summary refs log tree commit diff
path: root/crates/ide/src/hover/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/hover/render.rs')
-rw-r--r--crates/ide/src/hover/render.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/crates/ide/src/hover/render.rs b/crates/ide/src/hover/render.rs
index a33a6ee1816..59423396cec 100644
--- a/crates/ide/src/hover/render.rs
+++ b/crates/ide/src/hover/render.rs
@@ -3,12 +3,13 @@ use std::fmt::Display;
 
 use either::Either;
 use hir::{
-    Adt, AsAssocItem, AttributeTemplate, CaptureKind, HasAttrs, HasSource, HirDisplay, Layout,
-    LayoutError, Semantics, TypeInfo,
+    Adt, AsAssocItem, AttributeTemplate, CaptureKind, HasSource, HirDisplay, Layout, LayoutError,
+    Semantics, TypeInfo,
 };
 use ide_db::{
     base_db::SourceDatabase,
     defs::Definition,
+    documentation::{Documentation, HasDocs},
     famous_defs::FamousDefs,
     generated::lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES},
     syntax_helpers::insert_whitespace_into_node,
@@ -616,9 +617,9 @@ fn render_builtin_attr(db: &RootDatabase, attr: hir::BuiltinAttr) -> Option<Mark
     markup(Some(docs.replace('*', "\\*")), desc, None)
 }
 
-fn label_and_docs<D>(db: &RootDatabase, def: D) -> (String, Option<hir::Documentation>)
+fn label_and_docs<D>(db: &RootDatabase, def: D) -> (String, Option<Documentation>)
 where
-    D: HasAttrs + HirDisplay,
+    D: HasDocs + HirDisplay,
 {
     let label = def.display(db).to_string();
     let docs = def.docs(db);
@@ -631,9 +632,9 @@ fn label_and_layout_info_and_docs<D, E, E2>(
     config: &HoverConfig,
     layout_extractor: E,
     layout_offset_extractor: E2,
-) -> (String, Option<hir::Documentation>)
+) -> (String, Option<Documentation>)
 where
-    D: HasAttrs + HirDisplay,
+    D: HasDocs + HirDisplay,
     E: Fn(&D) -> Result<Layout, LayoutError>,
     E2: Fn(&Layout) -> Option<u64>,
 {
@@ -657,9 +658,9 @@ fn label_value_and_layout_info_and_docs<D, E, E2, E3, V>(
     value_extractor: E,
     layout_extractor: E2,
     layout_tag_extractor: E3,
-) -> (String, Option<hir::Documentation>)
+) -> (String, Option<Documentation>)
 where
-    D: HasAttrs + HirDisplay,
+    D: HasDocs + HirDisplay,
     E: Fn(&D) -> Option<V>,
     E2: Fn(&D) -> Result<Layout, LayoutError>,
     E3: Fn(&Layout) -> Option<usize>,
@@ -686,9 +687,9 @@ fn label_value_and_docs<D, E, V>(
     db: &RootDatabase,
     def: D,
     value_extractor: E,
-) -> (String, Option<hir::Documentation>)
+) -> (String, Option<Documentation>)
 where
-    D: HasAttrs + HirDisplay,
+    D: HasDocs + HirDisplay,
     E: Fn(&D) -> Option<V>,
     V: Display,
 {