From 761fc71083b9d810aa006210d6df2b0edf95cf33 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 19 Jul 2019 15:44:24 +0300 Subject: Fix tuple type lens resolution --- crates/ra_ide_api/src/display/structure.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide_api/src/display/structure.rs index ca2321e97..bd2e908da 100644 --- a/crates/ra_ide_api/src/display/structure.rs +++ b/crates/ra_ide_api/src/display/structure.rs @@ -166,15 +166,16 @@ fn structure_node(node: &SyntaxNode) -> Option { return None; } - let pat = match let_statement.pat()?.kind() { - PatKind::BindPat(bind_pat) => bind_pat, + let pat_range = match let_statement.pat()?.kind() { + PatKind::BindPat(bind_pat) => bind_pat.syntax().range(), + PatKind::TuplePat(tuple_pat) => tuple_pat.syntax().range(), _ => return None, }; Some(StructureNode { parent: None, label, - navigation_range: pat.syntax().range(), + navigation_range: pat_range, node_range: let_syntax.range(), kind: let_syntax.kind(), detail: None, -- cgit v1.2.3