From f8a2b533045757c42c206b2596448baf4737f1f0 Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Tue, 9 Oct 2018 10:08:17 -0400 Subject: Language Server: textDocument/signatureHelp Implements a pretty barebones function signature help mechanism in the language server. Users can use `Analysis::resolve_callback()` to get basic information about a call site. Fixes #102 --- crates/ra_syntax/src/ast/generated.rs | 5 ++++- crates/ra_syntax/src/grammar.ron | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index ef7b5b1a1..1901a667c 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -1387,7 +1387,10 @@ impl<'a> AstNode<'a> for PathExpr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> PathExpr<'a> {} +impl<'a> PathExpr<'a> {pub fn path(self) -> Option> { + super::child_opt(self) + } +} // PathPat #[derive(Debug, Clone, Copy)] diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 9da0c2c13..a904f7505 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -342,7 +342,7 @@ Grammar( "TupleExpr": (), "ArrayExpr": (), "ParenExpr": (), - "PathExpr": (), + "PathExpr": (options: ["Path"]), "LambdaExpr": ( options: [ "ParamList", -- cgit v1.2.3