diff options
author | Lukas Wirth <[email protected]> | 2020-11-05 22:34:50 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-11-05 22:41:46 +0000 |
commit | 19443c1fa30e5a360c84f82d0b7aac733ea2e240 (patch) | |
tree | 0e61f9346db4e3bfb7d207b8e6de1fd32ea9c305 /crates/syntax | |
parent | 7709b6a2d4b74b5838fbe5b30b6188d6a549b580 (diff) |
Add missing AssocItems in add_custom_impl assist
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/src/ast/make.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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 { | |||
25 | ast_from_text("impl C for D {};") | 25 | ast_from_text("impl C for D {};") |
26 | } | 26 | } |
27 | 27 | ||
28 | pub fn impl_trait(trait_: ast::Path, ty: ast::Path) -> ast::Impl { | ||
29 | ast_from_text(&format!("impl {} for {} {{}}", trait_, ty)) | ||
30 | } | ||
31 | |||
28 | pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { | 32 | pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { |
29 | ast_from_text(&format!("use {};", name_ref)) | 33 | ast_from_text(&format!("use {};", name_ref)) |
30 | } | 34 | } |