From 444f6caababc3335b1ed51d08eeedac106fd8077 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 1 Apr 2021 18:01:18 +0200 Subject: Resolve associated types --- crates/ide/src/hover.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'crates/ide/src') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 5f9edb476..8f98056c1 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -3834,4 +3834,46 @@ fn foo() {} "#]], ); } + + #[test] + fn hover_generic_assoc() { + check( + r#" +fn foo() where T::Assoc$0: {} + +trait A { + type Assoc; +}"#, + expect![[r#" + *Assoc* + + ```rust + test + ``` + + ```rust + type Assoc + ``` + "#]], + ); + check( + r#" +trait A where + Self::Assoc$0: , +{ + type Assoc; +}"#, + expect![[r#" + *Assoc* + + ```rust + test + ``` + + ```rust + type Assoc + ``` + "#]], + ) + } } -- cgit v1.2.3