@@ -7,32 +7,32 @@ use syntax::{
77
88use crate :: NavigationTarget ;
99
10- // Feature: Children Modules
10+ // Feature: Child Modules
1111//
12- // Navigates to the children modules of the current module.
12+ // Navigates to the child modules of the current module.
1313//
1414// | Editor | Action Name |
1515// |---------|-------------|
16- // | VS Code | **rust-analyzer: Locate children modules** |
16+ // | VS Code | **rust-analyzer: Locate child modules** |
1717
1818/// This returns `Vec` because a module may be included from several places.
19- pub ( crate ) fn children_modules ( db : & RootDatabase , position : FilePosition ) -> Vec < NavigationTarget > {
19+ pub ( crate ) fn child_modules ( db : & RootDatabase , position : FilePosition ) -> Vec < NavigationTarget > {
2020 let sema = Semantics :: new ( db) ;
2121 let source_file = sema. parse_guess_edition ( position. file_id ) ;
2222 // First go to the parent module which contains the cursor
2323 let module = find_node_at_offset :: < ast:: Module > ( source_file. syntax ( ) , position. offset ) ;
2424
2525 match module {
2626 Some ( module) => {
27- // Return all the children module inside the ItemList of the parent module
27+ // Return all child modules inside the ItemList of the parent module
2828 sema. to_def ( & module)
2929 . into_iter ( )
3030 . flat_map ( |module| module. children ( db) )
3131 . map ( |module| NavigationTarget :: from_module_to_decl ( db, module) . call_site ( ) )
3232 . collect ( )
3333 }
3434 None => {
35- // Return all the children module inside the source file
35+ // Return all the child modules inside the source file
3636 sema. file_to_module_defs ( position. file_id )
3737 . flat_map ( |module| module. children ( db) )
3838 . map ( |module| NavigationTarget :: from_module_to_decl ( db, module) . call_site ( ) )
@@ -47,9 +47,9 @@ mod tests {
4747
4848 use crate :: fixture;
4949
50- fn check_children_module ( #[ rust_analyzer:: rust_fixture] ra_fixture : & str ) {
50+ fn check_child_module ( #[ rust_analyzer:: rust_fixture] ra_fixture : & str ) {
5151 let ( analysis, position, expected) = fixture:: annotations ( ra_fixture) ;
52- let navs = analysis. children_modules ( position) . unwrap ( ) ;
52+ let navs = analysis. child_modules ( position) . unwrap ( ) ;
5353 let navs = navs
5454 . iter ( )
5555 . map ( |nav| FileRange { file_id : nav. file_id , range : nav. focus_or_full_range ( ) } )
@@ -58,8 +58,8 @@ mod tests {
5858 }
5959
6060 #[ test]
61- fn test_resolve_children_module ( ) {
62- check_children_module (
61+ fn test_resolve_child_module ( ) {
62+ check_child_module (
6363 r#"
6464//- /lib.rs
6565$0
@@ -73,8 +73,8 @@ mod foo;
7373 }
7474
7575 #[ test]
76- fn test_resolve_children_module_on_module_decl ( ) {
77- check_children_module (
76+ fn test_resolve_child_module_on_module_decl ( ) {
77+ check_child_module (
7878 r#"
7979//- /lib.rs
8080mod $0foo;
@@ -89,8 +89,8 @@ mod bar;
8989 }
9090
9191 #[ test]
92- fn test_resolve_children_module_for_inline ( ) {
93- check_children_module (
92+ fn test_resolve_child_module_for_inline ( ) {
93+ check_child_module (
9494 r#"
9595//- /lib.rs
9696mod foo {
@@ -104,7 +104,7 @@ mod foo {
104104
105105 #[ test]
106106 fn test_resolve_multi_child_module ( ) {
107- check_children_module (
107+ check_child_module (
108108 r#"
109109//- /main.rs
110110$0
0 commit comments