diff options
author | JmPotato <[email protected]> | 2020-08-10 07:02:40 +0100 |
---|---|---|
committer | JmPotato <[email protected]> | 2020-08-10 07:02:40 +0100 |
commit | 4d9c8821e5c328f29b77667c86cabb3689947fd2 (patch) | |
tree | 7f56674f5a4a4deabcbf7a6f76b4814cf345a3a6 /crates/ra_ide/src/display | |
parent | 7a03f05eac4ff1e9ca4ceeced54ce06892bd30b8 (diff) |
Show const body in short_label
Signed-off-by: JmPotato <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/display')
-rw-r--r-- | crates/ra_ide/src/display/short_label.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs index b5ff9fa2d..d8acb3be7 100644 --- a/crates/ra_ide/src/display/short_label.rs +++ b/crates/ra_ide/src/display/short_label.rs | |||
@@ -61,7 +61,15 @@ impl ShortLabel for ast::TypeAlias { | |||
61 | 61 | ||
62 | impl ShortLabel for ast::Const { | 62 | impl ShortLabel for ast::Const { |
63 | fn short_label(&self) -> Option<String> { | 63 | fn short_label(&self) -> Option<String> { |
64 | short_label_from_ty(self, self.ty(), "const ") | 64 | match short_label_from_ty(self, self.ty(), "const ") { |
65 | Some(buf) => { | ||
66 | let mut new_buf = buf; | ||
67 | let body = self.body().unwrap(); | ||
68 | format_to!(new_buf, " = {}", body.syntax()); | ||
69 | Some(new_buf) | ||
70 | } | ||
71 | None => None, | ||
72 | } | ||
65 | } | 73 | } |
66 | } | 74 | } |
67 | 75 | ||