From 7b0644d81e52d00a7a6795b187f356213ff68225 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 12 Dec 2019 14:09:13 +0100 Subject: Switch to the new location for impls --- crates/ra_hir_def/src/src.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_def/src/src.rs') diff --git a/crates/ra_hir_def/src/src.rs b/crates/ra_hir_def/src/src.rs index 27caa02cc..a5c4359a7 100644 --- a/crates/ra_hir_def/src/src.rs +++ b/crates/ra_hir_def/src/src.rs @@ -4,7 +4,7 @@ use hir_expand::InFile; use ra_arena::map::ArenaMap; use ra_syntax::ast; -use crate::{db::DefDatabase, ConstLoc, FunctionLoc, StaticLoc, TypeAliasLoc}; +use crate::{db::DefDatabase, ConstLoc, FunctionLoc, ImplLoc, StaticLoc, TypeAliasLoc}; pub trait HasSource { type Value; @@ -47,6 +47,15 @@ impl HasSource for StaticLoc { } } +impl HasSource for ImplLoc { + type Value = ast::ImplBlock; + + fn source(&self, db: &impl DefDatabase) -> InFile { + let node = self.ast_id.to_node(db); + InFile::new(self.ast_id.file_id, node) + } +} + pub trait HasChildSource { type ChildId; type Value; -- cgit v1.2.3