snowflake/home/programs/editors/helix/languages.nix

115 lines
2.7 KiB
Nix
Raw Normal View History

2023-05-25 12:43:26 -04:00
{
pkgs,
lib,
...
}: {
2024-05-27 12:07:19 -04:00
home.packages = [(pkgs.callPackage ../../../../pkgs/scls {})];
2023-05-25 12:43:26 -04:00
programs.helix.languages = {
language = with pkgs; [
{
name = "nix";
auto-format = true;
2024-05-27 12:07:19 -04:00
language-servers = ["scls" "nil"];
2023-05-25 12:43:26 -04:00
formatter = {
command = lib.getExe alejandra;
args = ["-q"];
};
}
{
name = "rust";
auto-format = true;
2024-05-27 12:07:19 -04:00
language-servers = ["scls" "rust-analyzer"];
2023-05-25 12:43:26 -04:00
formatter = {
command = lib.getExe rustfmt;
2024-05-26 16:49:29 -04:00
args = ["--edition" "2021"];
2023-05-25 12:43:26 -04:00
};
}
2024-01-26 08:05:25 -05:00
{
name = "lua";
auto-format = true;
2024-05-27 12:07:19 -04:00
language-servers = ["scls" "lua-language-server"];
2024-01-26 08:05:25 -05:00
formatter = {
command = lib.getExe stylua;
2024-01-26 08:05:25 -05:00
};
}
2024-05-27 12:07:19 -04:00
{
name = "python";
auto-format = true;
language-servers = ["scls" "ruff"];
formatter = with pkgs; {
command = lib.getExe ruff;
args = ["format" "-q"];
};
}
{
name = "javascript";
auto-format = true;
language-servers = [
"scls"
{
name = "typescript-language-server";
except-features = ["format"];
}
];
formatter = with pkgs; {
command = lib.getExe biome;
args = ["format"];
};
}
{
name = "toml";
auto-format = true;
language-servers = ["scls" "taplo"];
formatter = with pkgs; {
command = lib.getExe taplo;
args = ["fmt" "-"];
};
}
{
name = "json";
auto-format = true;
language-servers = ["scls" "biome"];
formatter = with pkgs; {
command = lib.getExe biome;
args = ["format"];
};
}
2023-05-25 12:43:26 -04:00
];
language-server = with pkgs; {
2024-05-27 12:07:19 -04:00
scls = {
command = "simple-completion-language-server";
config = {
feature_snippets = true;
feature_paths = true;
};
};
2024-05-27 12:35:09 -04:00
rust-analyzer.config = {
checkOnSave.command = "clippy";
inlayHints = {
closingBraceHints.enable = false;
parameterHints.enable = false;
typeHints.enable = true;
};
};
2023-05-25 12:43:26 -04:00
nil = {
command = lib.getExe nil;
};
2024-05-26 16:49:29 -04:00
typescript-language-server = with pkgs.nodePackages; {
2024-05-27 12:35:09 -04:00
command = lib.getExe typescript-language-server;
2024-05-26 16:49:29 -04:00
args = ["--stdio"];
};
2024-05-27 12:07:19 -04:00
lua = {
command = lib.getExe lua-language-server;
};
taplo = {
command = lib.getExe taplo;
args = ["lsp" "stdio"];
};
ruff = {
command = lib.getExe ruff;
args = ["server" "--preview"];
};
2023-05-25 12:43:26 -04:00
};
};
}