nvchad/lua/configs/lspconfig.lua

25 lines
598 B
Lua
Raw Normal View History

-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
2024-03-17 21:04:01 -04:00
local lspconfig = require "lspconfig"
-- EXAMPLE
2024-03-17 21:04:01 -04:00
local servers = { "html", "cssls" }
local nvlsp = require "nvchad.configs.lspconfig"
2024-03-17 21:04:01 -04:00
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
2024-03-17 21:04:01 -04:00
}
end
-- configuring single server, example: typescript
-- lspconfig.tsserver.setup {
2024-07-30 06:42:45 -04:00
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }