From 51be43ec10be3daa49d4e555761c1e01a00d2551 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 22 Aug 2023 09:50:38 +0200 Subject: [PATCH] vim/lsp: factor out border into separate table --- config/nvim/lua/fschauen/plugins/lsp.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/config/nvim/lua/fschauen/plugins/lsp.lua b/config/nvim/lua/fschauen/plugins/lsp.lua index a8e173c..cab0a8f 100644 --- a/config/nvim/lua/fschauen/plugins/lsp.lua +++ b/config/nvim/lua/fschauen/plugins/lsp.lua @@ -13,15 +13,14 @@ M.config = function() return tbl end - -- Enable rounded borders for LSP handlers and :LspInfo windows. - local 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 = border }) + vim.lsp.handlers[request] = vim.lsp.with(handler, border) end - require('lspconfig.ui.windows').default_options = { border = border } local opts = { capabilities = extend( @@ -52,12 +51,9 @@ M.config = function() end, } - require('mason').setup { - ui = { - border = 'rounded', - }, - } - require('mason-lspconfig').setup {} + require('lspconfig.ui.windows').default_options = border + require('mason').setup { ui = border } + require('mason-lspconfig').setup() require("mason-lspconfig").setup_handlers { --[[ default = ]] function(server) require('lspconfig')[server].setup(opts)