nvim: Enable LSP for zig
This commit is contained in:
parent
52dbf54ea2
commit
1d1a3539c8
2 changed files with 18 additions and 0 deletions
4
nvim/.config/nvim/after/ftplugin/zig.lua
Normal file
4
nvim/.config/nvim/after/ftplugin/zig.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
local lsp_utils = require('lsp-utils')
|
||||
local zls_config = lsp_utils.zls_config()
|
||||
|
||||
vim.lsp.start(zls_config)
|
|
@ -372,4 +372,18 @@ function M.typescript_config()
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue