From efca2828b66f885d4c47d5595278bff8120ab321 Mon Sep 17 00:00:00 2001 From: David James McCorrie Date: Wed, 7 Jan 2026 13:41:12 +0000 Subject: [PATCH] python: expand LSPs Now that the new LSP API is available add: - ruff: add support for the LSP as well as the existing formatter support - ty: new type checking from astral (promising new type checker) Signed-off-by: David James McCorrie --- docs/manual/release-notes/rl-0.9.md | 4 ++++ modules/plugins/languages/python.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 612e473d..c258e806 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -36,3 +36,7 @@ [Libadoxon](https://github.com/Libadoxon): - `toggleterm` open map now also works when in terminal mode + +[Machshev](https://github.com/machshev): + +- Added `ruff` and `ty` LSP support for Python using the new API. diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 9cfb82f6..822a009c 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -126,6 +126,34 @@ ".git" ]; }; + + ruff = { + enable = true; + cmd = [(getExe pkgs.ruff) "server"]; + filetypes = ["python"]; + root_markers = [ + "pyproject.toml" + "setup.py" + "setup.cfg" + "requirements.txt" + "Pipfile" + ".git" + ]; + }; + + ty = { + enable = true; + cmd = [(getExe pkgs.ty) "server"]; + filetypes = ["python"]; + root_markers = [ + "pyproject.toml" + "setup.py" + "setup.cfg" + "requirements.txt" + "Pipfile" + ".git" + ]; + }; }; defaultFormat = ["black"];