diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/assists/src/handlers/extract_module_to_file.rs | 8 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/mod_resolution.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/assists/src/handlers/extract_module_to_file.rs b/crates/assists/src/handlers/extract_module_to_file.rs index 3e67fdca2..50bf67ef7 100644 --- a/crates/assists/src/handlers/extract_module_to_file.rs +++ b/crates/assists/src/handlers/extract_module_to_file.rs | |||
@@ -91,18 +91,18 @@ mod tests; | |||
91 | extract_module_to_file, | 91 | extract_module_to_file, |
92 | r#" | 92 | r#" |
93 | //- /main.rs | 93 | //- /main.rs |
94 | mod submodule; | 94 | mod submod; |
95 | //- /submodule.rs | 95 | //- /submod.rs |
96 | mod inner<|> { | 96 | mod inner<|> { |
97 | fn f() {} | 97 | fn f() {} |
98 | } | 98 | } |
99 | fn g() {} | 99 | fn g() {} |
100 | "#, | 100 | "#, |
101 | r#" | 101 | r#" |
102 | //- /submodule.rs | 102 | //- /submod.rs |
103 | mod inner; | 103 | mod inner; |
104 | fn g() {} | 104 | fn g() {} |
105 | //- /submodule/inner.rs | 105 | //- /submod/inner.rs |
106 | fn f() {} | 106 | fn f() {} |
107 | "#, | 107 | "#, |
108 | ); | 108 | ); |
diff --git a/crates/hir_def/src/nameres/mod_resolution.rs b/crates/hir_def/src/nameres/mod_resolution.rs index b4ccd4488..af3262439 100644 --- a/crates/hir_def/src/nameres/mod_resolution.rs +++ b/crates/hir_def/src/nameres/mod_resolution.rs | |||
@@ -79,7 +79,7 @@ impl ModDir { | |||
79 | for candidate in candidate_files.iter() { | 79 | for candidate in candidate_files.iter() { |
80 | let path = AnchoredPath { anchor: file_id, path: candidate.as_str() }; | 80 | let path = AnchoredPath { anchor: file_id, path: candidate.as_str() }; |
81 | if let Some(file_id) = db.resolve_path(path) { | 81 | if let Some(file_id) = db.resolve_path(path) { |
82 | let is_mod_rs = candidate.ends_with("mod.rs"); | 82 | let is_mod_rs = candidate.ends_with("/mod.rs"); |
83 | 83 | ||
84 | let (dir_path, root_non_dir_owner) = if is_mod_rs || attr_path.is_some() { | 84 | let (dir_path, root_non_dir_owner) = if is_mod_rs || attr_path.is_some() { |
85 | (DirPath::empty(), false) | 85 | (DirPath::empty(), false) |