From 3cb529be0b06ae6b7b67a76a9cdae4ee7b5cb6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Mon, 23 Oct 2023 16:34:44 +0200 Subject: [PATCH] nvim: remove depracated --- dot_config/nvim/lua/configs/packages/lsp.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dot_config/nvim/lua/configs/packages/lsp.lua b/dot_config/nvim/lua/configs/packages/lsp.lua index 3b0bf24..70dbc6a 100644 --- a/dot_config/nvim/lua/configs/packages/lsp.lua +++ b/dot_config/nvim/lua/configs/packages/lsp.lua @@ -129,7 +129,7 @@ end local function update_attached(bufnr) local attached = ''; - for _, client in pairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do + for _, client in pairs(vim.lsp.get_clients({ bufnr = bufnr })) do attached = attached .. ',' .. client.name end @@ -141,6 +141,10 @@ local function on_attach(args) -- {{{ local client = vim.lsp.get_client_by_id(args.data.client_id) + if client == nil then + return + end + if (client.server_capabilities.documentSymbolProvider) then navic_attach(client, bufnr) end @@ -176,11 +180,14 @@ local function on_attach(args) -- {{{ -- (note, if the height of the float would be greater than the space left above the cursor, it will default -- to placing the float below the cursor. The max_height option allows for finer tuning of this) }, + display_automatically = true, + silent = true, keymaps = { next_signature = '', previous_signature = '', next_parameter = '', previous_parameter = '', + close_signature = '', }, }) @@ -215,7 +222,7 @@ local function on_attach(args) -- {{{ ) if (formatting_filter(client)) then - vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})') + vim.api.nvim_set_option_value('formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})', {buf= bufnr}) end if client.name == 'omnisharp' then @@ -385,6 +392,7 @@ return { { 'Issafalcon/lsp-overloads.nvim', lazy = true }, { 'someone-stole-my-name/yaml-companion.nvim', + lazy = true, dependencies = { { 'neovim/nvim-lspconfig' }, { 'nvim-lua/plenary.nvim' },