diff options
| author | Goni Zahavy <[email protected]> | 2026-01-19 18:48:59 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-19 10:48:59 -0600 |
| commit | d5ae8e0bef991f2b2ad9766b9ae2f1c903badab3 (patch) | |
| tree | 9a474d8c7def04854325602916aa78d5cc4d0bdf | |
| parent | 453417ed47774fc3077ef67c49c831b4014494f4 (diff) | |
| download | opencode-d5ae8e0bef991f2b2ad9766b9ae2f1c903badab3.tar.gz opencode-d5ae8e0bef991f2b2ad9766b9ae2f1c903badab3.zip | |
fix(opencode): `cargo fmt` is formatting whole workspace instead of edited file (#9436)
| -rw-r--r-- | packages/opencode/src/format/formatter.ts | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/packages/opencode/src/format/formatter.ts b/packages/opencode/src/format/formatter.ts index 1c58d5b8d..1a3aa1bb1 100644 --- a/packages/opencode/src/format/formatter.ts +++ b/packages/opencode/src/format/formatter.ts @@ -337,24 +337,6 @@ export const rustfmt: Info = { command: ["rustfmt", "$FILE"], extensions: [".rs"], async enabled() { - if (!Bun.which("rustfmt")) return false - const configs = ["rustfmt.toml", ".rustfmt.toml"] - for (const config of configs) { - const found = await Filesystem.findUp(config, Instance.directory, Instance.worktree) - if (found.length > 0) return true - } - return false + return Bun.which("rustfmt") !== null }, } - -// cargo fmt actually does not support formatting single files -// export const cargofmt: Info = { -// name: "cargofmt", -// command: ["cargo", "fmt", "--", "$FILE"], -// extensions: [".rs"], -// async enabled() { -// if (!Bun.which("cargo")) return false -// const found = await Filesystem.findUp("Cargo.toml", Instance.directory, Instance.worktree) -// return found.length > 0 -// }, -// } |
