aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/src.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-12 13:58:04 +0000
committerAleksey Kladov <[email protected]>2019-12-12 13:58:04 +0000
commitf135a8ea55c0a46c67713fb3b79b5f62ada430c1 (patch)
treea71a0c4da21cb40c35b6aed842d9664cbec8a59d /crates/ra_hir_def/src/src.rs
parent63c192b34a54e826afebc735ca6225b44a876eab (diff)
Move structs to new loc
Diffstat (limited to 'crates/ra_hir_def/src/src.rs')
-rw-r--r--crates/ra_hir_def/src/src.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/src.rs b/crates/ra_hir_def/src/src.rs
index 858e4861e..7e212adb1 100644
--- a/crates/ra_hir_def/src/src.rs
+++ b/crates/ra_hir_def/src/src.rs
@@ -4,7 +4,9 @@ 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, ImplLoc, StaticLoc, TraitLoc, TypeAliasLoc}; 7use crate::{
8 db::DefDatabase, ConstLoc, FunctionLoc, ImplLoc, StaticLoc, StructLoc, TraitLoc, TypeAliasLoc,
9};
8 10
9pub trait HasSource { 11pub trait HasSource {
10 type Value; 12 type Value;
@@ -65,6 +67,15 @@ impl HasSource for TraitLoc {
65 } 67 }
66} 68}
67 69
70impl HasSource for StructLoc {
71 type Value = ast::StructDef;
72
73 fn source(&self, db: &impl DefDatabase) -> InFile<ast::StructDef> {
74 let node = self.ast_id.to_node(db);
75 InFile::new(self.ast_id.file_id, node)
76 }
77}
78
68pub trait HasChildSource { 79pub trait HasChildSource {
69 type ChildId; 80 type ChildId;
70 type Value; 81 type Value;