mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-13 04:26:48 +00:00
Choose & over ref, make nav target's name more intuitive.
This commit is contained in:
parent
1222869b3e
commit
d49924dc6e
@ -169,7 +169,7 @@ impl TryToNav for FileSymbol {
|
||||
|
||||
Some(NavigationTarget {
|
||||
file_id: full_range.file_id,
|
||||
name: self.def.name(db)?.to_smol_str(),
|
||||
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 },
|
||||
kind: Some(hir::ModuleDefId::from(self.def).into()),
|
||||
full_range: full_range.range,
|
||||
|
@ -520,8 +520,8 @@ pub(crate) fn handle_workspace_symbol(
|
||||
|
||||
#[allow(deprecated)]
|
||||
let info = SymbolInformation {
|
||||
name: match nav.alias {
|
||||
Some(ref alias) => format!("{} (alias {})", alias, nav.name),
|
||||
name: match &nav.alias {
|
||||
Some(alias) => format!("{} (alias for {})", alias, nav.name),
|
||||
None => format!("{}", nav.name),
|
||||
},
|
||||
kind: nav
|
||||
|
Loading…
Reference in New Issue
Block a user