diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-02 14:59:29 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-02 14:59:29 +0000 |
commit | cc3112de1b6ef186716558232d9565c92bfa5f22 (patch) | |
tree | a0e1c3299f56e141b535f380a5da7a1ab30bf41e /crates | |
parent | 96f9f0741f0b1ba345f35637cd5b21f5fad2a354 (diff) | |
parent | cafaab8b9659d3b05f50b39c4731494b976b4357 (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]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ide/src/display/short_label.rs | 6 |
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 | ||
62 | impl ShortLabel for ast::TypeAlias { | 62 | impl 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 | ||