Skip to content

Commit

Permalink
fix: Fix only_types config filtering out traits from world symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Aug 12, 2023
1 parent 1b67823 commit beec372
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::TraitAlias(..)
| hir::TypeAlias(..)
)
{
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 beec372

Please sign in to comment.