diff options
author | Kirill Bulatov <[email protected]> | 2019-12-23 15:53:35 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2019-12-23 16:30:25 +0000 |
commit | 242be3631e6f2c581614b362ff1a572c7ffb8ff6 (patch) | |
tree | b5f8adb7377db39fec7b39153bde2bc3f4268560 /crates/ra_ide/src | |
parent | 527027d32e674850e62c5348933ec68d8d3ddf60 (diff) |
Omit closure parameters
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/inlay_hints.rs | 37 |
1 files changed, 36 insertions, 1 deletions
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() { | |||
293 | } | 293 | } |
294 | 294 | ||
295 | #[test] | 295 | #[test] |
296 | fn closure_parameter() { | 296 | fn closure_parameters() { |
297 | let (analysis, file_id) = single_file( | 297 | let (analysis, file_id) = single_file( |
298 | r#" | 298 | r#" |
299 | fn main() { | 299 | fn main() { |
@@ -301,6 +301,11 @@ fn main() { | |||
301 | (0..2).for_each(|increment| { | 301 | (0..2).for_each(|increment| { |
302 | start += increment; | 302 | start += increment; |
303 | }) | 303 | }) |
304 | |||
305 | let multiply = |a, b, c, d| a * b * c * d; | ||
306 | let _: i32 = multiply(1, 2, 3, 4); | ||
307 | |||
308 | let return_42 = || 42; | ||
304 | }"#, | 309 | }"#, |
305 | ); | 310 | ); |
306 | 311 | ||
@@ -316,6 +321,36 @@ fn main() { | |||
316 | kind: TypeHint, | 321 | kind: TypeHint, |
317 | label: "i32", | 322 | label: "i32", |
318 | }, | 323 | }, |
324 | InlayHint { | ||
325 | range: [114; 122), | ||
326 | kind: TypeHint, | ||
327 | label: "|…| -> i32", | ||
328 | }, | ||
329 | InlayHint { | ||
330 | range: [126; 127), | ||
331 | kind: TypeHint, | ||
332 | label: "i32", | ||
333 | }, | ||
334 | InlayHint { | ||
335 | range: [129; 130), | ||
336 | kind: TypeHint, | ||
337 | label: "i32", | ||
338 | }, | ||
339 | InlayHint { | ||
340 | range: [132; 133), | ||
341 | kind: TypeHint, | ||
342 | label: "i32", | ||
343 | }, | ||
344 | InlayHint { | ||
345 | range: [135; 136), | ||
346 | kind: TypeHint, | ||
347 | label: "i32", | ||
348 | }, | ||
349 | InlayHint { | ||
350 | range: [201; 210), | ||
351 | kind: TypeHint, | ||
352 | label: "|| -> i32", | ||
353 | }, | ||
319 | ] | 354 | ] |
320 | "### | 355 | "### |
321 | ); | 356 | ); |