opencode
opencode copied to clipboard
formatters: `cargo fmt` is formatting whole workspace instead of edited file
Description
Newly added cargo fmt Rust formatter is invoked with cargo fmt -- $FILE but in practice is formatting the whole Cargo workspace.
cargo fmt actually does not support formatting single files
This change was introduced in version 1.1.2 by this commit: https://github.com/anomalyco/opencode/commit/cdd6ea514b94d8ce71770bb02f33ab979e9ee0f6
Plugins
none
OpenCode version
1.1.16
Steps to reproduce
- Create a Cargo project with 2 Rust files
- Introduce a change that would be formatted in file
A.rs - Ask to edit file
B.rsin opencode - both files
A.rsandB.rswould be formatted
Screenshot and/or share link
https://opncd.ai/share/elWQVtdO
Operating System
Omarchy
Terminal
Ghostty