feat(elixir): add support for livebook files (*.livemd) (#4184)

Livebook is a subset of Markdown, so we can safely use markdown's
treesitter for it.

Co-authored-by: Iordanis Petkakis <dpetka2001@users.noreply.github.com>
This commit is contained in:
George Guimarães 2024-11-08 05:10:11 -08:00 committed by GitHub
parent 859646f628
commit 2fcd4cdc5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "elixir", "eelixir", "heex", "surface" },
ft = { "elixir", "eelixir", "heex", "surface", "livebook" },
root = "mix.exs",
})
end,
@ -40,7 +40,11 @@ return {
},
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "elixir", "heex", "eex" } },
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "elixir", "heex", "eex" })
vim.treesitter.language.register("markdown", "livebook")
end,
},
{
"nvim-neotest/neotest",
@ -85,4 +89,11 @@ return {
}
end,
},
{
"MeanderingProgrammer/render-markdown.nvim",
optional = true,
ft = function(_, ft)
vim.list_extend(ft, { "livebook" })
end,
},
}