diff options
author | Lukas Wirth <[email protected]> | 2021-05-28 01:40:40 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-05-28 01:42:47 +0100 |
commit | 9e71dd9799879fc9070f8717f8711fba5dae490a (patch) | |
tree | c95abc3bdf10e2bc1f60bfa6e6b12ebb03760472 /crates/ide_completion/src/context.rs | |
parent | 01bfc5f5c0cf6b73c26d006802016c9b02066f94 (diff) |
Only complete modules in empty use-statements
Diffstat (limited to 'crates/ide_completion/src/context.rs')
-rw-r--r-- | crates/ide_completion/src/context.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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> { | |||
276 | ) | 276 | ) |
277 | } | 277 | } |
278 | 278 | ||
279 | pub(crate) fn expects_use_tree(&self) -> bool { | ||
280 | matches!(self.completion_location, Some(ImmediateLocation::Use)) | ||
281 | } | ||
282 | |||
279 | pub(crate) fn expects_non_trait_assoc_item(&self) -> bool { | 283 | pub(crate) fn expects_non_trait_assoc_item(&self) -> bool { |
280 | matches!(self.completion_location, Some(ImmediateLocation::Impl)) | 284 | matches!(self.completion_location, Some(ImmediateLocation::Impl)) |
281 | } | 285 | } |