From 0f415dd4b30289117fe76d071293e9bdd3556336 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 22 Nov 2019 21:43:36 +0300 Subject: More principled sources for enums and fields --- crates/ra_hir_def/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_def/src/lib.rs') diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 3a0420da0..2edf743ab 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs @@ -20,6 +20,8 @@ pub mod generics; pub mod resolver; pub mod data; +mod trace; + #[cfg(test)] mod test_db; #[cfg(test)] @@ -31,7 +33,7 @@ pub mod nameres; use std::hash::{Hash, Hasher}; use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, Source}; -use ra_arena::{impl_arena_id, RawId}; +use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; use ra_db::{salsa, CrateId, FileId}; use ra_syntax::{ast, AstNode, SyntaxNode}; @@ -550,3 +552,12 @@ impl HasSource for ConstLoc { Source::new(self.ast_id.file_id(), node) } } + +pub trait HasChildSource { + type ChildId; + type Value; + fn child_source( + &self, + db: &impl db::DefDatabase2, + ) -> Source>; +} -- cgit v1.2.3