aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/context.rs')
-rw-r--r--crates/ide_completion/src/context.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs
index 3885db702..907ffdc7a 100644
--- a/crates/ide_completion/src/context.rs
+++ b/crates/ide_completion/src/context.rs
@@ -311,13 +311,16 @@ impl<'a> CompletionContext<'a> {
311 } 311 }
312 312
313 pub(crate) fn is_path_disallowed(&self) -> bool { 313 pub(crate) fn is_path_disallowed(&self) -> bool {
314 matches!( 314 self.attribute_under_caret.is_some()
315 self.completion_location, 315 || self.previous_token_is(T![unsafe])
316 Some(ImmediateLocation::Attribute(_)) 316 || self.has_visibility_prev_sibling()
317 | Some(ImmediateLocation::ModDeclaration(_)) 317 || matches!(
318 | Some(ImmediateLocation::RecordPat(_)) 318 self.completion_location,
319 | Some(ImmediateLocation::RecordExpr(_)) 319 Some(ImmediateLocation::Attribute(_))
320 ) || self.attribute_under_caret.is_some() 320 | Some(ImmediateLocation::ModDeclaration(_))
321 | Some(ImmediateLocation::RecordPat(_))
322 | Some(ImmediateLocation::RecordExpr(_))
323 )
321 } 324 }
322 325
323 pub(crate) fn expects_expression(&self) -> bool { 326 pub(crate) fn expects_expression(&self) -> bool {