From 4a6cdd776d403bacce0a5471d77e8c76695c5bc5 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 May 2021 16:59:23 +0200 Subject: Record method call substs and use them in call info --- crates/ide_db/src/call_info/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crates/ide_db/src') diff --git a/crates/ide_db/src/call_info/tests.rs b/crates/ide_db/src/call_info/tests.rs index be1cc12de..1aeda08e5 100644 --- a/crates/ide_db/src/call_info/tests.rs +++ b/crates/ide_db/src/call_info/tests.rs @@ -188,6 +188,24 @@ fn main() { S.foo($0); } ); } +#[test] +fn test_fn_signature_for_generic_method() { + check( + r#" +struct S(T); +impl S { + fn foo(&self, x: T) {} +} + +fn main() { S(1u32).foo($0); } +"#, + expect![[r#" + fn foo(&self, x: u32) + () + "#]], + ); +} + #[test] fn test_fn_signature_for_method_with_arg_as_assoc_fn() { check( -- cgit v1.2.3 From b8262099cc51065259daf10b4b23ff49ce74434f Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 May 2021 23:54:35 +0200 Subject: Get rid of field_type again --- crates/ide_db/src/defs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ide_db/src') diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index de0dc2a40..1dcccbb8b 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -311,7 +311,7 @@ impl NameRefClass { } if let Some(record_field) = ast::RecordExprField::for_field_name(name_ref) { - if let Some((field, local)) = sema.resolve_record_field(&record_field) { + if let Some((field, local, _)) = sema.resolve_record_field(&record_field) { let field = Definition::Field(field); let res = match local { None => NameRefClass::Definition(field), -- cgit v1.2.3