From 242be3631e6f2c581614b362ff1a572c7ffb8ff6 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 23 Dec 2019 17:53:35 +0200 Subject: Omit closure parameters --- crates/ra_ide/src/inlay_hints.rs | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index c5e406977..977aafc51 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -293,7 +293,7 @@ fn main() { } #[test] - fn closure_parameter() { + fn closure_parameters() { let (analysis, file_id) = single_file( r#" fn main() { @@ -301,6 +301,11 @@ fn main() { (0..2).for_each(|increment| { start += increment; }) + + let multiply = |a, b, c, d| a * b * c * d; + let _: i32 = multiply(1, 2, 3, 4); + + let return_42 = || 42; }"#, ); @@ -316,6 +321,36 @@ fn main() { kind: TypeHint, label: "i32", }, + InlayHint { + range: [114; 122), + kind: TypeHint, + label: "|…| -> i32", + }, + InlayHint { + range: [126; 127), + kind: TypeHint, + label: "i32", + }, + InlayHint { + range: [129; 130), + kind: TypeHint, + label: "i32", + }, + InlayHint { + range: [132; 133), + kind: TypeHint, + label: "i32", + }, + InlayHint { + range: [135; 136), + kind: TypeHint, + label: "i32", + }, + InlayHint { + range: [201; 210), + kind: TypeHint, + label: "|| -> i32", + }, ] "### ); -- cgit v1.2.3