mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Fix non canonicallized path for crate file
This commit is contained in:
parent
beb755caa2
commit
73e512215a
2 changed files with 6 additions and 2 deletions
|
@ -152,7 +152,9 @@ pub(crate) fn load(
|
|||
&extern_source_roots,
|
||||
proc_macro_client,
|
||||
&mut |path: &Path| {
|
||||
let vfs_file = vfs.load(path);
|
||||
// Some path from metadata will be non canonicalized, e.g. /foo/../bar/lib.rs
|
||||
let path = path.canonicalize().ok()?;
|
||||
let vfs_file = vfs.load(&path);
|
||||
log::debug!("vfs file {:?} -> {:?}", path, vfs_file);
|
||||
vfs_file.map(vfs_file_to_id)
|
||||
},
|
||||
|
|
|
@ -139,7 +139,9 @@ impl WorldState {
|
|||
// Create crate graph from all the workspaces
|
||||
let mut crate_graph = CrateGraph::default();
|
||||
let mut load = |path: &std::path::Path| {
|
||||
let vfs_file = vfs.load(path);
|
||||
// Some path from metadata will be non canonicalized, e.g. /foo/../bar/lib.rs
|
||||
let path = path.canonicalize().ok()?;
|
||||
let vfs_file = vfs.load(&path);
|
||||
vfs_file.map(|f| FileId(f.0))
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue