diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index e2424dd6d9..e2b4e92575 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -639,7 +639,7 @@ impl HirDisplay for Ty { if let Some(sig) = sig { if sig.params().is_empty() { write!(f, "||")?; - } else if f.omit_verbose_types() { + } else if f.should_truncate() { write!(f, "|{}|", TYPE_HINT_TRUNCATION)?; } else { write!(f, "|")?; diff --git a/crates/ide/src/hover/render.rs b/crates/ide/src/hover/render.rs index e872d9b1fb..dd4a961d31 100644 --- a/crates/ide/src/hover/render.rs +++ b/crates/ide/src/hover/render.rs @@ -444,7 +444,7 @@ fn find_std_module(famous_defs: &FamousDefs, name: &str) -> Option fn local(db: &RootDatabase, it: hir::Local) -> Option { let ty = it.ty(db); - let ty = ty.display(db); + let ty = ty.display_truncated(db, None); let is_mut = if it.is_mut(db) { "mut " } else { "" }; let desc = match it.source(db).value { Either::Left(ident) => { diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs index c745f86d84..5718b9097c 100644 --- a/crates/ide/src/hover/tests.rs +++ b/crates/ide/src/hover/tests.rs @@ -607,10 +607,22 @@ fn main() { *zz* ```rust - let zz: Test + let zz: Test ``` "#]], ); + check_hover_range( + r#" +struct Test { k: K, t: T } + +fn main() { + let $0zz$0 = Test { t: 23u8, k: 33 }; +}"#, + expect![[r#" + ```rust + Test + ```"#]], + ); } #[test] diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 94af017d64..985d3a4ecc 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -1443,14 +1443,14 @@ fn main() { //^^^^^^^^^ i32 let multiply = - //^^^^^^^^ |…| -> i32 + //^^^^^^^^ |i32, i32| -> i32 | a, b| a * b //^ i32 ^ i32 ; let _: i32 = multiply(1, 2); let multiply_ref = &multiply; - //^^^^^^^^^^^^ &|…| -> i32 + //^^^^^^^^^^^^ &|i32, i32| -> i32 let return_42 = || 42; //^^^^^^^^^ || -> i32