mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
hir: show const value in hover
This commit is contained in:
parent
add6cccd4c
commit
4fbc4b9356
3 changed files with 42 additions and 28 deletions
|
@ -503,16 +503,16 @@ fn hover_const_static() {
|
|||
check(
|
||||
r#"const foo$0: u32 = 123;"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
const foo: u32
|
||||
```
|
||||
"#]],
|
||||
```rust
|
||||
const foo: u32 = 123
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
check(
|
||||
r#"static foo$0: u32 = 456;"#,
|
||||
|
@ -788,16 +788,16 @@ fn main() {
|
|||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*C*
|
||||
*C*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
const C: u32
|
||||
```
|
||||
"#]],
|
||||
```rust
|
||||
const C: u32 = 1
|
||||
```
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -3176,20 +3176,20 @@ fn foo() {
|
|||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*FOO*
|
||||
*FOO*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
const FOO: usize
|
||||
```
|
||||
```rust
|
||||
const FOO: usize = 3
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
This is a doc
|
||||
"#]],
|
||||
This is a doc
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue