vim/lsp: override handlers via lspconfig rather than globally
This commit is contained in:
parent
51be43ec10
commit
7b4e7462b7
1 changed files with 5 additions and 7 deletions
|
@ -15,19 +15,17 @@ M.config = function()
|
||||||
|
|
||||||
local border = { border = 'rounded' }
|
local border = { border = 'rounded' }
|
||||||
|
|
||||||
for request, handler in pairs {
|
|
||||||
['textDocument/hover'] = vim.lsp.handlers.hover,
|
|
||||||
['textDocument/signatureHelp'] = vim.lsp.handlers.signature_help,
|
|
||||||
} do
|
|
||||||
vim.lsp.handlers[request] = vim.lsp.with(handler, border)
|
|
||||||
end
|
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
capabilities = extend(
|
capabilities = extend(
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
vim.lsp.protocol.make_client_capabilities(),
|
||||||
vim.F.npcall(function() require('cmp_nvim_lsp').default_capabilities() end)
|
vim.F.npcall(function() require('cmp_nvim_lsp').default_capabilities() end)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
handlers = {
|
||||||
|
['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, border),
|
||||||
|
['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, border),
|
||||||
|
},
|
||||||
|
|
||||||
on_attach = function(--[[client]]_, bufnr)
|
on_attach = function(--[[client]]_, bufnr)
|
||||||
vim.bo.omnifunc = 'v:lua.vim.lsp.omnifunc' -- do completion with <c-x><c-o>
|
vim.bo.omnifunc = 'v:lua.vim.lsp.omnifunc' -- do completion with <c-x><c-o>
|
||||||
local map, opts = vim.keymap.set, { buffer = bufnr }
|
local map, opts = vim.keymap.set, { buffer = bufnr }
|
||||||
|
|
Loading…
Add table
Reference in a new issue