From b85042601d69d1c592b731430ef0e445c39fda56 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 10 Jul 2020 14:08:35 +0200 Subject: Goto type definition works for self --- crates/ra_hir_def/src/body.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 4f2350915..031ffe13f 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -302,6 +302,11 @@ impl BodySourceMap { self.pat_map.get(&src).cloned() } + pub fn node_self_param(&self, node: InFile<&ast::SelfParam>) -> Option { + let src = node.map(|it| Either::Right(AstPtr::new(it))); + self.pat_map.get(&src).cloned() + } + pub fn field_syntax(&self, expr: ExprId, field: usize) -> InFile> { self.field_map[&(expr, field)].clone() } -- cgit v1.2.3