diff options
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r-- | crates/assists/src/handlers/auto_import.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crates/assists/src/handlers/auto_import.rs b/crates/assists/src/handlers/auto_import.rs index fa524ffd9..357ff6392 100644 --- a/crates/assists/src/handlers/auto_import.rs +++ b/crates/assists/src/handlers/auto_import.rs | |||
@@ -191,12 +191,16 @@ impl AutoImportAssets { | |||
191 | _ => Some(candidate), | 191 | _ => Some(candidate), |
192 | }) | 192 | }) |
193 | .filter_map(|candidate| match candidate { | 193 | .filter_map(|candidate| match candidate { |
194 | Either::Left(module_def) => { | 194 | Either::Left(module_def) => self.module_with_name_to_import.find_use_path_prefixed( |
195 | self.module_with_name_to_import.find_use_path_prefixed(db, module_def) | 195 | db, |
196 | } | 196 | module_def, |
197 | Either::Right(macro_def) => { | 197 | ctx.config.insert_use.prefix_kind, |
198 | self.module_with_name_to_import.find_use_path_prefixed(db, macro_def) | 198 | ), |
199 | } | 199 | Either::Right(macro_def) => self.module_with_name_to_import.find_use_path_prefixed( |
200 | db, | ||
201 | macro_def, | ||
202 | ctx.config.insert_use.prefix_kind, | ||
203 | ), | ||
200 | }) | 204 | }) |
201 | .filter(|use_path| !use_path.segments.is_empty()) | 205 | .filter(|use_path| !use_path.segments.is_empty()) |
202 | .take(20) | 206 | .take(20) |