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:
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user