dotfiles/home/common/nvim/lsp.lua

45 lines
949 B
Lua
Raw Normal View History

2024-10-06 23:00:01 +02:00
local configs = require('lspconfig.configs')
local lspconfig = require("lspconfig")
local capabilities = vim.lsp.protocol.make_client_capabilities()
local servers = {
'gopls',
'ts_ls',
}
for _, ls in ipairs(servers) do
lspconfig[ls].setup {
capabilities = capabilities,
}
end
lspconfig.nixd.setup({
capabilities = capabilities,
2024-11-09 10:09:10 +01:00
cmd = { "nixd" },
settings = {
nixd = {
nixpkgs = { expr = "import <nixpkgs> { }" },
formatting = { command = { "nixfmt" } },
options = {},
},
},
2024-10-06 23:00:01 +02:00
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
2024-11-09 10:09:10 +01:00
settings = {
Lua = {
runtime = {
version = "LuaJIT",
path = vim.split(package.path, ";"),
},
diagnostics = { globals = { "vim", "hs" } },
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
},
},
},
},
2024-10-06 23:00:01 +02:00
})