diff options
-rw-r--r-- | crates/ra_analysis/tests/tests.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/module/imp.rs | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/crates/ra_analysis/tests/tests.rs b/crates/ra_analysis/tests/tests.rs index 889b568b9..67738da48 100644 --- a/crates/ra_analysis/tests/tests.rs +++ b/crates/ra_analysis/tests/tests.rs | |||
@@ -81,7 +81,7 @@ fn test_unresolved_module_diagnostic() { | |||
81 | fix: Some(SourceChange { | 81 | fix: Some(SourceChange { |
82 | label: "create module", | 82 | label: "create module", |
83 | source_file_edits: [], | 83 | source_file_edits: [], |
84 | file_system_edits: [CreateFile { anchor: FileId(1), path: "../foo.rs" }], | 84 | file_system_edits: [CreateFile { source_root: SourceRootId(0), path: "foo.rs" }], |
85 | cursor_position: None }) }]"#, | 85 | cursor_position: None }) }]"#, |
86 | &diagnostics, | 86 | &diagnostics, |
87 | ); | 87 | ); |
diff --git a/crates/ra_hir/src/module/imp.rs b/crates/ra_hir/src/module/imp.rs index f3a346152..748fdb64e 100644 --- a/crates/ra_hir/src/module/imp.rs +++ b/crates/ra_hir/src/module/imp.rs | |||
@@ -4,7 +4,7 @@ use ra_syntax::{ | |||
4 | ast::{self, NameOwner}, | 4 | ast::{self, NameOwner}, |
5 | SmolStr, | 5 | SmolStr, |
6 | }; | 6 | }; |
7 | use relative_path::{RelativePathBuf, RelativePath}; | 7 | use relative_path::RelativePathBuf; |
8 | use rustc_hash::{FxHashMap, FxHashSet}; | 8 | use rustc_hash::{FxHashMap, FxHashSet}; |
9 | use arrayvec::ArrayVec; | 9 | use arrayvec::ArrayVec; |
10 | use ra_db::{SourceRoot, SourceRootId, Cancelable, FileId}; | 10 | use ra_db::{SourceRoot, SourceRootId, Cancelable, FileId}; |
@@ -184,11 +184,7 @@ fn resolve_submodule( | |||
184 | .collect::<Vec<_>>(); | 184 | .collect::<Vec<_>>(); |
185 | let problem = if points_to.is_empty() { | 185 | let problem = if points_to.is_empty() { |
186 | Some(Problem::UnresolvedModule { | 186 | Some(Problem::UnresolvedModule { |
187 | candidate: RelativePath::new("../").join(&if is_dir_owner { | 187 | candidate: if is_dir_owner { file_mod } else { file_dir_mod }, |
188 | file_mod | ||
189 | } else { | ||
190 | file_dir_mod | ||
191 | }), | ||
192 | }) | 188 | }) |
193 | } else { | 189 | } else { |
194 | None | 190 | None |