mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-18 17:40:29 +00:00
generate method assist
This commit is contained in:
parent
b2b24255c8
commit
9ca73528ee
3 changed files with 154 additions and 0 deletions
|
@ -531,6 +531,10 @@ pub fn param(pat: ast::Pat, ty: ast::Type) -> ast::Param {
|
|||
ast_from_text(&format!("fn f({}: {}) {{ }}", pat, ty))
|
||||
}
|
||||
|
||||
pub fn self_param() -> ast::SelfParam {
|
||||
ast_from_text(&format!("fn f(&self) {{ }}"))
|
||||
}
|
||||
|
||||
pub fn ret_type(ty: ast::Type) -> ast::RetType {
|
||||
ast_from_text(&format!("fn f() -> {} {{ }}", ty))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue