aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/src.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-12 13:09:13 +0000
committerAleksey Kladov <[email protected]>2019-12-12 13:25:34 +0000
commit7b0644d81e52d00a7a6795b187f356213ff68225 (patch)
tree88da767605960bb672934c091489d3aad826f17a /crates/ra_hir_def/src/src.rs
parentb0739d5a26684527129882b7d182d01e635525bc (diff)
Switch to the new location for impls
Diffstat (limited to 'crates/ra_hir_def/src/src.rs')
-rw-r--r--crates/ra_hir_def/src/src.rs11
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;
4use ra_arena::map::ArenaMap; 4use ra_arena::map::ArenaMap;
5use ra_syntax::ast; 5use ra_syntax::ast;
6 6
7use crate::{db::DefDatabase, ConstLoc, FunctionLoc, StaticLoc, TypeAliasLoc}; 7use crate::{db::DefDatabase, ConstLoc, FunctionLoc, ImplLoc, StaticLoc, TypeAliasLoc};
8 8
9pub trait HasSource { 9pub trait HasSource {
10 type Value; 10 type Value;
@@ -47,6 +47,15 @@ impl HasSource for StaticLoc {
47 } 47 }
48} 48}
49 49
50impl 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
50pub trait HasChildSource { 59pub trait HasChildSource {
51 type ChildId; 60 type ChildId;
52 type Value; 61 type Value;