nvim: Enable LSP for zig

This commit is contained in:
Sanchayan Maity 2024-10-27 20:21:33 +05:30
parent 52dbf54ea2
commit 1d1a3539c8
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,4 @@
local lsp_utils = require('lsp-utils')
local zls_config = lsp_utils.zls_config()
vim.lsp.start(zls_config)

View file

@ -372,4 +372,18 @@ function M.typescript_config()
end end
end end
function M.zls_config()
local root_files = { 'zls.json', 'build.zig' }
local root_directory = get_root_directory(root_files)
return {
name = "zls",
cmd = { "zls" },
capabilities = default_capabilities,
root_dir = root_directory,
filetypes = { 'zig', 'zir' },
single_file_support = true,
}
end
return M return M