From 4926bed42680d329f906be93450bec6b2ba0e99b Mon Sep 17 00:00:00 2001 From: uHOOCCOOHu Date: Thu, 12 Sep 2019 02:01:07 +0800 Subject: Support path starting with a type --- crates/ra_syntax/src/ast/generated.rs | 3 +++ crates/ra_syntax/src/grammar.ron | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 591ac8ca3..dc1f8c82c 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -2385,6 +2385,9 @@ impl PathSegment { pub fn ret_type(&self) -> Option { AstChildren::new(&self.syntax).next() } + pub fn path_type(&self) -> Option { + AstChildren::new(&self.syntax).next() + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct PathType { diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 08cc6eeea..da9de2214 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -689,7 +689,7 @@ Grammar( ] ), "PathSegment": ( - options: [ "NameRef", "TypeArgList", "ParamList", "RetType" ] + options: [ "NameRef", "TypeArgList", "ParamList", "RetType", "PathType" ] ), "TypeArgList": (collections: [ ("type_args", "TypeArg"), -- cgit v1.2.3