lspconfig.lua 628 B

12345678910111213141516171819202122232425
  1. -- EXAMPLE
  2. local on_attach = require("nvchad.configs.lspconfig").on_attach
  3. local on_init = require("nvchad.configs.lspconfig").on_init
  4. local capabilities = require("nvchad.configs.lspconfig").capabilities
  5. local lspconfig = require "lspconfig"
  6. -- see installed servers by ":LspInfo"
  7. local servers = { "html", "cssls", "pyright", "lua_ls" }
  8. -- lsps with default config
  9. for _, lsp in ipairs(servers) do
  10. lspconfig[lsp].setup {
  11. on_attach = on_attach,
  12. on_init = on_init,
  13. capabilities = capabilities,
  14. }
  15. end
  16. -- typescript
  17. lspconfig.tsserver.setup {
  18. on_attach = on_attach,
  19. on_init = on_init,
  20. capabilities = capabilities,
  21. }