feat: zig lsp

This commit is contained in:
kossLAN 2025-07-14 10:24:14 -04:00
parent 94f0bf1c95
commit 33120b06c2
Signed by: kossLAN
SSH key fingerprint: SHA256:bdV0x+wdQHGJ6LgmstH3KV8OpWY+OOFmJcPcB0wQPV8
2 changed files with 20 additions and 0 deletions

View file

@ -105,6 +105,7 @@ with final.pkgs.lib; let
jdt-language-server # java ls
nil # nix lsp
rust-analyzer # rust LSP
zls # zig LSP
vscode-langservers-extracted # various web dev lsps from vscode
typescript-language-server # css lsp thing
qt6.qtdeclarative # qmlls

19
nvim/ftplugin/zig.lua Normal file
View file

@ -0,0 +1,19 @@
if vim.fn.executable('zls') ~= 1 then
return
end
local root_files = {
'zls.json',
'build.zig',
'.git',
}
local lsp = require('user.lsp')
vim.lsp.start {
name = 'zls',
cmd = { 'zls' },
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
capabilities = lsp.make_client_capabilities(),
on_attach = lsp.on_attach,
}