mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Handle impl generics in method calls
This commit is contained in:
parent
2af067b391
commit
65bd9bc3a8
7 changed files with 122 additions and 77 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue