diff options
author | Florian Diebold <[email protected]> | 2020-01-03 18:58:56 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-01-11 22:33:04 +0000 |
commit | 4545f289a991ec3888896aac0e0bcbfac9061e80 (patch) | |
tree | 968011283d685f325f980459c6f4f5ba1d5d1bc9 /crates/ra_syntax | |
parent | 5cb1f7132277e16ec4eecafbc274563c4d27158e (diff) |
Handle type args
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 04a5408fe..68d64a0cc 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -21,6 +21,13 @@ pub fn path_qualified(qual: ast::Path, name_ref: ast::NameRef) -> ast::Path { | |||
21 | fn path_from_text(text: &str) -> ast::Path { | 21 | fn path_from_text(text: &str) -> ast::Path { |
22 | ast_from_text(text) | 22 | ast_from_text(text) |
23 | } | 23 | } |
24 | pub fn path_with_type_arg_list(path: ast::Path, args: Option<ast::TypeArgList>) -> ast::Path { | ||
25 | if let Some(args) = args { | ||
26 | ast_from_text(&format!("const X: {}{}", path.syntax(), args.syntax())) | ||
27 | } else { | ||
28 | path | ||
29 | } | ||
30 | } | ||
24 | 31 | ||
25 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { | 32 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { |
26 | return match expr { | 33 | return match expr { |