Skip to content

Commit b9b342f

Browse files
committed
Add tests of showing function qualifiers
1 parent 414d8d9 commit b9b342f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

crates/ra_ide/src/hover.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,4 +844,29 @@ fn func(foo: i32) { if true { <|>foo; }; }
844844
&["fn foo()\n```\n\n<- `\u{3000}` here"],
845845
);
846846
}
847+
848+
#[test]
849+
fn test_hover_function_show_qualifiers() {
850+
check_hover_result(
851+
"
852+
//- /lib.rs
853+
async fn foo<|>() {}
854+
",
855+
&["async fn foo()"],
856+
);
857+
check_hover_result(
858+
"
859+
//- /lib.rs
860+
pub const unsafe fn foo<|>() {}
861+
",
862+
&["pub const unsafe fn foo()"],
863+
);
864+
check_hover_result(
865+
r#"
866+
//- /lib.rs
867+
pub(crate) async unsafe extern "C" fn foo<|>() {}
868+
"#,
869+
&[r#"pub(crate) async unsafe extern "C" fn foo()"#],
870+
);
871+
}
847872
}

0 commit comments

Comments
 (0)