Ensure hover shows full type declaration

This commit is contained in:
Kirill Bulatov 2019-12-19 12:45:00 +02:00
parent 14c167a9f6
commit 3969c7c853
2 changed files with 19 additions and 2 deletions

View file

@ -424,6 +424,23 @@ mod tests {
); );
} }
#[test]
fn hover_default_generic_type() {
check_hover_result(
r#"
//- /main.rs
struct Test<K, T = u8> {
k: K,
t: T,
}
fn main() {
let zz<|> = Test { t: 23, k: 33 };
}"#,
&["Test<i32, u8>"],
);
}
#[test] #[test]
fn hover_some() { fn hover_some() {
let (analysis, position) = single_file_with_position( let (analysis, position) = single_file_with_position(

View file

@ -176,7 +176,7 @@ fn main() {
assert_debug_snapshot!(analysis.inlay_hints(file_id, None, false).unwrap(), @r###" assert_debug_snapshot!(analysis.inlay_hints(file_id, None, false).unwrap(), @r###"
[ [
InlayHint { InlayHint {
range: [65; 67), range: [69; 71),
kind: TypeHint, kind: TypeHint,
label: "Test<i32>", label: "Test<i32>",
}, },