From f7cb662b8cc9ccc54dade64bdd44ee9a936327f7 Mon Sep 17 00:00:00 2001 From: fecet Date: Tue, 22 Aug 2023 16:54:00 +0800 Subject: [PATCH] fix: disable ruff hover correctly --- lua/lazyvim/plugins/extras/lang/python.lua | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 746435cc..376f5067 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -9,22 +9,17 @@ return { }, { "neovim/nvim-lspconfig", - opts = { - servers = { - pyright = {}, - ruff_lsp = {}, - }, - }, - setup = { - ruff_lsp = function() - require("lazyvim.util").on_attach(function(client, _) - if client.name == "ruff_lsp" then - -- Disable hover in favor of Pyright - client.server_capabilities.hoverProvider = false - end - end) - end, - }, + opts = function(_, opts) + opts.servers["ruff_lsp"] = {} + opts.servers["pyright"] = {} + + require("lazyvim.util").on_attach(function(client, _) + if client.name == "ruff_lsp" then + -- Disable hover in favor of Pyright + client.server_capabilities.hoverProvider = false + end + end) + end, }, { "nvim-neotest/neotest",