zed
zed copied to clipboard
wrong crate name of auto generated rust test task
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
rust's crate name's format is underscore style, eg: folder named my-crate will be renamed to my_crate, while the auto generated rust test task's name use my-crate instead of my_crate.
so, the generated task should be fixed from "cargo test -p my-crate test_some_function --nocapture" to "cargo test -p my_crate test_some_function --nocapture"
Environment
Zed: v0.132.2 (Zed Preview) OS: macOS 14.4.0 Memory: 16 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue.
No response
Can you elaborate why would the hyphen crate name usage in Zed tasks be wrong?
Here's a sample cargo new
project with hyphens and the test
it works for hyphened crate name both with Zed tasks
and the direct
cargo
invocations in the terminal
There's been an issue with the way we retrieved those package names (incorrectly in case there's been an override in Cargo.toml): https://github.com/zed-industries/zed/issues/10925 but it's fixed in https://github.com/zed-industries/zed/pull/10929 and as you can see in the PR, we are merely getting the human-readable package name out of the cargo pkgid
command, which also returns hyphens.
Thinking of this more, cargo pkgid
provides the hyphened names and cargo ... -p
commands work with these, so I will close this, as https://github.com/zed-industries/zed/pull/10929 should have fixed all related issues.
Please comment, if there's something that is not working for you still after that fix.
Great, it's working now, thank you for your hard working !