]> git.lizzy.rs Git - rust.git/commitdiff
Show alias underlying type
authorlumenian <lumenian@gmail.com>
Tue, 2 Feb 2021 14:47:56 +0000 (17:47 +0300)
committerlumenian <lumenian@gmail.com>
Tue, 2 Feb 2021 14:47:56 +0000 (17:47 +0300)
crates/ide/src/display/short_label.rs

index 7ac050473f1bddf29b8531d0e7cb3d3863c8c5bc..84b8883de5fcf94ef8ced43cb89af941c829950b 100644 (file)
@@ -61,7 +61,11 @@ fn short_label(&self) -> Option<String> {
 
 impl ShortLabel for ast::TypeAlias {
     fn short_label(&self) -> Option<String> {
-        short_label_from_node(self, "type ")
+        let mut buf = short_label_from_node(self, "type ")?;
+        if let Some(type_ref) = self.ty() {
+            format_to!(buf, " = {}", type_ref.syntax());
+        }
+        Some(buf)
     }
 }