From 2f04d6e472f78718ba1cbcf5e1c24b4d95c6fcd3 Mon Sep 17 00:00:00 2001 From: Andrea C from The App <3269984+gacallea@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:06:58 +0100 Subject: [PATCH] feat(pack): add elm language pack (#653) Co-authored-by: gacallea --- lua/astrocommunity/pack/elm/README.md | 23 +++++++++++++++++++++++ lua/astrocommunity/pack/elm/init.lua | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 lua/astrocommunity/pack/elm/README.md create mode 100644 lua/astrocommunity/pack/elm/init.lua diff --git a/lua/astrocommunity/pack/elm/README.md b/lua/astrocommunity/pack/elm/README.md new file mode 100644 index 000000000..f879b1f45 --- /dev/null +++ b/lua/astrocommunity/pack/elm/README.md @@ -0,0 +1,23 @@ +# Elm Language Pack + +This plugin pack does the following: + +- 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` and `elm-review` +directly via the command line. diff --git a/lua/astrocommunity/pack/elm/init.lua b/lua/astrocommunity/pack/elm/init.lua new file mode 100644 index 000000000..29f60bfed --- /dev/null +++ b/lua/astrocommunity/pack/elm/init.lua @@ -0,0 +1,22 @@ +local utils = require "astronvim.utils" + +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "elm" }) + end + end, + }, + + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "elmls" }) end, + }, + + { + "jay-babu/mason-null-ls.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "elm_format" }) end, + }, +}