mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Handle type args
This commit is contained in:
parent
5cb1f71322
commit
4545f289a9
2 changed files with 19 additions and 9 deletions
|
@ -21,6 +21,13 @@ pub fn path_qualified(qual: ast::Path, name_ref: ast::NameRef) -> ast::Path {
|
|||
fn path_from_text(text: &str) -> ast::Path {
|
||||
ast_from_text(text)
|
||||
}
|
||||
pub fn path_with_type_arg_list(path: ast::Path, args: Option<ast::TypeArgList>) -> ast::Path {
|
||||
if let Some(args) = args {
|
||||
ast_from_text(&format!("const X: {}{}", path.syntax(), args.syntax()))
|
||||
} else {
|
||||
path
|
||||
}
|
||||
}
|
||||
|
||||
pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField {
|
||||
return match expr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue