diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-10 15:02:04 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-10 15:02:04 +0000 |
commit | bd785788512d1a90ad7b0363835c4ea7d9c1f4ba (patch) | |
tree | e0dafa1ecf91c07b9946eed4fcf279ed3114cd0e /crates/completion/src/completions/unqualified_path.rs | |
parent | 83aa6fbd1ef7fd7faf27d8f7fd8679cb85a8097a (diff) | |
parent | 076945e47c22d984067e0ce4d2f2016821e869e2 (diff) |
Merge #6801
6801: Minor, more orthogonal code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/completion/src/completions/unqualified_path.rs')
-rw-r--r-- | crates/completion/src/completions/unqualified_path.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 3372fb1a2..544886d29 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -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_behavior: 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); |