The open source coding agent.
TypeScript
feat(opencode): add `dfmt` formatter support for D language files (#13867)
Robert Schadek160ba295a884
diff --git a/packages/opencode/src/format/formatter.ts b/packages/opencode/src/format/formatter.tsindex 41844695802..694c23d5583 100644--- a/packages/opencode/src/format/formatter.ts+++ b/packages/opencode/src/format/formatter.ts@@ -373,3 +373,12 @@ export const cljfmt: Info = {return Bun.which("cljfmt") !== null},}++export const dfmt: Info = {+ name: "dfmt",+ command: ["dfmt", "-i", "$FILE"],+ extensions: [".d"],+ async enabled() {+ return Bun.which("dfmt") !== null+ },+}diff --git a/packages/web/src/content/docs/ar/formatters.mdx b/packages/web/src/content/docs/ar/formatters.mdxindex a1d5478af3a..22ded4b9efe 100644--- a/packages/web/src/content/docs/ar/formatters.mdx+++ b/packages/web/src/content/docs/ar/formatters.mdx@@ -29,6 +29,7 @@ description: يستخدم OpenCode مُنسِّقات خاصة بكل لغة.| htmlbeautifier | .erb, .html.erb | يتوفر أمر `htmlbeautifier` || air | .R | يتوفر أمر `air` || dart | .dart | يتوفر أمر `dart` |+| dfmt | .d | يتوفر أمر `dfmt` || ocamlformat | .ml, .mli | يتوفر أمر `ocamlformat` وملف إعداد `.ocamlformat` || terraform | .tf, .tfvars | يتوفر أمر `terraform` || gleam | .gleam | يتوفر أمر `gleam` |diff --git a/packages/web/src/content/docs/bs/formatters.mdx b/packages/web/src/content/docs/bs/formatters.mdxindex 1b70e0906aa..af0b103ef5b 100644--- a/packages/web/src/content/docs/bs/formatters.mdx+++ b/packages/web/src/content/docs/bs/formatters.mdx@@ -27,6 +27,7 @@ OpenCode dolazi sa nekoliko ugrađenih formatera za popularne jezike i okvire. I| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` komanda dostupna || air | .R | `air` komanda dostupna || dart | .dart | `dart` komanda dostupna |+| dfmt | .d | `dfmt` komanda dostupna || ocamlformat | .ml, .mli | `ocamlformat` komanda dostupna i `.ocamlformat` konfiguracioni fajl || terraform | .tf, .tfvars | `terraform` komanda dostupna || gleam | .bleam | `gleam` komanda dostupna |diff --git a/packages/web/src/content/docs/da/formatters.mdx b/packages/web/src/content/docs/da/formatters.mdxindex 09ff611a66e..33a2d6ff3ad 100644--- a/packages/web/src/content/docs/da/formatters.mdx+++ b/packages/web/src/content/docs/da/formatters.mdx@@ -29,6 +29,7 @@ OpenCode leveres med flere indbyggede formatere til populære sprog og rammer. N| htmlbeautifier | .erb,.html.erb | `htmlbeautifier` kommando tilgængelig || luft | .R | `air` kommando tilgængelig || dart | .dart | `dart` kommando tilgængelig |+| dfmt | .d | `dfmt` kommando tilgængelig || ocamlformat | .ml,.mli | `ocamlformat` kommando tilgængelig og `.ocamlformat` config fil || terraform | .tf,.tfvars | `terraform` kommando tilgængelig || glimt | .glimt | `gleam` kommando tilgængelig |diff --git a/packages/web/src/content/docs/de/formatters.mdx b/packages/web/src/content/docs/de/formatters.mdxindex f953f16cb71..b50a91f7438 100644--- a/packages/web/src/content/docs/de/formatters.mdx+++ b/packages/web/src/content/docs/de/formatters.mdx@@ -29,6 +29,7 @@ OpenCode verfügt über mehrere integrierte Formatierer für gängige Sprachen u| htmlbeautifier | .erb, .html.erb | `htmlbeautifier`-Befehl verfügbar || air | .R | `air`-Befehl verfügbar || dart | .dart | `dart`-Befehl verfügbar |+| dfmt | .d | `dfmt`-Befehl verfügbar || ocamlformat | .ml, .mli | `ocamlformat` Befehl verfügbar und `.ocamlformat` Konfigurationsdatei || terraform | .tf, .tfvars | `terraform`-Befehl verfügbar || gleam | .gleam | `gleam`-Befehl verfügbar |diff --git a/packages/web/src/content/docs/es/formatters.mdx b/packages/web/src/content/docs/es/formatters.mdxindex f09ef925270..c17baf6e16c 100644--- a/packages/web/src/content/docs/es/formatters.mdx+++ b/packages/web/src/content/docs/es/formatters.mdx@@ -29,6 +29,7 @@ OpenCode viene con varios formateadores integrados para lenguajes y marcos popul| htmlbeautifier | .erb, .html.erb | Comando `htmlbeautifier` disponible || air | .R | Comando `air` disponible || dart | .dart | Comando `dart` disponible |+| dfmt | .d | Comando `dfmt` disponible || ocamlformat | .ml, .mli | Comando `ocamlformat` disponible y archivo de configuración `.ocamlformat` || terraform | .tf, .tfvars | Comando `terraform` disponible || gleam | .gleam | Comando `gleam` disponible |diff --git a/packages/web/src/content/docs/formatters.mdx b/packages/web/src/content/docs/formatters.mdxindex 0cb947b08f0..dbee49dca6f 100644--- a/packages/web/src/content/docs/formatters.mdx+++ b/packages/web/src/content/docs/formatters.mdx@@ -19,6 +19,7 @@ OpenCode comes with several built-in formatters for popular languages and framew| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file || cljfmt | .clj, .cljs, .cljc, .edn | `cljfmt` command available || dart | .dart | `dart` command available |+| dfmt | .d | `dfmt` command available || gleam | .gleam | `gleam` command available || gofmt | .go | `gofmt` command available || htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available |diff --git a/packages/web/src/content/docs/fr/formatters.mdx b/packages/web/src/content/docs/fr/formatters.mdxindex ef59b810819..96b5911efed 100644--- a/packages/web/src/content/docs/fr/formatters.mdx+++ b/packages/web/src/content/docs/fr/formatters.mdx@@ -29,6 +29,7 @@ OpenCode est livré avec plusieurs formateurs intégrés pour les langages et fr| htmlbeautifier | .erb, .html.erb | Commande `htmlbeautifier` disponible || air | .R | Commande `air` disponible || dart | .dart | Commande `dart` disponible |+| dfmt | .d | Commande `dfmt` disponible || ocamlformat | .ml, .mli | Commande `ocamlformat` disponible et fichier de configuration `.ocamlformat` || terraform | .tf, .tfvars | Commande `terraform` disponible || gleam | .gleam | Commande `gleam` disponible |diff --git a/packages/web/src/content/docs/it/formatters.mdx b/packages/web/src/content/docs/it/formatters.mdxindex b662db47eba..c264da3f4b7 100644--- a/packages/web/src/content/docs/it/formatters.mdx+++ b/packages/web/src/content/docs/it/formatters.mdx@@ -29,6 +29,7 @@ OpenCode include diversi formattatori integrati per linguaggi e framework popola| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available || air | .R | `air` command available || dart | .dart | `dart` command available |+| dfmt | .d | `dfmt` command available || ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file || terraform | .tf, .tfvars | `terraform` command available || gleam | .gleam | `gleam` command available |diff --git a/packages/web/src/content/docs/ja/formatters.mdx b/packages/web/src/content/docs/ja/formatters.mdxindex 04f5227e0e2..26bcbb5de5c 100644--- a/packages/web/src/content/docs/ja/formatters.mdx+++ b/packages/web/src/content/docs/ja/formatters.mdx@@ -29,6 +29,7 @@ OpenCode には、一般的な言語およびフレームワーク用のいく| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available || air | .R | `air` command available || dart | .dart | `dart` command available |+| dfmt | .d | `dfmt` command available || ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file || terraform | .tf, .tfvars | `terraform` command available || gleam | .gleam | `gleam` command available |diff --git a/packages/web/src/content/docs/ko/formatters.mdx b/packages/web/src/content/docs/ko/formatters.mdxindex c2e539be6f4..acdde12d3b4 100644--- a/packages/web/src/content/docs/ko/formatters.mdx+++ b/packages/web/src/content/docs/ko/formatters.mdx@@ -28,6 +28,7 @@ opencode는 인기있는 언어 및 프레임 워크에 대한 몇 가지 내장| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` 명령 사용 가능 || Air | .R | `air` 명령 사용 가능 || Dart | 다트 | `dart` 명령 |+| dfmt | .d | `dfmt` 명령 사용 가능 || ocamlformat | .ml, .mli | `ocamlformat` 명령 사용 가능·`.ocamlformat` 설정 파일 || Terraform | .tf, .tfvars | `terraform` 명령 사용 가능 || gleam | .gleam | `gleam` 명령 사용 가능 |diff --git a/packages/web/src/content/docs/nb/formatters.mdx b/packages/web/src/content/docs/nb/formatters.mdxindex b9fe99a4486..9619c1470aa 100644--- a/packages/web/src/content/docs/nb/formatters.mdx+++ b/packages/web/src/content/docs/nb/formatters.mdx@@ -29,6 +29,7 @@ OpenCode kommer med flere innebygde formattere for populære språk og rammeverk| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` kommando tilgjengelig || air | .R | `air` kommando tilgjengelig || dart | .dart | `dart` kommando tilgjengelig |+| dfmt | .d | `dfmt` kommando tilgjengelig || ocamlformat | .ml, .mli | `ocamlformat` kommando tilgjengelig og `.ocamlformat` konfigurasjonsfil || terraform | .tf, .tfvars | `terraform` kommando tilgjengelig || gleam | .gleam | `gleam` kommando tilgjengelig |diff --git a/packages/web/src/content/docs/pl/formatters.mdx b/packages/web/src/content/docs/pl/formatters.mdxindex 154c55ef8e1..593e407f4f6 100644--- a/packages/web/src/content/docs/pl/formatters.mdx+++ b/packages/web/src/content/docs/pl/formatters.mdx@@ -29,6 +29,7 @@ OpenCode zawiera kilka wbudowanych formaterów dla popularnych języków i frame| htmlbeautifier | .erb, .html.erb | Dostępne polecenie `htmlbeautifier` || air | .R | Dostępne polecenie `air` || dart | .dart | Dostępne polecenie `dart` |+| dfmt | .d | Dostępne polecenie `dfmt` || ocamlformat | .ml, .mli | Dostępne polecenie `ocamlformat` i plik konfiguracyjny `.ocamlformat` || terraform | .tf, .tfvars | Dostępne polecenie `terraform` || gleam | .gleam | Dostępne polecenie `gleam` |diff --git a/packages/web/src/content/docs/pt-br/formatters.mdx b/packages/web/src/content/docs/pt-br/formatters.mdxindex 3037e7b65b1..65fb5d2e60a 100644--- a/packages/web/src/content/docs/pt-br/formatters.mdx+++ b/packages/web/src/content/docs/pt-br/formatters.mdx@@ -29,6 +29,7 @@ O opencode vem com vários formatadores integrados para linguagens e frameworks| htmlbeautifier | .erb, .html.erb | Comando `htmlbeautifier` disponível || air | .R | Comando `air` disponível || dart | .dart | Comando `dart` disponível |+| dfmt | .d | Comando `dfmt` disponível || ocamlformat | .ml, .mli | Comando `ocamlformat` disponível e arquivo de configuração `.ocamlformat` || terraform | .tf, .tfvars | Comando `terraform` disponível || gleam | .gleam | Comando `gleam` disponível |diff --git a/packages/web/src/content/docs/ru/formatters.mdx b/packages/web/src/content/docs/ru/formatters.mdxindex 8712e39c63c..ec7730483f8 100644--- a/packages/web/src/content/docs/ru/formatters.mdx+++ b/packages/web/src/content/docs/ru/formatters.mdx@@ -29,6 +29,7 @@ opencode поставляется с несколькими встроенным| htmlbeautifier | .erb, .html.erb | Доступна команда `htmlbeautifier` || air | .R | Доступна команда `air` || dart | .dart | Доступна команда `dart` |+| dfmt | .d | Доступна команда `dfmt` || ocamlformat | .ml, .mli | Доступна команда `ocamlformat` и файл конфигурации `.ocamlformat`. || terraform | .tf, .tfvars | Доступна команда `terraform` || gleam | .gleam | Доступна команда `gleam` |diff --git a/packages/web/src/content/docs/th/formatters.mdx b/packages/web/src/content/docs/th/formatters.mdxindex e852cb45dc3..8b6122ca696 100644--- a/packages/web/src/content/docs/th/formatters.mdx+++ b/packages/web/src/content/docs/th/formatters.mdx@@ -29,6 +29,7 @@ OpenCode มาพร้อมกับฟอร์แมตเตอร์ใ| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` คำสั่งใช้ได้ || air | .r | `air` คำสั่งใช้ได้ || dart | .dart | `dart` คำสั่งใช้ได้ |+| dfmt | .d | `dfmt` คำสั่งใช้ได้ || ocamlformat | .ml, .mli | มีคำสั่ง `ocamlformat` และไฟล์ปรับแต่ง `.ocamlformat` || terraform | .tf, .tfvars | `terraform` คำสั่งใช้ได้ || gleam | .gleam | `gleam` คำสั่งใช้ได้ |diff --git a/packages/web/src/content/docs/tr/formatters.mdx b/packages/web/src/content/docs/tr/formatters.mdxindex b6db406e167..34311baa7a9 100644--- a/packages/web/src/content/docs/tr/formatters.mdx+++ b/packages/web/src/content/docs/tr/formatters.mdx@@ -29,6 +29,7 @@ opencode, popüler diller ve çerçeveler için çeşitli yerleşik biçimlendir| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` komutu mevcut || air | .R | `air` komutu mevcut || dart | .dart | `dart` komutu mevcut |+| dfmt | .d | `dfmt` komutu mevcut || ocamlformat | .ml, .mli | `ocamlformat` komutu mevcut ve `.ocamlformat` yapılandırma dosyası || terraform | .tf, .tfvars | `terraform` komutu mevcut || gleam | .gleam | `gleam` komutu mevcut |diff --git a/packages/web/src/content/docs/zh-cn/formatters.mdx b/packages/web/src/content/docs/zh-cn/formatters.mdxindex 8e080d85f8f..8c4d7ef8fad 100644--- a/packages/web/src/content/docs/zh-cn/formatters.mdx+++ b/packages/web/src/content/docs/zh-cn/formatters.mdx@@ -29,6 +29,7 @@ opencode 附带了多个适用于流行语言和框架的内置格式化程序| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available || air | .R | `air` command available || dart | .dart | `dart` command available |+| dfmt | .d | `dfmt` command available || ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file || terraform | .tf, .tfvars | `terraform` command available || gleam | .gleam | `gleam` command available |diff --git a/packages/web/src/content/docs/zh-tw/formatters.mdx b/packages/web/src/content/docs/zh-tw/formatters.mdxindex 2ded1419de1..45a7c6cd718 100644--- a/packages/web/src/content/docs/zh-tw/formatters.mdx+++ b/packages/web/src/content/docs/zh-tw/formatters.mdx@@ -29,6 +29,7 @@ opencode 附帶了多個適用於流行語言和框架的內建格式化程式| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` 指令可用 || air | .R | `air` 指令可用 || dart | .dart | `dart` 指令可用 |+| dfmt | .d | `dfmt` 指令可用 || ocamlformat | .ml, .mli | `ocamlformat` 指令可用,且存在 `.ocamlformat` 設定檔 || terraform | .tf, .tfvars | `terraform` 指令可用 || gleam | .gleam | `gleam` 指令可用 |