소스 검색

feat(opencode): add `dfmt` formatter support for D language files (#13867)

Robert Schadek 1 개월 전
부모
커밋
160ba295a8

+ 9 - 0
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
+  },
+}

+ 1 - 0
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`                                                                       |

+ 1 - 0
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 |

+ 1 - 0
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                                                                         |

+ 1 - 0
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                                                                                   |

+ 1 - 0
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                                                                                             |

+ 1 - 0
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                                                                    |

+ 1 - 0
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                                                                                           |

+ 1 - 0
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                                                                             |

+ 1 - 0
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                                                                             |

+ 1 - 0
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` 명령 사용 가능                                                                        |

+ 1 - 0
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                                                                           |

+ 1 - 0
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`                                                            |

+ 1 - 0
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                                                                               |

+ 1 - 0
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`                                                                                      |

+ 1 - 0
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` คำสั่งใช้ได้                                                                    |

+ 1 - 0
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                                                                                  |

+ 1 - 0
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                                                                             |

+ 1 - 0
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` 指令可用                                                                      |