Skip to content

Commit

Permalink
feat(zig)!: Remove zls installation trough mason, and require the end…
Browse files Browse the repository at this point in the history
… user to install it (#1119)

feat(zig)!: Remove zls installation trough mason, and require the end-user to set it up
  • Loading branch information
Uzaaft authored Jul 24, 2024
1 parent 08fff8c commit 9e6e823
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
28 changes: 27 additions & 1 deletion lua/astrocommunity/pack/zig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,36 @@
- Neovim (>= 0.7.x)
- ripgrep (>= 11.0)
- Zig (>= 0.12.0 required for Neotest support)
- Zls (Make sure this is the same version as your zig version)

This plugin pack does the following:

- Adds `zig` Treesitter parsers
- Adds `zls` language server
- Adds [neotest-zig](https://github.com/lawrence-laz/neotest-zig/tree/v1.2.0)
- Adds [zig-tools.nvim](https://codeberg.org/NTBBloodbath/zig-tools.nvim)

## Manage zls with mason

If you want `zls` to be managed with mason, you can add this table to your config:

```lua
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "zls" })
end,
}
```

Or trough mason-tool-installer:

```lua
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "zls" })
end,
}
```
22 changes: 8 additions & 14 deletions lua/astrocommunity/pack/zig/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ return {
end
end,
},
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "zls" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "zls" })
end,
},
{
"nvim-neotest/neotest",
optional = true,
Expand All @@ -41,4 +27,12 @@ return {
"nvim-lua/plenary.nvim",
},
},
{
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
servers = { "zls" },
},
},
}

0 comments on commit 9e6e823

Please sign in to comment.