diff options
Diffstat (limited to 'crates/completion/src/completions/unqualified_path.rs')
-rw-r--r-- | crates/completion/src/completions/unqualified_path.rs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 4e4e2b36f..544886d29 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -45,7 +45,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
45 | }); | 45 | }); |
46 | 46 | ||
47 | if ctx.config.enable_autoimport_completions && ctx.config.resolve_additional_edits_lazily() { | 47 | if ctx.config.enable_autoimport_completions && ctx.config.resolve_additional_edits_lazily() { |
48 | fuzzy_completion(acc, ctx).unwrap_or_default() | 48 | fuzzy_completion(acc, ctx); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
@@ -100,10 +100,10 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T | |||
100 | // To avoid an excessive amount of the results returned, completion input is checked for inclusion in the identifiers only | 100 | // To avoid an excessive amount of the results returned, completion input is checked for inclusion in the identifiers only |
101 | // (i.e. in `HashMap` in the `std::collections::HashMap` path), also not in the module indentifiers. | 101 | // (i.e. in `HashMap` in the `std::collections::HashMap` path), also not in the module indentifiers. |
102 | // | 102 | // |
103 | // .Merge Behaviour | 103 | // .Merge Behavior |
104 | // | 104 | // |
105 | // It is possible to configure how use-trees are merged with the `importMergeBehaviour` setting. | 105 | // It is possible to configure how use-trees are merged with the `importMergeBehavior` setting. |
106 | // Mimics the corresponding behaviour of the `Auto Import` feature. | 106 | // Mimics the corresponding behavior of the `Auto Import` feature. |
107 | // | 107 | // |
108 | // .LSP and performance implications | 108 | // .LSP and performance implications |
109 | // | 109 | // |
@@ -145,15 +145,13 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<() | |||
145 | }) | 145 | }) |
146 | .filter(|(mod_path, _)| mod_path.len() > 1) | 146 | .filter(|(mod_path, _)| mod_path.len() > 1) |
147 | .filter_map(|(import_path, definition)| { | 147 | .filter_map(|(import_path, definition)| { |
148 | render_resolution_with_import( | 148 | let ie = |
149 | RenderContext::new(ctx), | 149 | ImportEdit { import_path: import_path.clone(), import_scope: import_scope.clone() }; |
150 | ImportEdit { | 150 | { |
151 | import_path: import_path.clone(), | 151 | let _p = profile::span("totextedit"); |
152 | import_scope: import_scope.clone(), | 152 | ie.to_text_edit(ctx.config.merge); |
153 | merge_behaviour: ctx.config.merge, | 153 | } |
154 | }, | 154 | render_resolution_with_import(RenderContext::new(ctx), ie, &definition) |
155 | &definition, | ||
156 | ) | ||
157 | }); | 155 | }); |
158 | 156 | ||
159 | acc.add_all(possible_imports); | 157 | acc.add_all(possible_imports); |