diff options
Diffstat (limited to 'crates/ra_ide_api/src/display.rs')
-rw-r--r-- | crates/ra_ide_api/src/display.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/display.rs b/crates/ra_ide_api/src/display.rs index 1b06abf94..f11af0a0b 100644 --- a/crates/ra_ide_api/src/display.rs +++ b/crates/ra_ide_api/src/display.rs | |||
@@ -4,14 +4,16 @@ | |||
4 | mod function_signature; | 4 | mod function_signature; |
5 | mod navigation_target; | 5 | mod navigation_target; |
6 | mod structure; | 6 | mod structure; |
7 | mod short_label; | ||
7 | 8 | ||
8 | use crate::db::RootDatabase; | ||
9 | use ra_syntax::{ast::{self, AstNode, TypeParamsOwner}, SyntaxKind::{ATTR, COMMENT}}; | 9 | use ra_syntax::{ast::{self, AstNode, TypeParamsOwner}, SyntaxKind::{ATTR, COMMENT}}; |
10 | 10 | ||
11 | pub use navigation_target::NavigationTarget; | 11 | pub use navigation_target::NavigationTarget; |
12 | pub use structure::{StructureNode, file_structure}; | 12 | pub use structure::{StructureNode, file_structure}; |
13 | pub use function_signature::FunctionSignature; | 13 | pub use function_signature::FunctionSignature; |
14 | 14 | ||
15 | pub(crate) use short_label::ShortLabel; | ||
16 | |||
15 | pub(crate) fn function_label(node: &ast::FnDef) -> String { | 17 | pub(crate) fn function_label(node: &ast::FnDef) -> String { |
16 | FunctionSignature::from(node).to_string() | 18 | FunctionSignature::from(node).to_string() |
17 | } | 19 | } |
@@ -73,10 +75,10 @@ where | |||
73 | 75 | ||
74 | // FIXME: this should not really use navigation target. Rather, approximately | 76 | // FIXME: this should not really use navigation target. Rather, approximately |
75 | // resolved symbol should return a `DefId`. | 77 | // resolved symbol should return a `DefId`. |
76 | pub(crate) fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Option<String> { | 78 | pub(crate) fn doc_text_for(nav: NavigationTarget) -> Option<String> { |
77 | match (nav.description(db), nav.docs(db)) { | 79 | match (nav.description(), nav.docs()) { |
78 | (Some(desc), docs) => Some(rust_code_markup_with_doc(desc, docs)), | 80 | (Some(desc), docs) => Some(rust_code_markup_with_doc(desc, docs)), |
79 | (None, Some(docs)) => Some(docs), | 81 | (None, Some(docs)) => Some(docs.to_string()), |
80 | _ => None, | 82 | _ => None, |
81 | } | 83 | } |
82 | } | 84 | } |