File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/tools/rust-analyzer/crates/ide/src Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments