Skip to content

moonbit-community/moonbit.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moonbit.nvim

Neovim support for the MoonBit language.

Screenshot from 2023-11-21 01-24-56

Roadmap

  • Tree-sitter support
    • Highlights
    • Folds
    • Indents (#9)
  • Build system support
    • Compiler plugin
    • Diagnostics through nvim-lint Removed b/c LSP
  • JSON Schema
  • Language server
  • Neotest support (#10)

Installation

First you need to have the MoonBit toolchain installed. You can follow the instruction on the Download Page of the MoonBit language.

lazy.nvim

{
  '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(),
    }
  },
}

neotest

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,
}

About

Neovim plugin for Moonbit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published