diff options
author | Florian Diebold <flodiebold@gmail.com> | 2019-02-16 21:06:23 +0000 |
---|---|---|
committer | Florian Diebold <flodiebold@gmail.com> | 2019-02-16 22:06:41 +0000 |
commit | 65bd9bc3a800e09f52a315cf98e86c120c366c2c (patch) | |
tree | 954a439a7c83898c36a0f2516e4a91c37c03c7dc /crates/ra_hir/src/code_model_impl | |
parent | 2af067b391bf37950cf1d3f1af863d931b385af5 (diff) |
Handle impl generics in method calls
Diffstat (limited to 'crates/ra_hir/src/code_model_impl')
-rw-r--r-- | crates/ra_hir/src/code_model_impl/function.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/crates/ra_hir/src/code_model_impl/function.rs b/crates/ra_hir/src/code_model_impl/function.rs index b9438fdb7..c401528c6 100644 --- a/crates/ra_hir/src/code_model_impl/function.rs +++ b/crates/ra_hir/src/code_model_impl/function.rs | |||
@@ -3,22 +3,11 @@ use std::sync::Arc; | |||
3 | use ra_syntax::ast::{self, NameOwner}; | 3 | use ra_syntax::ast::{self, NameOwner}; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | HirDatabase, Name, AsName, Function, FnSignature, | 6 | Name, AsName, Function, FnSignature, |
7 | type_ref::{TypeRef, Mutability}, | 7 | type_ref::{TypeRef, Mutability}, |
8 | PersistentHirDatabase, | 8 | PersistentHirDatabase, |
9 | impl_block::ImplBlock, | ||
10 | }; | 9 | }; |
11 | 10 | ||
12 | impl Function { | ||
13 | // TODO impl_block should probably also be part of the code model API? | ||
14 | |||
15 | /// The containing impl block, if this is a method. | ||
16 | pub(crate) fn impl_block(&self, db: &impl HirDatabase) -> Option<ImplBlock> { | ||
17 | let module_impls = db.impls_in_module(self.module(db)); | ||
18 | ImplBlock::containing(module_impls, (*self).into()) | ||
19 | } | ||
20 | } | ||
21 | |||
22 | impl FnSignature { | 11 | impl FnSignature { |
23 | pub(crate) fn fn_signature_query( | 12 | pub(crate) fn fn_signature_query( |
24 | db: &impl PersistentHirDatabase, | 13 | db: &impl PersistentHirDatabase, |