mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(moonbit): add MoonBit language extra
This commit is contained in:
parent
83d90f339d
commit
58ad4a0569
1 changed files with 49 additions and 0 deletions
49
lua/lazyvim/plugins/extras/lang/moonbit.lua
Normal file
49
lua/lazyvim/plugins/extras/lang/moonbit.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = { "moonbit", "mbt" },
|
||||||
|
root = { "moon.mod.json" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = { ensure_installed = { "moonbit" } },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- TODO: Enable once moonbit LSP is available in mason registry
|
||||||
|
-- https://github.com/mason-org/mason-registry
|
||||||
|
-- {
|
||||||
|
-- "mason-org/mason.nvim",
|
||||||
|
-- optional = true,
|
||||||
|
-- opts = function(_, opts)
|
||||||
|
-- opts.ensure_installed = opts.ensure_installed or {}
|
||||||
|
-- vim.list_extend(opts.ensure_installed, { "moonbit-lsp" })
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
moonbit = {
|
||||||
|
cmd = { "moonbit-lsp" },
|
||||||
|
filetypes = { "moonbit", "mbt" },
|
||||||
|
root_dir = function(fname)
|
||||||
|
return require("lspconfig.util").root_pattern("moon.mod.json")(fname)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
moonbit = { "moonfmt" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue