feat(nvim): enable plugins for pylsp

This commit is contained in:
matt1432 2025-05-10 12:59:30 -04:00
parent 891ba58074
commit 025bb83e50

View file

@ -9,11 +9,18 @@
cfg = config.programs.neovim; cfg = config.programs.neovim;
# We keep the packages here because python is a bit complicated and common # We keep the packages here because python is a bit complicated and common
pythonPkgs = py: pythonPkgs = p:
(attrValues { (attrValues {
inherit (py) python-lsp-server; inherit
(p)
python-lsp-server
pyls-isort
pylsp-mypy
python-lsp-ruff
python-lsp-jsonrpc
;
}) })
++ py.python-lsp-server.optional-dependencies.all; ++ p.python-lsp-server.optional-dependencies.all;
in { in {
config = mkIf (cfg.enable && cfg.ideConfig.enablePython) { config = mkIf (cfg.enable && cfg.ideConfig.enablePython) {
programs = { programs = {
@ -32,8 +39,26 @@ in {
settings = { settings = {
pylsp = { pylsp = {
plugins = { plugins = {
pycodestyle = { -- auto-completion options
maxLineLength = 100, jedi_completion = {
fuzzy = true,
},
-- import sorting
pyls_isort = {
enabled = true,
},
-- type checker
pylsp_mypy = {
enabled = true,
},
-- linter
ruff = {
enabled = true,
formatEnabled = true,
lineLength = 100,
}, },
}, },
}, },