diff options
Diffstat (limited to 'crates/ra_ide/src/completion/complete_keyword.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_keyword.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index 79432113c..025097e49 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs | |||
@@ -159,6 +159,9 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
159 | add_keyword(ctx, acc, "break", "break", ctx.in_loop_body && !ctx.can_be_stmt); | 159 | add_keyword(ctx, acc, "break", "break", ctx.in_loop_body && !ctx.can_be_stmt); |
160 | add_keyword(ctx, acc, "pub", "pub ", ctx.is_new_item && !ctx.has_trait_parent); | 160 | add_keyword(ctx, acc, "pub", "pub ", ctx.is_new_item && !ctx.has_trait_parent); |
161 | 161 | ||
162 | if !ctx.is_trivial_path { | ||
163 | return; | ||
164 | } | ||
162 | let fn_def = match &ctx.function_syntax { | 165 | let fn_def = match &ctx.function_syntax { |
163 | Some(it) => it, | 166 | Some(it) => it, |
164 | None => return, | 167 | None => return, |
@@ -182,10 +185,7 @@ fn complete_return( | |||
182 | 185 | ||
183 | #[cfg(test)] | 186 | #[cfg(test)] |
184 | mod tests { | 187 | mod tests { |
185 | use crate::completion::{ | 188 | use crate::completion::{test_utils::get_completions, CompletionKind}; |
186 | test_utils::get_completions, | ||
187 | CompletionKind, | ||
188 | }; | ||
189 | use insta::assert_debug_snapshot; | 189 | use insta::assert_debug_snapshot; |
190 | 190 | ||
191 | fn get_keyword_completions(code: &str) -> Vec<String> { | 191 | fn get_keyword_completions(code: &str) -> Vec<String> { |