Only complete modules in empty use-statements

This commit is contained in:
Lukas Wirth 2021-05-28 02:40:40 +02:00
parent 01bfc5f5c0
commit 9e71dd9799
3 changed files with 27 additions and 14 deletions

View file

@ -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))
}