Skip to content

Commit 5b5b5fa

Browse files
committed
rust_analyzer: follow symlink
1 parent f21e479 commit 5b5b5fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/rust_analyzer/rust_project.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ 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()).unwrap_or(f.clone())
257+
}
258+
255259
pub fn assemble_rust_project(
256260
bazel: &Utf8Path,
257261
workspace: &Utf8Path,
@@ -337,7 +341,7 @@ pub fn assemble_rust_project(
337341

338342
project.crates.push(Crate {
339343
display_name: Some(c.display_name.clone()),
340-
root_module: c.root_module.clone(),
344+
root_module: try_symlink(&c.root_module),
341345
edition: c.edition.clone(),
342346
deps: c
343347
.deps

0 commit comments

Comments
 (0)