mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Ensure hover shows full type declaration
This commit is contained in:
@@ -424,6 +424,23 @@ fn hover_const_static() {
|
||||
);
|
||||
}
|
||||
|
||||
#[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]
|
||||
fn hover_some() {
|
||||
let (analysis, position) = single_file_with_position(
|
||||
|
||||
@@ -164,7 +164,7 @@ fn default_generic_types_disabled() {
|
||||
let (analysis, file_id) = single_file(
|
||||
r#"
|
||||
struct Test<K, T = u8> {
|
||||
k: K,
|
||||
k: K,
|
||||
t: T,
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ fn main() {
|
||||
assert_debug_snapshot!(analysis.inlay_hints(file_id, None, false).unwrap(), @r###"
|
||||
[
|
||||
InlayHint {
|
||||
range: [65; 67),
|
||||
range: [69; 71),
|
||||
kind: TypeHint,
|
||||
label: "Test<i32>",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user