mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
fix: Omit generic defaults for types in hover messages
This commit is contained in:
parent
a07e406d06
commit
ec07bb98f8
4 changed files with 17 additions and 5 deletions
|
@ -444,7 +444,7 @@ fn find_std_module(famous_defs: &FamousDefs, name: &str) -> Option<hir::Module>
|
|||
|
||||
fn local(db: &RootDatabase, it: hir::Local) -> Option<Markup> {
|
||||
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) => {
|
||||
|
|
|
@ -607,10 +607,22 @@ fn main() {
|
|||
*zz*
|
||||
|
||||
```rust
|
||||
let zz: Test<i32, u8>
|
||||
let zz: Test<i32>
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
check_hover_range(
|
||||
r#"
|
||||
struct Test<K, T = u8> { k: K, t: T }
|
||||
|
||||
fn main() {
|
||||
let $0zz$0 = Test { t: 23u8, k: 33 };
|
||||
}"#,
|
||||
expect![[r#"
|
||||
```rust
|
||||
Test<i32, u8>
|
||||
```"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue