Skip to content

Commit

Permalink
Auto merge of #15445 - Veykril:worl-symbols-traits, r=Veykril
Browse files Browse the repository at this point in the history
fix: Fix `only_types` config filtering out traits from world symbols

It is a bit confusing that this apparently did not filter every trait out though...

Closes #15444
Closes #15200
  • Loading branch information
bors committed Aug 12, 2023
2 parents 39ebc37 + d6d188f commit 6cf06c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/ide-db/src/symbol_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ impl Query {
hir::ModuleDef::Adt(..)
| hir::ModuleDef::TypeAlias(..)
| hir::ModuleDef::BuiltinType(..)
| hir::ModuleDef::TraitAlias(..)
| hir::ModuleDef::Trait(..)
)
{
continue;
Expand Down
8 changes: 6 additions & 2 deletions crates/ide/src/navigation_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ impl TryToNav for FileSymbol {

Some(NavigationTarget {
file_id: full_range.file_id,
name: if self.is_alias { self.def.name(db)?.to_smol_str() } else { self.name.clone() },
alias: if self.is_alias { Some(self.name.clone()) } else { None },
name: self
.is_alias
.then(|| self.def.name(db))
.flatten()
.map_or_else(|| self.name.clone(), |it| it.to_smol_str()),
alias: self.is_alias.then(|| self.name.clone()),
kind: Some(hir::ModuleDefId::from(self.def).into()),
full_range: full_range.range,
focus_range,
Expand Down

0 comments on commit 6cf06c1

Please sign in to comment.