diff --git a/nvim/.config/nvim/lua/plugins/config/lsp.lua b/nvim/.config/nvim/lua/plugins/config/lsp.lua index c67e77a..080a7c6 100644 --- a/nvim/.config/nvim/lua/plugins/config/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/config/lsp.lua @@ -34,7 +34,7 @@ local servers = { filetypes = { "markdown", "quarto" }, }, basedpyright = {}, - ruff_lsp = {}, + ruff = {}, serve_d = {}, tailwindcss = {}, taplo = {}, @@ -54,7 +54,7 @@ require("mason-tool-installer").setup({ start_delay = 3000, }) -local function on_attach(client, bufnr) +local function on_attach(_, bufnr) local map = vim.keymap.set map("n", "[d", "lua vim.diagnostic.goto_prev()", { buffer = bufnr, desc = "Previous diagnostic" }) map("n", "]d", "lua vim.diagnostic.goto_next()", { buffer = bufnr, desc = "Next diagnostic" }) @@ -167,21 +167,35 @@ local python_path -- ensure python virtualenv is determined automatically on lsp start lspconfig.basedpyright.setup({ on_attach = function(client, bufnr) + on_attach(client, bufnr) if python_path == nil then python_path, _ = vim.fn.expand(require("core.util").get_python_venv_bin(client.config.root_dir)) end + vim.g["python3_host_prog"] = python_path -- print(string.format("[PYTHON VENV]: %s", vim.inspect(python_path))) client.config.settings.python = {} or client.config.settings.python client.config.settings.python.pythonPath = python_path - on_attach(client, bufnr) end, + settings = { + -- disable imports and linting since, we use ruff for that + pyright = { + disableOrganizeImports = true, + }, + python = { + analysis = { + ignore = { "*" }, + }, + }, + }, }) -lspconfig.ruff_lsp.setup({ +lspconfig.ruff.setup({ on_attach = function(client, bufnr) on_attach(client, bufnr) + client.server_capabilities.hoverProvider = false -- we use pyright for hover info if python_path == nil then python_path, _ = vim.fn.expand(require("core.util").get_python_venv_bin(client.config.root_dir)) end + vim.g["python3_host_prog"] = python_path client.config.settings.python = {} or client.config.settings.python client.config.settings.python.pythonPath = python_path end,