diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index e08dd8dadeb..f5324208c9a 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -2807,6 +2807,10 @@ fn from_def(db: &dyn HirDatabase, def: impl HasResolver + Into) -> Type let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build(); Some(subst) } + ItemContainerId::ImplId(id) => { + let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build(); + Some(subst) + } _ => None, }, _ => None, diff --git a/crates/ide/src/highlight_related.rs b/crates/ide/src/highlight_related.rs index 1bdd626f1e8..540a115832d 100644 --- a/crates/ide/src/highlight_related.rs +++ b/crates/ide/src/highlight_related.rs @@ -1373,6 +1373,22 @@ fn main() { ().func$0(); //^^^^ } +"#, + ); + } + + #[test] + fn test_assoc_type_highlighting() { + check( + r#" +trait Trait { + type Output; + // ^^^^^^ +} +impl Trait for () { + type Output$0 = (); + // ^^^^^^ +} "#, ); }