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 <gacallea@users.noreply.github.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
Andrea C from The App
2024-06-06 13:36:02 +02:00
committed by GitHub
parent 5a19f6b5fe
commit 4742390960

View File

@ -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 = {},
},
},
},
}