From e7c47eb7f599da93f64c5a8d4f8e83ddd3fa1baa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Jul 2020 10:19:37 +0200 Subject: Streamline --- crates/ra_ide/src/display.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'crates/ra_ide/src/display.rs') diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs index 827c094e7..70d2a2dd1 100644 --- a/crates/ra_ide/src/display.rs +++ b/crates/ra_ide/src/display.rs @@ -6,13 +6,10 @@ mod navigation_target; mod structure; mod short_label; -use std::fmt::Display; - use ra_syntax::{ ast::{self, AstNode, AttrsOwner, NameOwner, TypeParamsOwner}, SyntaxKind::{ATTR, COMMENT}, }; -use stdx::format_to; pub use function_signature::FunctionSignature; pub use navigation_target::NavigationTarget; @@ -69,29 +66,3 @@ pub(crate) fn macro_label(node: &ast::MacroCall) -> String { let vis = if node.has_atom_attr("macro_export") { "#[macro_export]\n" } else { "" }; format!("{}macro_rules! {}", vis, name) } - -pub(crate) fn rust_code_markup(code: &impl Display) -> String { - rust_code_markup_with_doc(code, None, None) -} - -pub(crate) fn rust_code_markup_with_doc( - code: &impl Display, - doc: Option<&str>, - mod_path: Option<&str>, -) -> String { - let mut buf = String::new(); - - if let Some(mod_path) = mod_path { - if !mod_path.is_empty() { - format_to!(buf, "```rust\n{}\n```\n\n", mod_path); - } - } - format_to!(buf, "```rust\n{}\n```", code); - - if let Some(doc) = doc { - format_to!(buf, "\n___"); - format_to!(buf, "\n\n{}", doc); - } - - buf -} -- cgit v1.2.3