Skip to content

Commit 71f6d58

Browse files
committed
Remove unnecessary condition
No tests fail, and quick manual testing shows that there are no false-positives. In general, each completion contributor should be independent from the others.
1 parent d745022 commit 71f6d58

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

crates/ra_ide/src/completion.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,20 @@ pub(crate) fn completions(
6565
let ctx = CompletionContext::new(db, position, config)?;
6666

6767
let mut acc = Completions::default();
68-
if ctx.attribute_under_caret.is_some() {
69-
complete_attribute::complete_attribute(&mut acc, &ctx);
70-
} else {
71-
complete_fn_param::complete_fn_param(&mut acc, &ctx);
72-
complete_keyword::complete_expr_keyword(&mut acc, &ctx);
73-
complete_keyword::complete_use_tree_keyword(&mut acc, &ctx);
74-
complete_snippet::complete_expr_snippet(&mut acc, &ctx);
75-
complete_snippet::complete_item_snippet(&mut acc, &ctx);
76-
complete_qualified_path::complete_qualified_path(&mut acc, &ctx);
77-
complete_unqualified_path::complete_unqualified_path(&mut acc, &ctx);
78-
complete_dot::complete_dot(&mut acc, &ctx);
79-
complete_record::complete_record(&mut acc, &ctx);
80-
complete_pattern::complete_pattern(&mut acc, &ctx);
81-
complete_postfix::complete_postfix(&mut acc, &ctx);
82-
complete_macro_in_item_position::complete_macro_in_item_position(&mut acc, &ctx);
83-
complete_trait_impl::complete_trait_impl(&mut acc, &ctx);
84-
}
68+
complete_attribute::complete_attribute(&mut acc, &ctx);
69+
complete_fn_param::complete_fn_param(&mut acc, &ctx);
70+
complete_keyword::complete_expr_keyword(&mut acc, &ctx);
71+
complete_keyword::complete_use_tree_keyword(&mut acc, &ctx);
72+
complete_snippet::complete_expr_snippet(&mut acc, &ctx);
73+
complete_snippet::complete_item_snippet(&mut acc, &ctx);
74+
complete_qualified_path::complete_qualified_path(&mut acc, &ctx);
75+
complete_unqualified_path::complete_unqualified_path(&mut acc, &ctx);
76+
complete_dot::complete_dot(&mut acc, &ctx);
77+
complete_record::complete_record(&mut acc, &ctx);
78+
complete_pattern::complete_pattern(&mut acc, &ctx);
79+
complete_postfix::complete_postfix(&mut acc, &ctx);
80+
complete_macro_in_item_position::complete_macro_in_item_position(&mut acc, &ctx);
81+
complete_trait_impl::complete_trait_impl(&mut acc, &ctx);
8582

8683
Some(acc)
8784
}

0 commit comments

Comments
 (0)