You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can pass --message-format=json-render-diagnostics instead of just --message-format=json. Then, all warnings will be printed to cargo's stderr with proper formatting, and you can just inherit that to do syntax highlighting.
Instead of just grabbing the last artifact, you should grab everything where target.executable exists for when there's multiple binaries, such as in workspaces:
You can use cargo_metadata to do that parsing, or whatever JSON parser.
Another thing is that you're requiring the user to pass in a few parameters. What I like to do instead is use the [metadata] section of the Cargo.toml to store that data, so you don't have to keep passing it in. Just thought I'd mention it.
The text was updated successfully, but these errors were encountered:
Now that I've started writing my own cargo subcommand as you recommended on the forums, I thought I'd share some of my findings.
cargo-n64/cargo-n64/src/cargo.rs
Line 137 in 1dbff85
You can pass
--message-format=json-render-diagnostics
instead of just--message-format=json
. Then, all warnings will be printed to cargo's stderr with proper formatting, and you can justinherit
that to do syntax highlighting.cargo-n64/cargo-n64/src/cargo.rs
Line 124 in 1dbff85
Instead of just grabbing the last artifact, you should grab everything where
target.executable
exists for when there's multiple binaries, such as in workspaces:You can use cargo_metadata to do that parsing, or whatever JSON parser.
Another thing is that you're requiring the user to pass in a few parameters. What I like to do instead is use the [
metadata
] section of theCargo.toml
to store that data, so you don't have to keep passing it in. Just thought I'd mention it.The text was updated successfully, but these errors were encountered: