From ba4c5021c4e6fb8e190de945cad7c453e770e529 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 26 Jan 2019 10:12:00 +0300 Subject: list enum variants in the outline --- .../src/snapshots/tests__file_structure.snap | 26 +++++++++++++++++++--- crates/ra_ide_api_light/src/structure.rs | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api_light') diff --git a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap b/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap index b96398950..270f75a56 100644 --- a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap +++ b/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap @@ -1,8 +1,8 @@ --- -created: "2019-01-24T18:04:00.090162+00:00" -creator: insta@0.4.0 +created: "2019-01-26T07:11:02.463391362+00:00" +creator: insta@0.5.2 expression: structure -source: "crates\\ra_ide_api_light\\src\\structure.rs" +source: crates/ra_ide_api_light/src/structure.rs --- [ StructureNode { @@ -77,6 +77,26 @@ source: "crates\\ra_ide_api_light\\src\\structure.rs" kind: ENUM_DEF, detail: None }, + StructureNode { + parent: Some( + 6 + ), + label: "X", + navigation_range: [169; 170), + node_range: [169; 170), + kind: ENUM_VARIANT, + detail: None + }, + StructureNode { + parent: Some( + 6 + ), + label: "Y", + navigation_range: [172; 173), + node_range: [172; 178), + kind: ENUM_VARIANT, + detail: None + }, StructureNode { parent: None, label: "T", diff --git a/crates/ra_ide_api_light/src/structure.rs b/crates/ra_ide_api_light/src/structure.rs index e3713c217..4e080ed03 100644 --- a/crates/ra_ide_api_light/src/structure.rs +++ b/crates/ra_ide_api_light/src/structure.rs @@ -103,6 +103,7 @@ fn structure_node(node: &SyntaxNode) -> Option { .visit(decl::) .visit(|nfd: &ast::NamedFieldDef| decl_with_type_ref(nfd, nfd.type_ref())) .visit(decl::) + .visit(decl::) .visit(decl::) .visit(decl::) .visit(|td: &ast::TypeDef| decl_with_type_ref(td, td.type_ref())) -- cgit v1.2.3