File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,15 @@ impl ShortLabel for ast::TypeAlias {
6161
6262impl ShortLabel for ast:: Const {
6363 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+ }
6573 }
6674}
6775
Original file line number Diff line number Diff line change @@ -590,16 +590,16 @@ fn main() {
590590 #[ test]
591591 fn hover_const_static ( ) {
592592 check (
593- r#"const foo<|>: u32 = 0 ;"# ,
593+ r#"const foo<|>: u32 = 123 ;"# ,
594594 expect ! [ [ r#"
595595 *foo*
596596 ```rust
597- const foo: u32
597+ const foo: u32 = 123
598598 ```
599599 "# ] ] ,
600600 ) ;
601601 check (
602- r#"static foo<|>: u32 = 0 ;"# ,
602+ r#"static foo<|>: u32 = 456 ;"# ,
603603 expect ! [ [ r#"
604604 *foo*
605605 ```rust
@@ -834,7 +834,7 @@ fn main() {
834834 expect ! [ [ r#"
835835 *C*
836836 ```rust
837- const C: u32
837+ const C: u32 = 1
838838 ```
839839 "# ] ] ,
840840 )
You can’t perform that action at this time.
0 commit comments