diff --git a/init.lua b/init.lua index 09836d1b..6a9a5062 100644 --- a/init.lua +++ b/init.lua @@ -544,7 +544,7 @@ end, 0) -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(_, bufnr) +local on_attach = function(client, bufnr) -- NOTE: Remember that lua is a real programming language, and as such it is possible -- to define small helper and utility functions so you don't have to repeat yourself -- many times. @@ -592,6 +592,12 @@ local on_attach = function(_, bufnr) command = 'EslintFixAll', }) end + + -- When using pyright and ruff_lsp, disable hover in favor of Pyright + if client.name == 'ruff_lsp' then + -- Disable hover in favor of Pyright + client.server_capabilities.hoverProvider = false + end end -- document existing key chains @@ -660,8 +666,19 @@ local servers = { }, }, bashls = {}, - ruff_ls = {}, - pyright = {}, + ruff_lsp = {}, + pyright = { + pyright = { + -- Using Ruff's import organizer + disableOrganizeImports = true, + }, + python = { + analysis = { + -- Ignore all files for analysis to exclusively use Ruff for linting + ignore = { '*' }, + }, + }, + }, rust_analyzer = {}, -- tsserver = {}, html = { filetypes = { 'html', 'twig', 'hbs' } }, diff --git a/lua/custom/plugins/none-ls.lua b/lua/custom/plugins/none-ls.lua index 4cef5a08..93f6196a 100644 --- a/lua/custom/plugins/none-ls.lua +++ b/lua/custom/plugins/none-ls.lua @@ -18,7 +18,6 @@ function M.config() sources = { -- Formatters formatting.stylua, - formatting.black, formatting.prettier.with({ filetypes = { 'css',