https://github.com/c-geek/cucumber_jetbrains
Showcase for IntelliJ bug with Rust Cucumber
https://github.com/c-geek/cucumber_jetbrains
Last synced: 5 months ago
JSON representation
Showcase for IntelliJ bug with Rust Cucumber
- Host: GitHub
- URL: https://github.com/c-geek/cucumber_jetbrains
- Owner: c-geek
- Created: 2023-04-13T09:53:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-13T09:55:29.000Z (over 2 years ago)
- Last Synced: 2025-06-01T12:03:31.638Z (5 months ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bug demonstrator
## Expected behavior
cargo test
[...]
3 steps (3 passed)
## IntelliJ behavior
1. Run/Debug configurations > Cargo > Command "test"
2. Launch configuration :
> Note the extra options `--color=always --no-fail-fast -- --format=json -Z unstable-options --show-output`
```bash
/Users/cgeek/.cargo/bin/cargo test --color=always --no-fail-fast -- --format=json -Z unstable-options --show-output
[...]
error: unexpected argument '--format' found
```
## Explanation
IntelliJ Rust plugin adds `--color=always --no-fail-fast -- --format=json -Z unstable-options --show-output` extra
options, which are not handled by cucumber parser.
## Solutions
### 1. Handle the specific IntelliJ problem in the tests
```rust
struct CustomOpts {
/// For compliance with Jetbrains IDE which pushes extra args.
#[clap(short, long)]
format: Option,
#[clap(short, long = "show-output")]
show_output: bool,
#[clap(short = 'Z', long)]
z: Option,
/// [...]
}
```
### 2. Jetbrains allows to disable the extra options
In the Run/Debug configuration, allow to disable the `--color=always --no-fail-fast -- --format=json -Z unstable-options --show-output` extra options, so these
do not appear in the call.