aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src/helpers')
-rw-r--r--crates/ide_db/src/helpers/import_assets.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ide_db/src/helpers/import_assets.rs b/crates/ide_db/src/helpers/import_assets.rs
index 7c8844e95..dbc980ba9 100644
--- a/crates/ide_db/src/helpers/import_assets.rs
+++ b/crates/ide_db/src/helpers/import_assets.rs
@@ -304,10 +304,12 @@ fn path_applicable_imports(
304 return items_with_candidate_name 304 return items_with_candidate_name
305 .into_iter() 305 .into_iter()
306 .filter_map(|item| { 306 .filter_map(|item| {
307 let mut mod_path = mod_path(item)?; 307 if item_as_assoc(db, item).is_some() {
308 if let Some(assoc_item) = item_as_assoc(db, item) { 308 // unqualified assoc items are not valid syntax
309 mod_path.push_segment(assoc_item.name(db)?); 309 return None;
310 } 310 }
311
312 let mod_path = mod_path(item)?;
311 Some(LocatedImport::new(mod_path.clone(), item, item, Some(mod_path))) 313 Some(LocatedImport::new(mod_path.clone(), item, item, Some(mod_path)))
312 }) 314 })
313 .collect(); 315 .collect();