aboutsummaryrefslogtreecommitdiff
path: root/lua/pml68/configs/lspconfig.lua
blob: 5f796875c6c8e34d21682f3eb8e6ecde93bb812d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")

vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
  border = "rounded",
})

local servers = {
  "asm_lsp",
  "html",
  "tsserver",
  "cssls",
  "svelte",
  "bashls",
  "clangd",
  "pyright",
  "emmet_ls",
  "jsonls",
  "rust_analyzer",
  "kotlin_language_server",
  "lua_ls",
  "glsl_analyzer"
}

for _, server in pairs(servers) do
  local opts = {
    capabilities = capabilities,
  }

  local require_ok, conf_opts = pcall(require, "pml68.configs.settings." .. server)
  if require_ok then
    opts = vim.tbl_deep_extend("force", conf_opts, opts)
  end

  lspconfig[server].setup(opts)
end