Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/lib.rs')
-rw-r--r--crates/ide-completion/src/lib.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ide-completion/src/lib.rs b/crates/ide-completion/src/lib.rs
index 1fdd4cdb1c..a70a1138d2 100644
--- a/crates/ide-completion/src/lib.rs
+++ b/crates/ide-completion/src/lib.rs
@@ -208,9 +208,9 @@ pub fn completions(
// when the user types a bare `_` (that is it does not belong to an identifier)
// the user might just wanted to type a `_` for type inference or pattern discarding
// so try to suppress completions in those cases
- if trigger_character == Some('_') && ctx.original_token.kind() == syntax::SyntaxKind::UNDERSCORE
- {
- if let CompletionAnalysis::NameRef(NameRefContext {
+ if trigger_character == Some('_')
+ && ctx.original_token.kind() == syntax::SyntaxKind::UNDERSCORE
+ && let CompletionAnalysis::NameRef(NameRefContext {
kind:
NameRefKind::Path(
path_ctx @ PathCompletionCtx {
@@ -220,11 +220,9 @@ pub fn completions(
),
..
}) = analysis
- {
- if path_ctx.is_trivial_path() {
- return None;
- }
- }
+ && path_ctx.is_trivial_path()
+ {
+ return None;
}
{