From 8602f9573b3a450b6a29c23bb4bfb7bd4108a89c Mon Sep 17 00:00:00 2001 From: ivan770 Date: Sun, 14 Mar 2021 12:52:04 +0200 Subject: Added region intersection test --- crates/ide/src/file_structure.rs | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'crates/ide/src') diff --git a/crates/ide/src/file_structure.rs b/crates/ide/src/file_structure.rs index 33d3c5323..c5ca6ff26 100644 --- a/crates/ide/src/file_structure.rs +++ b/crates/ide/src/file_structure.rs @@ -253,6 +253,13 @@ fn very_obsolete() {} // region: Some region name // endregion + +// region: dontpanic +mod m { +fn f() {} +// endregion +fn g() {} +} "#, expect![[r#" [ @@ -466,6 +473,52 @@ fn very_obsolete() {} detail: None, deprecated: false, }, + StructureNode { + parent: None, + label: "m", + navigation_range: 568..569, + node_range: 543..606, + kind: Module, + detail: None, + deprecated: false, + }, + StructureNode { + parent: Some( + 20, + ), + label: "dontpanic", + navigation_range: 543..563, + node_range: 543..563, + kind: Region, + detail: None, + deprecated: false, + }, + StructureNode { + parent: Some( + 20, + ), + label: "f", + navigation_range: 575..576, + node_range: 572..581, + kind: Function, + detail: Some( + "fn()", + ), + deprecated: false, + }, + StructureNode { + parent: Some( + 20, + ), + label: "g", + navigation_range: 598..599, + node_range: 582..604, + kind: Function, + detail: Some( + "fn()", + ), + deprecated: false, + }, ] "#]], ); -- cgit v1.2.3