aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-03-18 20:36:52 +0000
committerLukas Wirth <[email protected]>2021-03-18 20:36:52 +0000
commit34464ede3f57cbab4d6d1a67f36252cc22c02765 (patch)
tree2c0ce285ca796ef3e92a6bfaa487859075be3c7a /crates/ide_db/src
parent816bc7389516dda1eb4821f2ac4d5993cd5611dd (diff)
Fix associated items not being appended to paths in import_assets
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r--crates/ide_db/src/helpers/import_assets.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide_db/src/helpers/import_assets.rs b/crates/ide_db/src/helpers/import_assets.rs
index e03ccd351..7c8844e95 100644
--- a/crates/ide_db/src/helpers/import_assets.rs
+++ b/crates/ide_db/src/helpers/import_assets.rs
@@ -304,7 +304,11 @@ 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 Some(LocatedImport::new(mod_path(item)?, item, item, mod_path(item))) 307 let mut mod_path = mod_path(item)?;
308 if let Some(assoc_item) = item_as_assoc(db, item) {
309 mod_path.push_segment(assoc_item.name(db)?);
310 }
311 Some(LocatedImport::new(mod_path.clone(), item, item, Some(mod_path)))
308 }) 312 })
309 .collect(); 313 .collect();
310 } 314 }