mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Split out some hover functions
This commit is contained in:
parent
c5b1e3f2ae
commit
a542bd46bf
3 changed files with 237 additions and 87 deletions
|
@ -5592,3 +5592,93 @@ fn main() {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_underscore_pat() {
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
let _$0 = 0;
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*_*
|
||||
```rust
|
||||
i32
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
let (_$0,) = (0,);
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*_*
|
||||
```rust
|
||||
i32
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_underscore_expr() {
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
_$0 = 0;
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*_*
|
||||
```rust
|
||||
i32
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
(_$0,) = (0,);
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*_*
|
||||
```rust
|
||||
i32
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_underscore_type() {
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
let x: _$0 = 0;
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*_*
|
||||
```rust
|
||||
{unknown}
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
let x: (_$0,) = (0,);
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*_*
|
||||
```rust
|
||||
{unknown}
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue