move function to code_model_api

This commit is contained in:
Aleksey Kladov 2019-01-08 20:11:13 +03:00
parent 3b166aee3c
commit ac92973a6c
9 changed files with 153 additions and 144 deletions

View file

@ -758,10 +758,7 @@ pub(crate) fn body_syntax_mapping(
let def = def_id.resolve(db)?;
let body_syntax_mapping = match def {
Def::Function(f) => {
let node = f.syntax(db);
collect_fn_body_syntax(&node)
}
Def::Function(f) => collect_fn_body_syntax(&f.source(db)),
// TODO: consts, etc.
_ => panic!("Trying to get body for item type without body"),
};