diff --git a/lua/astrocommunity/pack/zig/README.md b/lua/astrocommunity/pack/zig/README.md index 94d818698..c44032644 100644 --- a/lua/astrocommunity/pack/zig/README.md +++ b/lua/astrocommunity/pack/zig/README.md @@ -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, + } +``` diff --git a/lua/astrocommunity/pack/zig/init.lua b/lua/astrocommunity/pack/zig/init.lua index acfe56922..428a70aa1 100644 --- a/lua/astrocommunity/pack/zig/init.lua +++ b/lua/astrocommunity/pack/zig/init.lua @@ -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, @@ -41,4 +27,12 @@ return { "nvim-lua/plenary.nvim", }, }, + { + "AstroNvim/astrolsp", + optional = true, + ---@type AstroLSPOpts + opts = { + servers = { "zls" }, + }, + }, }