aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-20 10:19:09 +0000
committerAleksey Kladov <[email protected]>2019-12-20 10:52:17 +0000
commita04177f135be89ddbf1788c6f747c26812e90438 (patch)
treef2dbdf832caab0448427641b6a93ae3c66465c12 /crates/ra_hir/src
parent08c6933104baca84fd4135a76cdc7daf60a0c631 (diff)
Add local functions to bodies
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/from_source.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs
index 7abb4bd75..b3ed88b6b 100644
--- a/crates/ra_hir/src/from_source.rs
+++ b/crates/ra_hir/src/from_source.rs
@@ -1,8 +1,8 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2use hir_def::{ 2use hir_def::{
3 child_by_source::ChildBySource, dyn_map::DynMap, keys, keys::Key, nameres::ModuleSource, 3 child_by_source::ChildBySource, dyn_map::DynMap, keys, keys::Key, nameres::ModuleSource,
4 ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, ImplId, ModuleId, StaticId, StructId, 4 ConstId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, GenericDefId, ImplId, ModuleId,
5 TraitId, TypeAliasId, UnionId, VariantId, 5 StaticId, StructId, TraitId, TypeAliasId, UnionId, VariantId,
6}; 6};
7use hir_expand::{name::AsName, AstId, MacroDefId, MacroDefKind}; 7use hir_expand::{name::AsName, AstId, MacroDefId, MacroDefKind};
8use ra_syntax::{ 8use ra_syntax::{
@@ -227,7 +227,12 @@ fn _analyze_container(db: &impl DefDatabase, src: InFile<&SyntaxNode>) -> Option
227 ast::ImplBlock(it) => { 227 ast::ImplBlock(it) => {
228 let c = ImplBlock::from_source(db, src.with_value(it))?; 228 let c = ImplBlock::from_source(db, src.with_value(it))?;
229 c.id.child_by_source(db) 229 c.id.child_by_source(db)
230 }, 230 },
231 ast::FnDef(it) => {
232 let f = Function::from_source(db, src.with_value(it))?;
233 DefWithBodyId::from(f.id)
234 .child_by_source(db)
235 },
231 _ => { continue }, 236 _ => { continue },
232 } 237 }
233 }; 238 };