From 9e71dd9799879fc9070f8717f8711fba5dae490a Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 28 May 2021 02:40:40 +0200 Subject: Only complete modules in empty use-statements --- crates/ide_completion/src/context.rs | 4 ++++ 1 file changed, 4 insertions(+) (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 fbef54408..923e35dbb 100644 --- a/crates/ide_completion/src/context.rs +++ b/crates/ide_completion/src/context.rs @@ -276,6 +276,10 @@ impl<'a> CompletionContext<'a> { ) } + pub(crate) fn expects_use_tree(&self) -> bool { + matches!(self.completion_location, Some(ImmediateLocation::Use)) + } + pub(crate) fn expects_non_trait_assoc_item(&self) -> bool { matches!(self.completion_location, Some(ImmediateLocation::Impl)) } -- cgit v1.2.3