Sketching the resolver API

This commit is contained in:
Florian Diebold 2019-01-19 21:23:26 +01:00
parent 2b5c226e86
commit 5208c2aa93
8 changed files with 134 additions and 11 deletions

View file

@ -5,14 +5,12 @@ use ra_syntax::ast::{self, NameOwner};
use crate::{
HirDatabase, Name, AsName, Function, FnSignature,
type_ref::{TypeRef, Mutability},
expr::Body, PersistentHirDatabase,
PersistentHirDatabase,
impl_block::ImplBlock,
};
impl Function {
pub(crate) fn body(&self, db: &impl HirDatabase) -> Arc<Body> {
db.body_hir(*self)
}
// TODO impl_block should probably also be part of the code model API?
/// The containing impl block, if this is a method.
pub(crate) fn impl_block(&self, db: &impl HirDatabase) -> Option<ImplBlock> {