Added defWithBody

This commit is contained in:
Lenard Pratt 2019-03-30 10:50:00 +00:00
parent 2a770190b0
commit 7f3bf7cc73
7 changed files with 120 additions and 24 deletions

View file

@ -10,7 +10,7 @@ use ra_syntax::{
use ra_arena::{Arena, RawId, impl_arena_id};
use crate::{
Name, AsName, Function,
Name, AsName, Function,DefWithBody,
expr::{PatId, ExprId, Pat, Expr, Body, Statement, BodySourceMap},
HirDatabase,
};
@ -40,8 +40,8 @@ pub struct ScopeData {
impl ExprScopes {
// FIXME: This should take something more general than Function
pub(crate) fn expr_scopes_query(db: &impl HirDatabase, function: Function) -> Arc<ExprScopes> {
let body = db.body_hir(function);
pub(crate) fn expr_scopes_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<ExprScopes> {
let body = db.body_hir(def);
let res = ExprScopes::new(body);
Arc::new(res)
}