diff options
Diffstat (limited to 'crates/ra_hir_def/src/src.rs')
-rw-r--r-- | crates/ra_hir_def/src/src.rs | 11 |
1 files changed, 10 insertions, 1 deletions
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; | |||
4 | use ra_arena::map::ArenaMap; | 4 | use ra_arena::map::ArenaMap; |
5 | use ra_syntax::ast; | 5 | use ra_syntax::ast; |
6 | 6 | ||
7 | use crate::{db::DefDatabase, ConstLoc, FunctionLoc, StaticLoc, TypeAliasLoc}; | 7 | use crate::{db::DefDatabase, ConstLoc, FunctionLoc, ImplLoc, StaticLoc, TypeAliasLoc}; |
8 | 8 | ||
9 | pub trait HasSource { | 9 | pub trait HasSource { |
10 | type Value; | 10 | type Value; |
@@ -47,6 +47,15 @@ impl HasSource for StaticLoc { | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | impl HasSource for ImplLoc { | ||
51 | type Value = ast::ImplBlock; | ||
52 | |||
53 | fn source(&self, db: &impl DefDatabase) -> InFile<ast::ImplBlock> { | ||
54 | let node = self.ast_id.to_node(db); | ||
55 | InFile::new(self.ast_id.file_id, node) | ||
56 | } | ||
57 | } | ||
58 | |||
50 | pub trait HasChildSource { | 59 | pub trait HasChildSource { |
51 | type ChildId; | 60 | type ChildId; |
52 | type Value; | 61 | type Value; |