39 lines
963 B
Lua
39 lines
963 B
Lua
local lspconfig_status_ok, lspconfig = pcall(require, 'lspconfig')
|
|
if not lspconfig_status_ok then
|
|
return
|
|
end
|
|
|
|
local servers = require('config.lsp')
|
|
local opts = {}
|
|
|
|
local on_attach = function(client, bufnr)
|
|
end
|
|
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
capabilities.textDocument.completion.completionItem = {
|
|
documentationFormat = { "markdown", "plaintext" },
|
|
snippetSupport = true,
|
|
preselectSupport = true,
|
|
insertReplaceSupport = true,
|
|
labelDetailsSupport = true,
|
|
deprecatedSupport = true,
|
|
commitCharactersSupport = true,
|
|
tagSupport = { valueSet = { 1 } },
|
|
resolveSupport = {
|
|
properties = {
|
|
"documentation",
|
|
"detail",
|
|
"additionalTextEdits",
|
|
},
|
|
},
|
|
}
|
|
|
|
for server, config in pairs(servers) do
|
|
opts = {
|
|
on_attach = on_attach,
|
|
capabilities = capabilities
|
|
}
|
|
server = vim.split(server, "@")[1]
|
|
opts = vim.tbl_deep_extend("force", config, opts)
|
|
lspconfig[server].setup(opts)
|
|
end
|