aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/display.rs')
-rw-r--r--crates/ra_ide_api/src/display.rs10
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 @@
4mod function_signature; 4mod function_signature;
5mod navigation_target; 5mod navigation_target;
6mod structure; 6mod structure;
7mod short_label;
7 8
8use crate::db::RootDatabase;
9use ra_syntax::{ast::{self, AstNode, TypeParamsOwner}, SyntaxKind::{ATTR, COMMENT}}; 9use ra_syntax::{ast::{self, AstNode, TypeParamsOwner}, SyntaxKind::{ATTR, COMMENT}};
10 10
11pub use navigation_target::NavigationTarget; 11pub use navigation_target::NavigationTarget;
12pub use structure::{StructureNode, file_structure}; 12pub use structure::{StructureNode, file_structure};
13pub use function_signature::FunctionSignature; 13pub use function_signature::FunctionSignature;
14 14
15pub(crate) use short_label::ShortLabel;
16
15pub(crate) fn function_label(node: &ast::FnDef) -> String { 17pub(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`.
76pub(crate) fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Option<String> { 78pub(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}