From 6d751b38f11fe390b156d942a480982adff7f542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noah=20H=C3=A5kansson?= Date: Sat, 24 Feb 2024 19:58:28 +0100 Subject: [PATCH] more none-ls cleanup and adding LSPs :D --- init.lua | 23 ++++++++++++++++++++--- lua/custom/plugins/none-ls.lua | 1 - 2 files changed, 20 insertions(+), 4 deletions(-) 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',