diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-10 21:08:46 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-10 21:08:46 +0100 |
commit | 75e6c03883c4533b1134c806d166b72200b4837d (patch) | |
tree | 331fe1559a1c6fb293f9d68a4d5d5b08565c7afb /crates/ra_ide_api/src/display.rs | |
parent | cbafae6fa8e1292302d1ea0c04871fe24d174954 (diff) | |
parent | 656a0fa9f99298123d7dcee8c65a8a5ed7043bc4 (diff) |
Merge #1389
1389: Refactor hover to not depend on nav target r=matklad a=edwin0cheng
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/display.rs')
-rw-r--r-- | crates/ra_ide_api/src/display.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/ra_ide_api/src/display.rs b/crates/ra_ide_api/src/display.rs index f11af0a0b..882518838 100644 --- a/crates/ra_ide_api/src/display.rs +++ b/crates/ra_ide_api/src/display.rs | |||
@@ -13,6 +13,7 @@ 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; | 15 | pub(crate) use short_label::ShortLabel; |
16 | pub(crate) use navigation_target::{docs_from_symbol, description_from_symbol}; | ||
16 | 17 | ||
17 | pub(crate) fn function_label(node: &ast::FnDef) -> String { | 18 | pub(crate) fn function_label(node: &ast::FnDef) -> String { |
18 | FunctionSignature::from(node).to_string() | 19 | FunctionSignature::from(node).to_string() |
@@ -72,13 +73,3 @@ where | |||
72 | format!("```rust\n{}\n```", val.as_ref()) | 73 | format!("```rust\n{}\n```", val.as_ref()) |
73 | } | 74 | } |
74 | } | 75 | } |
75 | |||
76 | // FIXME: this should not really use navigation target. Rather, approximately | ||
77 | // resolved symbol should return a `DefId`. | ||
78 | pub(crate) fn doc_text_for(nav: NavigationTarget) -> Option<String> { | ||
79 | match (nav.description(), nav.docs()) { | ||
80 | (Some(desc), docs) => Some(rust_code_markup_with_doc(desc, docs)), | ||
81 | (None, Some(docs)) => Some(docs.to_string()), | ||
82 | _ => None, | ||
83 | } | ||
84 | } | ||