From 7f1035806e82d9b03dc71907b94166b6c8902976 Mon Sep 17 00:00:00 2001 From: anarachnid <spidersarenice@proton.me> Date: Fri, 6 Oct 2023 14:01:13 -0700 Subject: [PATCH] copy from upstream #15528 to make branch mergeable merge commits are not allowed upstream, so I manually copied the changes --- crates/ide-db/src/search.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ide-db/src/search.rs b/crates/ide-db/src/search.rs index dce70a4c00cb..f42d90bfa9a4 100644 --- a/crates/ide-db/src/search.rs +++ b/crates/ide-db/src/search.rs @@ -221,7 +221,6 @@ impl Definition { } // def is crate root - // FIXME: We don't do searches for crates currently, as a crate does not actually have a single name if let &Definition::Module(module) = self { if module.is_crate_root() { return SearchScope::reverse_dependencies(db, module.krate()); @@ -400,7 +399,10 @@ impl<'a> FindUsages<'a> { match self.def { // special case crate modules as these do not have a proper name Definition::Module(module) if module.is_crate_root() => { - // FIXME: This assumes the crate name is always equal to its display name when it really isn't + // FIXME: This assumes the crate name is always equal to its display name when it + // really isn't + // we should instead look at the dependency edge name and recursively search our way + // up the ancestors let name = module .krate() .display_name(self.sema.db)