Skip to content

Commit 02efda9

Browse files
bors[bot]matklad
andauthored
Merge #5324
5324: Implementations lens for unions r=matklad a=matklad closes #4728 bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 2653440 + b34cdf7 commit 02efda9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/ra_ide/src/display/structure.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
127127
decl_with_detail(it, Some(detail))
128128
},
129129
ast::StructDef(it) => decl(it),
130+
ast::UnionDef(it) => decl(it),
130131
ast::EnumDef(it) => decl(it),
131132
ast::EnumVariant(it) => decl(it),
132133
ast::TraitDef(it) => decl(it),

crates/rust-analyzer/src/handlers.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,14 @@ pub(crate) fn handle_code_lens(
878878
snap.analysis
879879
.file_structure(file_id)?
880880
.into_iter()
881-
.filter(|it| match it.kind {
882-
SyntaxKind::TRAIT_DEF | SyntaxKind::STRUCT_DEF | SyntaxKind::ENUM_DEF => true,
883-
_ => false,
881+
.filter(|it| {
882+
matches!(
883+
it.kind,
884+
SyntaxKind::TRAIT_DEF
885+
| SyntaxKind::STRUCT_DEF
886+
| SyntaxKind::ENUM_DEF
887+
| SyntaxKind::UNION_DEF
888+
)
884889
})
885890
.map(|it| {
886891
let range = to_proto::range(&line_index, it.node_range);

0 commit comments

Comments
 (0)