From 00f3b6c59ae3df9a7bfb1cd8b694d5f9b6a78be4 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Wed, 13 May 2020 16:06:42 +0300 Subject: Correctly fill default type parameters --- crates/ra_syntax/src/ast/make.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 12c5228f5..8981cbe33 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs @@ -13,6 +13,10 @@ pub fn name_ref(text: &str) -> ast::NameRef { ast_from_text(&format!("fn f() {{ {}; }}", text)) } +pub fn type_arg(text: &str) -> ast::TypeArg { + ast_from_text(&format!("impl F<{}> for G {{}}", text)) +} + pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { ast_from_text(&format!("use {};", name_ref)) } -- cgit v1.2.3 From 7e9396c7ebd8b6b245086c2292e100200c8adb19 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Thu, 14 May 2020 10:14:04 +0300 Subject: Change type_arg to type_ref func --- crates/ra_syntax/src/ast/make.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 8981cbe33..d0e960fb4 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs @@ -13,8 +13,8 @@ pub fn name_ref(text: &str) -> ast::NameRef { ast_from_text(&format!("fn f() {{ {}; }}", text)) } -pub fn type_arg(text: &str) -> ast::TypeArg { - ast_from_text(&format!("impl F<{}> for G {{}}", text)) +pub fn type_ref(text: &str) -> ast::TypeRef { + ast_from_text(&format!("impl {} for D {{}};", text)) } pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { -- cgit v1.2.3