fornwall / rust-script

Run Rust files and expressions as scripts without any setup or compilation step.
https://rust-script.org
Apache License 2.0
1.2k stars 41 forks source link

Use the source input file as bin path if possible #103

Closed MiSawa closed 1 year ago

MiSawa commented 1 year ago

Context: https://github.com/fornwall/rust-script/issues/11#issuecomment-1516408804

This PR makes rust-script not generate the source file in the package directory if possible, and let Cargo.toml refer to the given script file as the binary source path in that case. This will let cargo check on the package directory output the original file path instead of the generated one, which makes rust-analyzer correctly treat it in fly check.

fornwall commented 1 year ago

Thanks @MiSawa and nice work!

This has now been released in version 0.28.0.