feat(lang): add zig support

This commit is contained in:
thoxy 2023-10-16 09:40:22 +02:00 committed by Folke Lemaitre
parent f8268faa7c
commit 36cd3114a7

View file

@ -0,0 +1,68 @@
return {
{
"NTBBloodbath/zig-tools.nvim",
ft = "zig",
config = function()
require("zig-tools").setup()
end,
dependencies = {
{
"akinsho/toggleterm.nvim",
},
{
"nvim-lua/plenary.nvim",
module_pattern = "plenary.*",
},
},
},
{
"ziglang/zig.vim",
lazy = false,
},
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "zig" })
end
end,
},
{
"williamboman/mason.nvim",
optional = true,
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "zls", "codelldb" })
end
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
zls = {},
},
},
setup = {
zls = function(_, opts)
local zig_tools_opts = require("lazyvim.util").opts("zig-tools.nvim")
require("zig-tools").setup(vim.tbl_deep_extend("force", zig_tools_opts or {}, { server = opts }))
return true
end,
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"lawrence-laz/neotest-zig",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {
adapters = {
["neotest-zig"] = {},
},
},
},
}