mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #5324
5324: Implementations lens for unions r=matklad a=matklad closes #4728 bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
02efda91d0
2 changed files with 9 additions and 3 deletions
|
@ -127,6 +127,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
|
|||
decl_with_detail(it, Some(detail))
|
||||
},
|
||||
ast::StructDef(it) => decl(it),
|
||||
ast::UnionDef(it) => decl(it),
|
||||
ast::EnumDef(it) => decl(it),
|
||||
ast::EnumVariant(it) => decl(it),
|
||||
ast::TraitDef(it) => decl(it),
|
||||
|
|
|
@ -878,9 +878,14 @@ pub(crate) fn handle_code_lens(
|
|||
snap.analysis
|
||||
.file_structure(file_id)?
|
||||
.into_iter()
|
||||
.filter(|it| match it.kind {
|
||||
SyntaxKind::TRAIT_DEF | SyntaxKind::STRUCT_DEF | SyntaxKind::ENUM_DEF => true,
|
||||
_ => false,
|
||||
.filter(|it| {
|
||||
matches!(
|
||||
it.kind,
|
||||
SyntaxKind::TRAIT_DEF
|
||||
| SyntaxKind::STRUCT_DEF
|
||||
| SyntaxKind::ENUM_DEF
|
||||
| SyntaxKind::UNION_DEF
|
||||
)
|
||||
})
|
||||
.map(|it| {
|
||||
let range = to_proto::range(&line_index, it.node_range);
|
||||
|
|
Loading…
Reference in a new issue