aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/keyword.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide_completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs
index e40ec6280..407f796ef 100644
--- a/crates/ide_completion/src/completions/keyword.rs
+++ b/crates/ide_completion/src/completions/keyword.rs
@@ -92,7 +92,7 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
92 } 92 }
93 93
94 if !ctx.has_visibility_prev_sibling() 94 if !ctx.has_visibility_prev_sibling()
95 && (expects_item || ctx.expects_non_trait_assoc_item() || ctx.expect_record_field()) 95 && (expects_item || ctx.expects_non_trait_assoc_item() || ctx.expect_field())
96 { 96 {
97 add_keyword("pub(crate)", "pub(crate) "); 97 add_keyword("pub(crate)", "pub(crate) ");
98 add_keyword("pub", "pub "); 98 add_keyword("pub", "pub ");
@@ -122,6 +122,10 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
122 add_keyword("union", "union $1 {\n $0\n}"); 122 add_keyword("union", "union $1 {\n $0\n}");
123 } 123 }
124 124
125 if ctx.expects_type() {
126 return;
127 }
128
125 if ctx.expects_expression() { 129 if ctx.expects_expression() {
126 if !has_block_expr_parent { 130 if !has_block_expr_parent {
127 add_keyword("unsafe", "unsafe {\n $0\n}"); 131 add_keyword("unsafe", "unsafe {\n $0\n}");