Skip to content

Commit

Permalink
copy from upstream #15528 to make branch mergeable
Browse files Browse the repository at this point in the history
merge commits are not allowed upstream, so I manually copied the changes
  • Loading branch information
anarachnid committed Oct 6, 2023
1 parent 6f9de84 commit 7f10358
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/ide-db/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7f10358

Please sign in to comment.