fix: cargo fmt actually does not support formatting single files

This commit is contained in:
Aiden Cline
2026-01-19 10:15:24 -06:00
parent b1684f3d12
commit 5b86724632

View File

@@ -347,13 +347,14 @@ export const rustfmt: Info = {
},
}
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
},
}
// 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
// },
// }