diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index 657ee5c..e102ce0 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -51,20 +51,24 @@ local handlers = { flake8 = { enabled = false }, pylint = { enabled = false }, autopep8 = { enabled = false }, - yapf = { enabled = true }, + yapf = { enabled = false }, + ruff = { + enabled = true, + formatEnabled = true, + }, }, }, }, }) end, - ruff_lsp = function() - require('lspconfig').ruff_lsp.setup({ - on_attach = function(client, bufnr) - client.server_capabilities.hoverProvider = false - client.server_capabilities.documentFormattingProvider = false - end, - }) - end, + -- ruff_lsp = function() + -- require('lspconfig').ruff_lsp.setup({ + -- on_attach = function(client, bufnr) + -- client.server_capabilities.hoverProvider = false + -- client.server_capabilities.documentFormattingProvider = false + -- end, + -- }) + -- end, texlab = function() require('lspconfig').texlab.setup({ settings = { @@ -110,7 +114,7 @@ return { opts = { handlers = handlers, ensure_installed = { - 'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp', 'lemminx', + 'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'lemminx' }, }, }, diff --git a/lua/plugins/lsp/python.lua b/lua/plugins/lsp/python.lua index bf2086e..4f6f966 100644 --- a/lua/plugins/lsp/python.lua +++ b/lua/plugins/lsp/python.lua @@ -2,28 +2,28 @@ local M = {} local notify = require('notify') M.mason_post_install = function(pkg) - --if pkg.name ~= 'python-lsp-server' then - -- return - --end - --local venv = vim.fn.stdpath('data') .. '/mason/packages/python-lsp-server/venv' - --local job = require('plenary.job') - --job:new({ - -- command = venv .. '/bin/pip', - -- args = { - -- 'install', - -- '-U', - -- '--disable-pip-version-check', - -- 'pylsp-mypy', - -- }, - -- cwd = venv, - -- env = { VIRTUAL_ENV = venv }, - -- on_exit = function() - -- notify('Finished installing pylsp modules.') - -- end, - -- on_start = function() - -- notify('Installing pylsp modules...') - -- end, - --}):start() + if pkg.name ~= 'python-lsp-server' then + return + end + local venv = vim.fn.stdpath('data') .. '/mason/packages/python-lsp-server/venv' + local job = require('plenary.job') + job:new({ + command = venv .. '/bin/pip', + args = { + 'install', + '-U', + '--disable-pip-version-check', + 'python-lsp-ruff', + }, + cwd = venv, + env = { VIRTUAL_ENV = venv }, + on_exit = function() + notify('Finished installing pylsp modules.') + end, + on_start = function() + notify('Installing pylsp modules...') + end, + }):start() end M.ruff = function()