mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
rough, but appears to work
This commit is contained in:
parent
f0210f8a43
commit
73e49493bd
9 changed files with 81 additions and 15 deletions
|
@ -411,6 +411,7 @@ where
|
|||
D: HasAttrs + HirDisplay,
|
||||
{
|
||||
let label = def.display(db).to_string();
|
||||
println!("label: {label:?}");
|
||||
let docs = def.attrs(db).docs();
|
||||
(label, docs)
|
||||
}
|
||||
|
|
|
@ -1310,6 +1310,42 @@ fn test_hover_function_show_qualifiers() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_function_show_types() {
|
||||
check(
|
||||
r#"fn foo$0(a: i32, b:i32) -> i32 { 0 }"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
fn foo(a: i32, b: i32) -> i32
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_function_pointer_show_types() {
|
||||
check(
|
||||
r#"type foo$0 = fn(a: i32, b: i32) -> i32;"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
type foo = fn(a: i32, b: i32) -> i32
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_trait_show_qualifiers() {
|
||||
check_actions(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue