diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-23 12:09:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-23 12:09:24 +0100 |
commit | 88c292b1c29d824dcb9726a1ea146fe5b9c97028 (patch) | |
tree | 8b16648c3081bb1224d77b6e81d2764b7dc35a10 /crates/ra_ide/src/display.rs | |
parent | d4daca9f02ec46be1beef79e9ed647a3a24e2434 (diff) | |
parent | 6197a960dffa4c7e8c2f60168a476e5f39ba50aa (diff) |
Merge #4559
4559: Module name on hover shows another newline after it r=matklad a=Arthamys
This changes the display of hover information to add a newline between the module path of the item and the signature of the item, as suggested in #3813
**Before**
![before_3813](https://user-images.githubusercontent.com/11710698/82609224-5d517d80-9bbc-11ea-9a08-0a1558409c6b.png)
**After**
![after_3813](https://user-images.githubusercontent.com/11710698/82609208-562a6f80-9bbc-11ea-8cb6-4430269c5800.png)
Co-authored-by: Galilée 'Bill' Enguehard <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/display.rs')
-rw-r--r-- | crates/ra_ide/src/display.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs index 722092de9..8bb312156 100644 --- a/crates/ra_ide/src/display.rs +++ b/crates/ra_ide/src/display.rs | |||
@@ -79,14 +79,14 @@ pub(crate) fn rust_code_markup_with_doc( | |||
79 | doc: Option<&str>, | 79 | doc: Option<&str>, |
80 | mod_path: Option<&str>, | 80 | mod_path: Option<&str>, |
81 | ) -> String { | 81 | ) -> String { |
82 | let mut buf = "```rust\n".to_owned(); | 82 | let mut buf = String::new(); |
83 | 83 | ||
84 | if let Some(mod_path) = mod_path { | 84 | if let Some(mod_path) = mod_path { |
85 | if !mod_path.is_empty() { | 85 | if !mod_path.is_empty() { |
86 | format_to!(buf, "{}\n", mod_path); | 86 | format_to!(buf, "{}\n___\n\n", mod_path); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | format_to!(buf, "{}\n```", code); | 89 | format_to!(buf, "```rust\n{}\n```", code); |
90 | 90 | ||
91 | if let Some(doc) = doc { | 91 | if let Some(doc) = doc { |
92 | format_to!(buf, "\n\n{}", doc); | 92 | format_to!(buf, "\n\n{}", doc); |