use root-relative paths
This commit is contained in:
parent
b5b44659a4
commit
fd927ea3a9
@ -81,7 +81,7 @@ fn test_unresolved_module_diagnostic() {
|
||||
fix: Some(SourceChange {
|
||||
label: "create module",
|
||||
source_file_edits: [],
|
||||
file_system_edits: [CreateFile { anchor: FileId(1), path: "../foo.rs" }],
|
||||
file_system_edits: [CreateFile { source_root: SourceRootId(0), path: "foo.rs" }],
|
||||
cursor_position: None }) }]"#,
|
||||
&diagnostics,
|
||||
);
|
||||
|
@ -4,7 +4,7 @@ use ra_syntax::{
|
||||
ast::{self, NameOwner},
|
||||
SmolStr,
|
||||
};
|
||||
use relative_path::{RelativePathBuf, RelativePath};
|
||||
use relative_path::RelativePathBuf;
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use arrayvec::ArrayVec;
|
||||
use ra_db::{SourceRoot, SourceRootId, Cancelable, FileId};
|
||||
@ -184,11 +184,7 @@ fn resolve_submodule(
|
||||
.collect::<Vec<_>>();
|
||||
let problem = if points_to.is_empty() {
|
||||
Some(Problem::UnresolvedModule {
|
||||
candidate: RelativePath::new("../").join(&if is_dir_owner {
|
||||
file_mod
|
||||
} else {
|
||||
file_dir_mod
|
||||
}),
|
||||
candidate: if is_dir_owner { file_mod } else { file_dir_mod },
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
Loading…
x
Reference in New Issue
Block a user