mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: more natural order of sources for TypeParam
We usually use first (left) variant of `Either` for "usual" case, and use right for odd things. For example, pat source is Pat | SelfParam.
This commit is contained in:
parent
4cfc767d7f
commit
c2015e7d18
5 changed files with 12 additions and 12 deletions
|
@ -143,8 +143,8 @@ impl Definition {
|
|||
hir::GenericParam::TypeParam(type_param) => {
|
||||
let src = type_param.source(sema.db)?;
|
||||
let name = match &src.value {
|
||||
Either::Left(_) => return None,
|
||||
Either::Right(type_param) => type_param.name()?,
|
||||
Either::Left(type_param) => type_param.name()?,
|
||||
Either::Right(_trait) => return None,
|
||||
};
|
||||
src.with_value(name.syntax()).original_file_range(sema.db)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue