feat(elixir): add Expert, Treesitter and credo support
Use Expert, the official Elixir language server, with the elixir, heex and eex parsers, markdown highlighting for Livebook files, and credo linting in projects that have a .credo.exs. This stands in for LazyVim's elixir extra. Its nvim-lint opts assign linters_by_ft outright, which drops every linter configured before it; enabling it removed the dockerfile and fish linters. Register the Livebook language from an opts function, since lazy.nvim keeps only the last init for a plugin and xaml.lua already sets one.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
-- Stands in for LazyVim's elixir extra, whose nvim-lint opts replace
|
||||
-- linters_by_ft outright and drop every linter configured before it.
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
-- A function rather than init: lazy.nvim keeps only the last init for a
|
||||
-- plugin, and xaml.lua sets one too.
|
||||
opts = function(_, opts)
|
||||
vim.treesitter.language.register("markdown", "livebook")
|
||||
vim.list_extend(opts.ensure_installed, { "elixir", "heex", "eex" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
expert = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = { elixir = { "credo" } },
|
||||
linters = {
|
||||
credo = {
|
||||
condition = function(ctx)
|
||||
return vim.fs.find({ ".credo.exs" }, { path = ctx.filename, upward = true })[1] ~= nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user