From ef67581104eb00a0c199f0b2a3b558da8a6f90a2 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 Dec 2018 17:13:11 +0100 Subject: Resolve paths to defs (functions currently) during type inference --- crates/ra_syntax/src/ast/generated.rs | 6 +++++- crates/ra_syntax/src/grammar.ron | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (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 b15c4ef6f..c73533861 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -3083,7 +3083,11 @@ impl> RetTypeNode { } -impl<'a> RetType<'a> {} +impl<'a> RetType<'a> { + pub fn type_ref(self) -> Option> { + super::child_opt(self) + } +} // ReturnExpr #[derive(Debug, Clone, Copy,)] diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 8dca493ee..e3b9032a0 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -254,7 +254,7 @@ Grammar( ], options: [ "ParamList", ["body", "Block"], "RetType" ], ), - "RetType": (), + "RetType": (options: ["TypeRef"]), "StructDef": ( traits: [ "NameOwner", -- cgit v1.2.3