aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2019-12-19 14:47:09 +0000
committerKirill Bulatov <[email protected]>2019-12-19 14:47:09 +0000
commitf407ac2be332e474b25a10aaf3be145c85f4b60b (patch)
tree4273dc7260cb8c7a9aad00f7fbe46d8163eb80b6 /crates
parent4ed78f80f4cc3cf32681fce6722293da6c8df76d (diff)
Omit default types for hover pop-ups
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide/src/hover.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 7d2f160e7..a227bf546 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -250,7 +250,7 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
250 } else { 250 } else {
251 return None; 251 return None;
252 }; 252 };
253 Some(ty.display(db).to_string()) 253 Some(ty.display_truncated(db, None).to_string())
254} 254}
255 255
256#[cfg(test)] 256#[cfg(test)]
@@ -425,7 +425,7 @@ mod tests {
425 } 425 }
426 426
427 #[test] 427 #[test]
428 fn hover_default_generic_type() { 428 fn hover_omits_default_generic_types() {
429 check_hover_result( 429 check_hover_result(
430 r#" 430 r#"
431//- /main.rs 431//- /main.rs
@@ -437,7 +437,7 @@ struct Test<K, T = u8> {
437fn main() { 437fn main() {
438 let zz<|> = Test { t: 23, k: 33 }; 438 let zz<|> = Test { t: 23, k: 33 };
439}"#, 439}"#,
440 &["Test<i32, u8>"], 440 &["Test<i32>"],
441 ); 441 );
442 } 442 }
443 443