Added the handlers into nvim

This commit is contained in:
Marcin Woźniak 2022-04-29 13:17:13 +02:00
parent da7d23f17e
commit 0aaac9f627

View File

@ -178,12 +178,19 @@ local on_attach = function(client, bufnr)
--vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
-- LSP settings (for overriding per client)
local handlers = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border}),
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border }),
}
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'pyright', 'bashls', 'ansiblels' }
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
on_attach = on_attach,
handlers=handlers,
capabilities = capabilities,
flags = {
debounce_text_changes = 150,