mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
add LetStmt arm
This commit is contained in:
parent
3b3a87fe9b
commit
7c8c28ce96
1 changed files with 18 additions and 0 deletions
|
@ -187,6 +187,24 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
|
|||
};
|
||||
Some(node)
|
||||
},
|
||||
ast::LetStmt(it) => {
|
||||
let pat = it.pat()?;
|
||||
|
||||
let mut label = String::new();
|
||||
collapse_ws(pat.syntax(), &mut label);
|
||||
|
||||
let node = StructureNode {
|
||||
parent: None,
|
||||
label,
|
||||
navigation_range: pat.syntax().text_range(),
|
||||
node_range: it.syntax().text_range(),
|
||||
kind: StructureNodeKind::SymbolKind(SymbolKind::Local),
|
||||
detail: it.ty().map(|ty| ty.to_string()),
|
||||
deprecated: false,
|
||||
};
|
||||
|
||||
Some(node)
|
||||
},
|
||||
ast::Macro(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Macro)),
|
||||
_ => None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue