mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
parent
00c81f8006
commit
b34cdf7bf4
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