diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-10 10:55:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-10 10:55:58 +0100 |
commit | f3336509e52187a7a70a8043557a7317872e3a2f (patch) | |
tree | d9eb3f88c60add9d7bfc050c8fb52f2033e238cb /crates/ra_ide/src/hover.rs | |
parent | 7a03f05eac4ff1e9ca4ceeced54ce06892bd30b8 (diff) | |
parent | 958b91c1e8394129216d1b8378d726f937592d3f (diff) |
Merge #5698
5698: Display the value of a const on the hover r=jonas-schievink a=JmPotato
Signed-off-by: JmPotato <[email protected]>
Close #4051
To display the value of a const, I modified the implementation of `ShortLabel` for `ast::Const`.
Co-authored-by: JmPotato <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/hover.rs')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 9c7348898..f66f62bfb 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -590,16 +590,16 @@ fn main() { | |||
590 | #[test] | 590 | #[test] |
591 | fn hover_const_static() { | 591 | fn hover_const_static() { |
592 | check( | 592 | check( |
593 | r#"const foo<|>: u32 = 0;"#, | 593 | r#"const foo<|>: u32 = 123;"#, |
594 | expect![[r#" | 594 | expect![[r#" |
595 | *foo* | 595 | *foo* |
596 | ```rust | 596 | ```rust |
597 | const foo: u32 | 597 | const foo: u32 = 123 |
598 | ``` | 598 | ``` |
599 | "#]], | 599 | "#]], |
600 | ); | 600 | ); |
601 | check( | 601 | check( |
602 | r#"static foo<|>: u32 = 0;"#, | 602 | r#"static foo<|>: u32 = 456;"#, |
603 | expect![[r#" | 603 | expect![[r#" |
604 | *foo* | 604 | *foo* |
605 | ```rust | 605 | ```rust |
@@ -834,7 +834,7 @@ fn main() { | |||
834 | expect![[r#" | 834 | expect![[r#" |
835 | *C* | 835 | *C* |
836 | ```rust | 836 | ```rust |
837 | const C: u32 | 837 | const C: u32 = 1 |
838 | ``` | 838 | ``` |
839 | "#]], | 839 | "#]], |
840 | ) | 840 | ) |