refactor capabilites function

This commit is contained in:
Chris 2021-07-28 19:03:29 -04:00
parent f73da2a1b2
commit ed71e50593
3 changed files with 30 additions and 31 deletions

View file

@ -6,6 +6,11 @@ function lsp_config.config()
require("lsp.handlers").setup()
require("lsp.signs").setup()
require("lsp.keybinds").setup()
require("core.autocmds").define_augroups {
_general_lsp = {
{ "FileType", "lspinfo", "nnoremap <silent> <buffer> q :q<CR>" },
},
}
end
local function no_formatter_on_attach(client, bufnr)
@ -16,25 +21,6 @@ local function no_formatter_on_attach(client, bufnr)
client.resolved_capabilities.document_formatting = false
end
function lsp_config.common_capabilities()
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits",
},
}
return capabilities
end
require("core.autocmds").define_augroups {
_general_lsp = {
{ "FileType", "lspinfo", "nnoremap <silent> <buffer> q :q<CR>" },
},
}
function lsp_config.setup(lang)
local lang_server = lvim.lang[lang].lsp
local provider = lang_server.provider