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 {
|
fix: Some(SourceChange {
|
||||||
label: "create module",
|
label: "create module",
|
||||||
source_file_edits: [],
|
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 }) }]"#,
|
cursor_position: None }) }]"#,
|
||||||
&diagnostics,
|
&diagnostics,
|
||||||
);
|
);
|
||||||
|
@ -4,7 +4,7 @@ use ra_syntax::{
|
|||||||
ast::{self, NameOwner},
|
ast::{self, NameOwner},
|
||||||
SmolStr,
|
SmolStr,
|
||||||
};
|
};
|
||||||
use relative_path::{RelativePathBuf, RelativePath};
|
use relative_path::RelativePathBuf;
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use arrayvec::ArrayVec;
|
use arrayvec::ArrayVec;
|
||||||
use ra_db::{SourceRoot, SourceRootId, Cancelable, FileId};
|
use ra_db::{SourceRoot, SourceRootId, Cancelable, FileId};
|
||||||
@ -184,11 +184,7 @@ fn resolve_submodule(
|
|||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
let problem = if points_to.is_empty() {
|
let problem = if points_to.is_empty() {
|
||||||
Some(Problem::UnresolvedModule {
|
Some(Problem::UnresolvedModule {
|
||||||
candidate: RelativePath::new("../").join(&if is_dir_owner {
|
candidate: if is_dir_owner { file_mod } else { file_dir_mod },
|
||||||
file_mod
|
|
||||||
} else {
|
|
||||||
file_dir_mod
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user