diff options
author | Aleksey Kladov <[email protected]> | 2020-07-11 21:48:56 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-11 21:53:31 +0100 |
commit | b34cdf7bf47c87290500a573756e719a2699cd3b (patch) | |
tree | 801ffc4fd1ea6f19858700a2575988f6ae52fc3e | |
parent | 00c81f8006926b5a326d4dd11f61ea5ae09aadbd (diff) |
Implementations lens for unions
closes #4728
-rw-r--r-- | crates/ra_ide/src/display/structure.rs | 1 | ||||
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/crates/ra_ide/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs index c22a5d17b..1f6a3febf 100644 --- a/crates/ra_ide/src/display/structure.rs +++ b/crates/ra_ide/src/display/structure.rs | |||
@@ -127,6 +127,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
127 | decl_with_detail(it, Some(detail)) | 127 | decl_with_detail(it, Some(detail)) |
128 | }, | 128 | }, |
129 | ast::StructDef(it) => decl(it), | 129 | ast::StructDef(it) => decl(it), |
130 | ast::UnionDef(it) => decl(it), | ||
130 | ast::EnumDef(it) => decl(it), | 131 | ast::EnumDef(it) => decl(it), |
131 | ast::EnumVariant(it) => decl(it), | 132 | ast::EnumVariant(it) => decl(it), |
132 | ast::TraitDef(it) => decl(it), | 133 | ast::TraitDef(it) => decl(it), |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index d39dceae0..85758eed6 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -878,9 +878,14 @@ pub(crate) fn handle_code_lens( | |||
878 | snap.analysis | 878 | snap.analysis |
879 | .file_structure(file_id)? | 879 | .file_structure(file_id)? |
880 | .into_iter() | 880 | .into_iter() |
881 | .filter(|it| match it.kind { | 881 | .filter(|it| { |
882 | SyntaxKind::TRAIT_DEF | SyntaxKind::STRUCT_DEF | SyntaxKind::ENUM_DEF => true, | 882 | matches!( |
883 | _ => false, | 883 | it.kind, |
884 | SyntaxKind::TRAIT_DEF | ||
885 | | SyntaxKind::STRUCT_DEF | ||
886 | | SyntaxKind::ENUM_DEF | ||
887 | | SyntaxKind::UNION_DEF | ||
888 | ) | ||
884 | }) | 889 | }) |
885 | .map(|it| { | 890 | .map(|it| { |
886 | let range = to_proto::range(&line_index, it.node_range); | 891 | let range = to_proto::range(&line_index, it.node_range); |