From 1199b61b952d61fee576b74c8a31292a8a57722b Mon Sep 17 00:00:00 2001 From: Kyra Date: Tue, 19 Nov 2024 22:18:37 -0600 Subject: [PATCH] Add formatters for Elm, Haskell, Python, and TypeScript This commit adds `elm-format` for Elm, `ormolu` for Haskell, `black` for Python, and `prettier` for TypeScript, Javascript, TSX, JSX, etc. --- languages.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/languages.toml b/languages.toml index ea6e6893f..d9f6c8fd7 100644 --- a/languages.toml +++ b/languages.toml @@ -750,6 +750,7 @@ roots = [ "package.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] +formatter = { command = "biome", args = ["format"] } indent = { tab-width = 2, unit = " " } [language.debugger] @@ -778,6 +779,7 @@ roots = [ "package.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] +formatter = { command = "biome", args = ["format"] } indent = { tab-width = 2, unit = " " } grammar = "javascript" @@ -792,6 +794,7 @@ roots = [ "package.json", "tsconfig.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] +formatter = { command = "biome", args = ["format"] } indent = { tab-width = 2, unit = " " } [[grammar]] @@ -825,6 +828,7 @@ roots = [ "package.json", "tsconfig.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] +formatter = { command = "biome", args = ["format"] } indent = { tab-width = 2, unit = " " } [[grammar]] @@ -882,6 +886,7 @@ shebangs = ["python"] roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"] comment-token = "#" language-servers = ["ruff", "jedi", "pylsp"] +formatter = { command = "black", args = ["-"]} # TODO: pyls needs utf-8 offsets indent = { tab-width = 4, unit = " " } @@ -1354,6 +1359,7 @@ roots = ["Setup.hs", "stack.yaml", "cabal.project"] comment-token = "--" block-comment-tokens = { start = "{-", end = "-}" } language-servers = [ "haskell-language-server" ] +formatter = { command = "ormolu" } indent = { tab-width = 2, unit = " " } [[grammar]] @@ -1807,6 +1813,7 @@ auto-format = true comment-token = "--" block-comment-tokens = { start = "{-", end = "-}" } language-servers = [ "elm-language-server" ] +formatter = { command = "elm-format", args = ["--stdin"] } indent = { tab-width = 4, unit = " " } [[grammar]] @@ -3793,6 +3800,7 @@ language-servers = [ "vscode-eslint-language-server", "ember-language-server", ] +formatter = { command = "biome", args = ["format"] } indent = { tab-width = 2, unit = " " } grammar = "javascript" @@ -3817,6 +3825,7 @@ language-servers = [ "vscode-eslint-language-server", "ember-language-server", ] +formatter = { command = "biome", args = ["format"] } indent = { tab-width = 2, unit = " " } grammar = "typescript"