diff options
author | Aleksey Kladov <[email protected]> | 2020-07-11 00:26:24 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-11 00:26:24 +0100 |
commit | a36ff4a100c2c321eec898f2cfee25c0be85ffc6 (patch) | |
tree | 107769c5884b71e865b7efe44604cfad979e1f72 /crates/ra_ide/src/completion/complete_unqualified_path.rs | |
parent | 349c4fcecaab90a521d4344cf965202ed7a0a54e (diff) |
Speed up completion
Diffstat (limited to 'crates/ra_ide/src/completion/complete_unqualified_path.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_unqualified_path.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index 18f4488b7..bd9551f35 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs | |||
@@ -25,7 +25,7 @@ pub(super) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
25 | return; | 25 | return; |
26 | } | 26 | } |
27 | 27 | ||
28 | ctx.scope().process_all_names(&mut |name, res| { | 28 | ctx.scope.process_all_names(&mut |name, res| { |
29 | if ctx.use_item_syntax.is_some() { | 29 | if ctx.use_item_syntax.is_some() { |
30 | if let (ScopeDef::Unknown, Some(name_ref)) = (&res, &ctx.name_ref_syntax) { | 30 | if let (ScopeDef::Unknown, Some(name_ref)) = (&res, &ctx.name_ref_syntax) { |
31 | if name_ref.syntax().text() == name.to_string().as_str() { | 31 | if name_ref.syntax().text() == name.to_string().as_str() { |
@@ -42,7 +42,7 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T | |||
42 | if let Some(Adt::Enum(enum_data)) = ty.as_adt() { | 42 | if let Some(Adt::Enum(enum_data)) = ty.as_adt() { |
43 | let variants = enum_data.variants(ctx.db); | 43 | let variants = enum_data.variants(ctx.db); |
44 | 44 | ||
45 | let module = if let Some(module) = ctx.scope().module() { | 45 | let module = if let Some(module) = ctx.scope.module() { |
46 | // Compute path from the completion site if available. | 46 | // Compute path from the completion site if available. |
47 | module | 47 | module |
48 | } else { | 48 | } else { |