Handle impl generics in method calls

This commit is contained in:
Florian Diebold 2019-02-16 22:06:23 +01:00
parent 2af067b391
commit 65bd9bc3a8
7 changed files with 122 additions and 77 deletions

View file

@ -3,22 +3,11 @@ use std::sync::Arc;
use ra_syntax::ast::{self, NameOwner};
use crate::{
HirDatabase, Name, AsName, Function, FnSignature,
Name, AsName, Function, FnSignature,
type_ref::{TypeRef, Mutability},
PersistentHirDatabase,
impl_block::ImplBlock,
};
impl Function {
// 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> {
let module_impls = db.impls_in_module(self.module(db));
ImplBlock::containing(module_impls, (*self).into())
}
}
impl FnSignature {
pub(crate) fn fn_signature_query(
db: &impl PersistentHirDatabase,