Skip to content

Commit 36d6148

Browse files
authored
Merge pull request #1000 from myzhan/dev.fix_block_on_related_path
fix: block forever when using a related path
2 parents 48ee7d7 + ca11f67 commit 36d6148

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • crates/emmylua_check/src

crates/emmylua_check/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ pub async fn run_check(cmd_args: CmdArgs) -> Result<(), Box<dyn Error + Sync + S
1818
.workspace
1919
.into_iter()
2020
.map(|workspace| {
21-
if workspace.is_absolute() {
21+
let path = if workspace.is_absolute() {
2222
workspace
2323
} else {
2424
cwd.join(workspace)
25-
}
25+
};
26+
// Canonicalize to resolve ".." components so the path matches
27+
// the workspace root registered via add_main_workspace.
28+
path.canonicalize().unwrap_or(path)
2629
})
2730
.collect();
2831
let main_path = workspaces
@@ -59,6 +62,9 @@ pub async fn run_check(cmd_args: CmdArgs) -> Result<(), Box<dyn Error + Sync + S
5962
sender.send((file_id, diagnostics)).await.unwrap();
6063
});
6164
}
65+
// Drop the original sender so the receiver can detect when all spawned
66+
// tasks have finished and their cloned senders are dropped.
67+
drop(sender);
6268

6369
let exit_code = output_result(
6470
need_check_files.len(),

0 commit comments

Comments
 (0)