diff options
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r-- | crates/ide_completion/src/completions/lifetime.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ide_completion/src/completions/lifetime.rs b/crates/ide_completion/src/completions/lifetime.rs index 07be28e9c..628c1fb9b 100644 --- a/crates/ide_completion/src/completions/lifetime.rs +++ b/crates/ide_completion/src/completions/lifetime.rs | |||
@@ -253,4 +253,33 @@ fn foo() { | |||
253 | "#]], | 253 | "#]], |
254 | ); | 254 | ); |
255 | } | 255 | } |
256 | |||
257 | #[test] | ||
258 | fn complete_label_in_while_cond() { | ||
259 | check( | ||
260 | r#" | ||
261 | fn foo() { | ||
262 | 'outer: while { 'inner: loop { break '$0 } } {} | ||
263 | } | ||
264 | "#, | ||
265 | expect![[r#" | ||
266 | lb 'inner | ||
267 | lb 'outer | ||
268 | "#]], | ||
269 | ); | ||
270 | } | ||
271 | |||
272 | #[test] | ||
273 | fn complete_label_in_for_iterable() { | ||
274 | check( | ||
275 | r#" | ||
276 | fn foo() { | ||
277 | 'outer: for _ in [{ 'inner: loop { break '$0 } }] {} | ||
278 | } | ||
279 | "#, | ||
280 | expect![[r#" | ||
281 | lb 'inner | ||
282 | "#]], | ||
283 | ); | ||
284 | } | ||
256 | } | 285 | } |