Skip to content

Commit 47e5759

Browse files
committed
add LetStmt arm
1 parent 14607ba commit 47e5759

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/tools/rust-analyzer/crates/ide/src/file_structure.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,24 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
187187
};
188188
Some(node)
189189
},
190+
ast::LetStmt(it) => {
191+
let pat = it.pat()?;
192+
193+
let mut label = String::new();
194+
collapse_ws(pat.syntax(), &mut label);
195+
196+
let node = StructureNode {
197+
parent: None,
198+
label,
199+
navigation_range: pat.syntax().text_range(),
200+
node_range: it.syntax().text_range(),
201+
kind: StructureNodeKind::SymbolKind(SymbolKind::Local),
202+
detail: it.ty().map(|ty| ty.to_string()),
203+
deprecated: false,
204+
};
205+
206+
Some(node)
207+
},
190208
ast::Macro(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Macro)),
191209
_ => None,
192210
}

0 commit comments

Comments
 (0)