mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-19 18:10:25 +00:00
Add missing AssocItems in add_custom_impl assist
This commit is contained in:
parent
7709b6a2d4
commit
19443c1fa3
5 changed files with 240 additions and 110 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue