Add ruff LSP and Python tooling to Zed config

Add uv, python314, and ruff to extra packages.

Enable Python format‑on‑save, use ruff as formatter and language server,
and set tab size to 4.

Configure ruff LSP with a bash wrapper and detailed inlay‑hint options.
This commit is contained in:
GarandPLG committed 2026-02-11 16:07:36 +01:00
1 parent e2d9522d89
commit a751485bf0
3 files changed
+36 -1

No files matched your search

+3
View File
@@ -5,5 +5,8 @@
nixd
alejandra
opencode
uv
python314
ruff
];
}
+11 -1
View File
@@ -4,7 +4,17 @@ _: {
"nixd"
"!nil"
];
Python.language_servers = ["!basedpyright"];
Python = {
format_on_save = "on";
formatter.language_server.name = "ruff";
code_actions_on_format."source.organizeImports.ruff" = true;
language_servers = [
"ruff"
"!ty"
"!basedpyright"
];
tab_size = 4;
};
YAML.tab_size = 2;
JavaScript = {
formatter.language_server.name = "biome";
+22
View File
@@ -72,5 +72,27 @@
};
};
};
ruff = {
binary = {
path = lib.getExe pkgs.bash;
arguments = [
"-c"
"if [ -e flake.nix ]; then nix develop --command ruff server; else ruff server; fi"
];
};
initialization_options = {
check.command = "ruff check .";
inlayHints = {
maxLength = null;
lifetimeElisionHints = {
enable = "skip_trivial";
useParameterNames = true;
};
closureReturnTypeHints = {
enable = "always";
};
};
};
};
};
}