File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ # Moonbit Language Pack
2+
3+ Requires:
4+
5+ - [ Moonbit CLI tools] ( https://www.moonbitlang.com/download/#moonbit-cli-tools )
6+ - [ moonbit-lsp] ( https://www.npmjs.com/package/@moonbit/moonbit-lsp )
7+
8+ This plugin pack does the following:
9+
10+ - Adds [ ` moonbit.nvim ` ] ( https://github.com/tonyfettes/moonbit.nvim ) plugin which adds
11+ - Adds ` moonbit ` Treesitter parser
12+ - Adds ` moonbit-lsp ` language server
Original file line number Diff line number Diff line change 1+ return {
2+ {
3+ " tonyfettes/moonbit.nvim" ,
4+ ft = " moonbit" ,
5+ -- uncomment when mason support added to make sure command is available
6+ -- dependencies = {
7+ -- { "williamboman/mason.nvim", optional = true },
8+ -- },
9+ opts = function (_ , opts )
10+ -- only enable treesitter if the plugin is available
11+ if not require (" astrocore" ).is_available " nvim-treesitter" then opts .treesitter = { enabled = false } end
12+ -- only enable the LSP if the lsp command is executable
13+ if vim .fn .executable " moonbit-lsp" == 1 then
14+ local astrolsp_avail , astrolsp = pcall (require , " astrolsp" )
15+ if astrolsp_avail then opts .lsp = astrolsp .lsp_opts " moonbit" end
16+ else
17+ opts .lsp = false
18+ end
19+ end ,
20+ },
21+ -- uncomment if/when moonbit-lsp is added to lspconfig and mason-lspconfig
22+ -- {
23+ -- "williamboman/mason-lspconfig.nvim",
24+ -- opts = function(_, opts)
25+ -- opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "harper-ls" })
26+ -- end,
27+ -- },
28+ -- uncomment when merged upstream: https://github.com/mason-org/mason-registry/pull/7350
29+ -- {
30+ -- "WhoIsSethDaniel/mason-tool-installer.nvim",
31+ -- optional = true,
32+ -- opts = function(_, opts)
33+ -- opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "moonbit-lsp" })
34+ -- end,
35+ -- },
36+ }
You can’t perform that action at this time.
0 commit comments