From da7056245d9b59a4b3af7266dd271bab58cb6527 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 16 Feb 2019 21:19:24 +0100 Subject: Add generic params to impl blocks --- crates/ra_syntax/src/ast/generated.rs | 1 + crates/ra_syntax/src/grammar.ron | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 7c5e8ce5e..aa9da92da 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -1352,6 +1352,7 @@ impl ToOwned for ImplBlock { } +impl ast::TypeParamsOwner for ImplBlock {} impl ImplBlock { pub fn item_list(&self) -> Option<&ItemList> { super::child_opt(self) diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 304bc5909..5ec68014b 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -322,7 +322,7 @@ Grammar( ], options: ["TypeRef"] ), - "ImplBlock": (options: ["ItemList"]), + "ImplBlock": (options: ["ItemList"], traits: ["TypeParamsOwner"]), "ParenType": (options: ["TypeRef"]), "TupleType": ( collections: [["fields", "TypeRef"]] ), -- cgit v1.2.3 From a1bda3fc084bb6aa4979282b4907db9885fac9af Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 16 Feb 2019 23:05:57 +0100 Subject: Handle generic args for method calls --- crates/ra_syntax/src/ast/generated.rs | 4 ++++ crates/ra_syntax/src/grammar.ron | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index aa9da92da..dd91b5063 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -2095,6 +2095,10 @@ impl MethodCallExpr { pub fn name_ref(&self) -> Option<&NameRef> { super::child_opt(self) } + + pub fn type_arg_list(&self) -> Option<&TypeArgList> { + super::child_opt(self) + } } // Module diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 5ec68014b..27a123681 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -431,7 +431,7 @@ Grammar( ), "MethodCallExpr": ( traits: ["ArgListOwner"], - options: [ "Expr", "NameRef" ], + options: [ "Expr", "NameRef", "TypeArgList" ], ), "IndexExpr": (), "FieldExpr": (options: ["Expr", "NameRef"]), -- cgit v1.2.3