aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-02 14:59:29 +0000
committerGitHub <[email protected]>2021-02-02 14:59:29 +0000
commitcc3112de1b6ef186716558232d9565c92bfa5f22 (patch)
treea0e1c3299f56e141b535f380a5da7a1ab30bf41e
parent96f9f0741f0b1ba345f35637cd5b21f5fad2a354 (diff)
parentcafaab8b9659d3b05f50b39c4731494b976b4357 (diff)
Merge #7520
7520: Show alias underlying type r=lnicola a=lumenian Closes #7511 Display underlying type in the tooltip: ```rust pub type SomeAlias = f64 ``` instead of: ```rust pub type SomeAlias ``` Co-authored-by: lumenian <[email protected]>
-rw-r--r--crates/ide/src/display/short_label.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide/src/display/short_label.rs b/crates/ide/src/display/short_label.rs
index 7ac050473..84b8883de 100644
--- a/crates/ide/src/display/short_label.rs
+++ b/crates/ide/src/display/short_label.rs
@@ -61,7 +61,11 @@ impl ShortLabel for ast::BlockExpr {
61 61
62impl ShortLabel for ast::TypeAlias { 62impl ShortLabel for ast::TypeAlias {
63 fn short_label(&self) -> Option<String> { 63 fn short_label(&self) -> Option<String> {
64 short_label_from_node(self, "type ") 64 let mut buf = short_label_from_node(self, "type ")?;
65 if let Some(type_ref) = self.ty() {
66 format_to!(buf, " = {}", type_ref.syntax());
67 }
68 Some(buf)
65 } 69 }
66} 70}
67 71