From 19443c1fa30e5a360c84f82d0b7aac733ea2e240 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 5 Nov 2020 23:34:50 +0100 Subject: Add missing AssocItems in add_custom_impl assist --- crates/syntax/src/ast/make.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/syntax/src') diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index b1578820f..876659a2b 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -25,6 +25,10 @@ pub fn assoc_item_list() -> ast::AssocItemList { ast_from_text("impl C for D {};") } +pub fn impl_trait(trait_: ast::Path, ty: ast::Path) -> ast::Impl { + ast_from_text(&format!("impl {} for {} {{}}", trait_, ty)) +} + pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { ast_from_text(&format!("use {};", name_ref)) } -- cgit v1.2.3