rough, but appears to work

This commit is contained in:
Jeroen Vannevel 2022-02-15 14:39:22 +00:00
parent f0210f8a43
commit 73e49493bd
No known key found for this signature in database
GPG key ID: 78EF5F52F38C49BD
9 changed files with 81 additions and 15 deletions

View file

@ -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)
}

View file

@ -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(