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
I am very excited about the new plugin version with the enhanced command handling (#165). However I have noticed that the arguments themselves are intended for a target itself rather than for rustc/cargo.
For example, "Rust Enhanced - Run (with args)" actually spawns cargo run -- ARGS rather than cargo run ARGS.
It would be convenient to run a particular binary, example or test, or whatever:
Run (with args): --example one => cargo run --example one
Run (with args): --bin one -- bin-args => cargo run --bin one -- bin-args
Sublime Text Version
Sublime Text 3 (Build 3156)
Rust Enhanced Version
2.8.0
Operating system
OS Name: Microsoft Windows 7 x64
Version: 6.1 Build 7601
References
Are there any other GitHub issues (open or closed) that should be linked here?
If you just want to pick the target (such as --example one), I recommend using the "Automatic" build variant. It automatically picks the cargo command and target based on the view that is currently in focus. So if you have an example binary open, it will do cargo run --example foo. If you have a test file open, it will run cargo test --test bar.
You can manually specify the arguments via Sublime settings. Try running the command "Rust: Configure Cargo Build" which will assist you in configuring the settings. Most of the common settings are there, including a free-form "arguments" section (see docs).
Another approach is to create custom build variants. Run the command "Rust: Create New Cargo Build Variant". This will create a new build definition inside your .sublime-project file. You could use this to define a command cargo run --bin one -- my args, and then set that as your build variant. This is a more advanced approach, but allows you to define different setups that you can fairly easily switch between.
I am very excited about the new plugin version with the enhanced command handling (#165). However I have noticed that the arguments themselves are intended for a target itself rather than for rustc/cargo.
For example, "Rust Enhanced - Run (with args)" actually spawns
cargo run -- ARGS
rather thancargo run ARGS
.It would be convenient to run a particular binary, example or test, or whatever:
Run (with args):
--example one
=>cargo run --example one
Run (with args):
--bin one -- bin-args
=>cargo run --bin one -- bin-args
Sublime Text Version
Sublime Text 3 (Build 3156)
Rust Enhanced Version
2.8.0
Operating system
OS Name: Microsoft Windows 7 x64
Version: 6.1 Build 7601
References
Are there any other GitHub issues (open or closed) that should be linked here?
The text was updated successfully, but these errors were encountered: