Neovim support for the MoonBit language.
- Tree-sitter support
- Highlights
- Folds
- Indents (#9)
- Build system support
- Compiler plugin
-
Diagnostics through nvim-lintRemoved b/c LSP
- JSON Schema
- Language server
- Neotest support (#10)
First you need to have the MoonBit toolchain installed. You can follow the instruction on the Download Page of the MoonBit language.
{
'moonbit-community/moonbit.nvim',
ft = { 'moonbit' },
opts = {
-- optionally disable the treesitter integration
treesitter = {
enabled = true
-- Set false to disable automatic installation and updating of parsers.
auto_install = true
},
-- configure the language server integration
-- set `lsp = false` to disable the language server integration
lsp = {
-- provide an `on_attach` function to run when the language server starts
on_attach = function(client, bufnr) end,
-- provide client capabilities to pass to the language server
capabilities = vim.lsp.protocol.make_client_capabilities(),
}
},
}
moonbit.nvim
provides a neotest adapter. Below is an minimal example config using lazy.nvim
:
{
"nvim-neotest/neotest",
dependencies = {
"moonbit-community/moonbit.nvim",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-moonbit"),
},
})
end,
}
According to the lazy.nvim docs, setting the config
property in an override spec might accidentally overwrite that of an existing parent spec. On the other hand, the opts
property is guaranteed to be merged with that of the parent spec. Therefore, we recommend the following settings:
{
"nvim-neotest/neotest",
dependencies = {
"moonbit-community/moonbit.nvim",
},
opts = function(_, opts)
if not opts.adapters then opts.adapters = {} end
table.insert(opts.adapters, require("neotest-moonbit"))
end,
}