Skip to content

Commit

Permalink
add LetStmt arm
Browse files Browse the repository at this point in the history
  • Loading branch information
LastExceed committed Oct 27, 2024
1 parent 3b3a87f commit 7c8c28c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/ide/src/file_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 7c8c28c

Please sign in to comment.