aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-11 21:53:57 +0100
committerGitHub <[email protected]>2020-07-11 21:53:57 +0100
commit02efda91d0fa856f0a2d33e9370147123c06abe7 (patch)
tree3acd92492af9b9894d802e0a50d2c5f02e0cabb7
parent2653440f1c75206bd98e575bca73681aa27979ee (diff)
parentb34cdf7bf47c87290500a573756e719a2699cd3b (diff)
Merge #5324
5324: Implementations lens for unions r=matklad a=matklad closes #4728 bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/ra_ide/src/display/structure.rs1
-rw-r--r--crates/rust-analyzer/src/handlers.rs11
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);