diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-18 16:13:06 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-18 16:13:06 +0000 |
commit | 9daba961f236750c3a5d831c9775606271b37eff (patch) | |
tree | 6d8c037ea915434701e573bf5eb2eb1f696eef07 /crates/ide/src/hover.rs | |
parent | cc58459ee39db804c0b4a660d1f0bb5c9c0bb648 (diff) | |
parent | 98718e0544f42e55642d2838b00d6a7bef1e2414 (diff) |
Merge #7291
7291: Wrap remaining self/super/crate in Name{Ref} r=matklad a=Veykril
That should be the remaining special casing for `self` 🎉
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 6022bd275..2024acd94 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -98,7 +98,6 @@ pub(crate) fn hover( | |||
98 | ast::NameRef(name_ref) => NameRefClass::classify(&sema, &name_ref).map(|d| d.referenced(sema.db)), | 98 | ast::NameRef(name_ref) => NameRefClass::classify(&sema, &name_ref).map(|d| d.referenced(sema.db)), |
99 | ast::Lifetime(lifetime) => NameClass::classify_lifetime(&sema, &lifetime) | 99 | ast::Lifetime(lifetime) => NameClass::classify_lifetime(&sema, &lifetime) |
100 | .map_or_else(|| NameRefClass::classify_lifetime(&sema, &lifetime).map(|d| d.referenced(sema.db)), |d| d.defined(sema.db)), | 100 | .map_or_else(|| NameRefClass::classify_lifetime(&sema, &lifetime).map(|d| d.referenced(sema.db)), |d| d.defined(sema.db)), |
101 | ast::SelfParam(self_param) => NameClass::classify_self_param(&sema, &self_param).and_then(|d| d.defined(sema.db)), | ||
102 | _ => None, | 101 | _ => None, |
103 | } | 102 | } |
104 | }; | 103 | }; |
@@ -3223,7 +3222,7 @@ impl Foo { | |||
3223 | } | 3222 | } |
3224 | "#, | 3223 | "#, |
3225 | expect![[r#" | 3224 | expect![[r#" |
3226 | *&self* | 3225 | *self* |
3227 | 3226 | ||
3228 | ```rust | 3227 | ```rust |
3229 | &Foo | 3228 | &Foo |
@@ -3243,7 +3242,7 @@ impl Foo { | |||
3243 | } | 3242 | } |
3244 | "#, | 3243 | "#, |
3245 | expect![[r#" | 3244 | expect![[r#" |
3246 | *self: Arc<Foo>* | 3245 | *self* |
3247 | 3246 | ||
3248 | ```rust | 3247 | ```rust |
3249 | Arc<Foo> | 3248 | Arc<Foo> |