From 64957acb5f359763395a54e314d1f5d5cfc6ccf3 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 21 Mar 2021 01:10:59 +0100 Subject: Fix incorrect scoping in while expressions --- crates/ide_completion/src/context.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'crates/ide_completion/src/context.rs') diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs index 6cb7e5264..67e2d6f6c 100644 --- a/crates/ide_completion/src/context.rs +++ b/crates/ide_completion/src/context.rs @@ -475,19 +475,17 @@ impl<'a> CompletionContext<'a> { return; } - if parent.kind() != syntax::SyntaxKind::LABEL { - match_ast! { - match parent { - ast::LifetimeParam(_it) => { - self.lifetime_allowed = true; - self.lifetime_param_syntax = - self.sema.find_node_at_offset_with_macros(original_file, offset); - }, - ast::BreakExpr(_it) => self.is_label_ref = true, - ast::ContinueExpr(_it) => self.is_label_ref = true, - ast::Label(_it) => (), - _ => self.lifetime_allowed = true, - } + match_ast! { + match parent { + ast::LifetimeParam(_it) => { + self.lifetime_allowed = true; + self.lifetime_param_syntax = + self.sema.find_node_at_offset_with_macros(original_file, offset); + }, + ast::BreakExpr(_it) => self.is_label_ref = true, + ast::ContinueExpr(_it) => self.is_label_ref = true, + ast::Label(_it) => (), + _ => self.lifetime_allowed = true, } } } -- cgit v1.2.3