From 4742390960d6fa41ba7ea53cd3cd17a8d7f48084 Mon Sep 17 00:00:00 2001 From: Andrea C from The App <3269984+gacallea@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:36:02 +0200 Subject: [PATCH] feat(lang): add elm (#3023) Adding https://elm-lang.org support. - Adds `elm` Treesitter parsers - Adds `elm-language-server` language server - Adds `elm-format` formatter ## LSP Configuration The default [elm-language-server](https://github.com/elm-tooling/elm-language-server) configuration matches all [currently supported features for Neovim LSP](https://github.com/elm-tooling/elm-language-server#editor-support). ## A note on elm-test and elm-review `elm-test` is not directly supported by [neo-test](../test/neotest) but it's available via [neotest-vim-test](https://github.com/nvim-neotest/neotest-vim-test). However, it is common practice to peruse both [elm-test](https://github.com/elm-explorations/test/) and [elm-review](https://github.com/jfmengels/elm-review) directly via the command line. --------- Co-authored-by: gacallea Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/elm.lua | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/elm.lua diff --git a/lua/lazyvim/plugins/extras/lang/elm.lua b/lua/lazyvim/plugins/extras/lang/elm.lua new file mode 100644 index 00000000..28c5339f --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/elm.lua @@ -0,0 +1,42 @@ +return { + recommended = { + ft = { "elm" }, + root = { "elm.json" }, + }, + + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "elm" }) + end + end, + }, + + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "elm-format" }) + end, + }, + + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + elm = { "elm_format" }, + }, + }, + }, + + { + "neovim/nvim-lspconfig", + opts = { + servers = { + elmls = {}, + }, + }, + }, +}