diff options
Diffstat (limited to 'crates/ide_completion/src/completions/flyimport.rs')
-rw-r--r-- | crates/ide_completion/src/completions/flyimport.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs index d72bf13d3..7bf47bf75 100644 --- a/crates/ide_completion/src/completions/flyimport.rs +++ b/crates/ide_completion/src/completions/flyimport.rs | |||
@@ -161,13 +161,13 @@ pub(crate) fn position_for_import<'a>( | |||
161 | ) -> Option<&'a SyntaxNode> { | 161 | ) -> Option<&'a SyntaxNode> { |
162 | Some(match import_candidate { | 162 | Some(match import_candidate { |
163 | Some(ImportCandidate::Path(_)) => ctx.name_ref_syntax.as_ref()?.syntax(), | 163 | Some(ImportCandidate::Path(_)) => ctx.name_ref_syntax.as_ref()?.syntax(), |
164 | Some(ImportCandidate::TraitAssocItem(_)) => ctx.path_qual.as_ref()?.syntax(), | 164 | Some(ImportCandidate::TraitAssocItem(_)) => ctx.path_qual()?.syntax(), |
165 | Some(ImportCandidate::TraitMethod(_)) => ctx.dot_receiver()?.syntax(), | 165 | Some(ImportCandidate::TraitMethod(_)) => ctx.dot_receiver()?.syntax(), |
166 | None => ctx | 166 | None => ctx |
167 | .name_ref_syntax | 167 | .name_ref_syntax |
168 | .as_ref() | 168 | .as_ref() |
169 | .map(|name_ref| name_ref.syntax()) | 169 | .map(|name_ref| name_ref.syntax()) |
170 | .or_else(|| ctx.path_qual.as_ref().map(|path| path.syntax())) | 170 | .or_else(|| ctx.path_qual().map(|path| path.syntax())) |
171 | .or_else(|| ctx.dot_receiver().map(|expr| expr.syntax()))?, | 171 | .or_else(|| ctx.dot_receiver().map(|expr| expr.syntax()))?, |
172 | }) | 172 | }) |
173 | } | 173 | } |
@@ -190,7 +190,7 @@ fn import_assets(ctx: &CompletionContext, fuzzy_name: String) -> Option<ImportAs | |||
190 | }; | 190 | }; |
191 | let assets_for_path = ImportAssets::for_fuzzy_path( | 191 | let assets_for_path = ImportAssets::for_fuzzy_path( |
192 | current_module, | 192 | current_module, |
193 | ctx.path_qual.clone(), | 193 | ctx.path_qual().cloned(), |
194 | fuzzy_name, | 194 | fuzzy_name, |
195 | &ctx.sema, | 195 | &ctx.sema, |
196 | approximate_node, | 196 | approximate_node, |