mod scope;
use std::sync::Arc;
use ra_db::Cancelable;
use ra_syntax::{TreeArc, ast::{self, NameOwner}};
use crate::{
DefId, HirDatabase, Name, AsName, Function, FnSignature, Module,
type_ref::{TypeRef, Mutability},
expr::Body,
impl_block::ImplBlock,
code_model_impl::def_id_to_ast,
};
pub use self::scope::{FnScopes, ScopesWithSyntaxMapping, ScopeEntryWithSyntax};
impl Function {
pub(crate) fn new(def_id: DefId) -> Function {
Function { def_id }
}
pub(crate) fn body(&self, db: &impl HirDatabase) -> Arc
{
db.body_hir(self.def_id)
}
pub(crate) fn module(&self, db: &impl HirDatabase) -> Cancelable {
self.def_id.module(db)
}
/// The containing impl block, if this is a method.
pub(crate) fn impl_block(&self, db: &impl HirDatabase) -> Cancelable