2024-07-28 20:06:46 -04:00
|
|
|
-- load defaults i.e lua_lsp
|
|
|
|
require("nvchad.configs.lspconfig").defaults()
|
2024-03-17 21:04:01 -04:00
|
|
|
|
|
|
|
local lspconfig = require "lspconfig"
|
2024-07-28 20:06:46 -04:00
|
|
|
|
|
|
|
-- EXAMPLE
|
2024-03-17 21:04:01 -04:00
|
|
|
local servers = { "html", "cssls" }
|
2024-07-28 20:06:46 -04:00
|
|
|
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 {
|
2024-07-28 20:06:46 -04:00
|
|
|
on_attach = nvlsp.on_attach,
|
|
|
|
on_init = nvlsp.on_init,
|
|
|
|
capabilities = nvlsp.capabilities,
|
2024-03-17 21:04:01 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2024-07-28 20:06:46 -04:00
|
|
|
-- configuring single server, example: typescript
|
2024-09-12 00:49:21 -04:00
|
|
|
-- lspconfig.ts_ls.setup {
|
2024-07-30 06:42:45 -04:00
|
|
|
-- on_attach = nvlsp.on_attach,
|
|
|
|
-- on_init = nvlsp.on_init,
|
|
|
|
-- capabilities = nvlsp.capabilities,
|
2024-07-28 20:06:46 -04:00
|
|
|
-- }
|