Skip to content

Commit fa0d962

Browse files
committed
rust_analyzer: follow symlink
1 parent f21e479 commit fa0d962

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/rust_analyzer/rust_project.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ pub enum RunnableKind {
252252
TestOne,
253253
}
254254

255+
fn try_symlink(f: &String) -> String {
256+
std::fs::read_link(f).map(|v| v.to_string_lossy().to_string())
257+
.unwrap_or(f.clone())
258+
}
259+
255260
pub fn assemble_rust_project(
256261
bazel: &Utf8Path,
257262
workspace: &Utf8Path,
@@ -337,7 +342,7 @@ pub fn assemble_rust_project(
337342

338343
project.crates.push(Crate {
339344
display_name: Some(c.display_name.clone()),
340-
root_module: c.root_module.clone(),
345+
root_module: try_symlink(&c.root_module),
341346
edition: c.edition.clone(),
342347
deps: c
343348
.deps

0 commit comments

Comments
 (0)