2024-12-17 12:10:05 +00:00
|
|
|
{ pkgs, lib, ... }:
|
2024-11-21 09:24:15 +00:00
|
|
|
let
|
2024-12-17 12:10:05 +00:00
|
|
|
inherit (lib) getExe;
|
2024-11-21 09:24:15 +00:00
|
|
|
indent = {
|
|
|
|
tab-width = 2;
|
|
|
|
unit = " ";
|
|
|
|
};
|
|
|
|
auto-format = true;
|
|
|
|
in {
|
|
|
|
programs.helix = with pkgs; {
|
|
|
|
languages = {
|
|
|
|
language = let prettier = nodePackages_latest.prettier;
|
|
|
|
in [
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# NIX LSP
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "nix";
|
2024-12-17 12:10:05 +00:00
|
|
|
language-servers = [ "nixd" "nil" ];
|
|
|
|
formatter.command = "${getExe nixfmt-rfc-style}";
|
2024-11-21 09:24:15 +00:00
|
|
|
indent = indent;
|
|
|
|
inherit auto-format;
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# HTML
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "html";
|
2024-12-03 14:20:37 +00:00
|
|
|
language-servers = [ "vscode-html" ];
|
|
|
|
indent = indent;
|
2024-11-21 09:24:15 +00:00
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${prettier}/bin/prettier";
|
|
|
|
args = [ "--use-tabs" "--parser" "html" ];
|
|
|
|
};
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# JSON
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "json";
|
2024-12-03 14:20:37 +00:00
|
|
|
language-servers = [ "vscode-json" ];
|
|
|
|
indent = indent;
|
2024-11-21 09:24:15 +00:00
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${prettier}/bin/prettier";
|
|
|
|
args = [ "--use-tabs" "--parser" "json" ];
|
|
|
|
};
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# JSON
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "jsonc";
|
2024-12-03 14:20:37 +00:00
|
|
|
language-servers = [ "vscode-json" ];
|
|
|
|
indent = indent;
|
2024-11-21 09:24:15 +00:00
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${prettier}/bin/prettier";
|
|
|
|
args = [ "--use-tabs" "--parser" "json" ];
|
|
|
|
};
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# CSS
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "css";
|
2024-12-03 14:20:37 +00:00
|
|
|
language-servers = [ "vscode-css" ];
|
|
|
|
indent = indent;
|
2024-11-21 09:24:15 +00:00
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${prettier}/bin/prettier";
|
|
|
|
args = [ "--use-tabs" "--parser" "css" ];
|
|
|
|
};
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# MARKDOWN
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "markdown";
|
|
|
|
language-servers = [ "marksman" ];
|
2024-12-03 14:20:37 +00:00
|
|
|
indent = indent;
|
2024-11-21 09:24:15 +00:00
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${prettier}/bin/prettier";
|
|
|
|
args = [ "--use-tabs" "--parser" "markdown" ];
|
|
|
|
};
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# TYPESCRIPT
|
2024-11-21 09:24:15 +00:00
|
|
|
name = "typescript";
|
|
|
|
language-servers = [ "typescript" ];
|
2024-12-03 14:20:37 +00:00
|
|
|
indent = indent;
|
2024-11-21 09:24:15 +00:00
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${prettier}/bin/prettier";
|
|
|
|
args = [ "--use-tabs" "--parser" "typescript" ];
|
|
|
|
};
|
|
|
|
}
|
2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
# PYTHON
|
2024-12-03 14:20:37 +00:00
|
|
|
name = "python";
|
|
|
|
language-servers = [ "pylsp" "ruff" ];
|
|
|
|
shebangs = [ "${python39}/bin/python" ];
|
|
|
|
file-types = [ "py" "pyi" "py3" "pyw" ".pythonstartup" ".pythonrc" ];
|
|
|
|
roots = [ "." "pyproject.toml" "pyrightconfig.json" ];
|
|
|
|
comment-token = "#";
|
|
|
|
scope = "source.python";
|
|
|
|
injection-regex = "python";
|
|
|
|
indent = indent;
|
|
|
|
inherit auto-format;
|
|
|
|
formatter = {
|
|
|
|
command = "${ruff}/bin/ruff";
|
|
|
|
args = [ "format" "-" ];
|
|
|
|
};
|
|
|
|
}
|
2024-11-21 09:24:15 +00:00
|
|
|
];
|
2024-12-03 14:20:37 +00:00
|
|
|
language-server = let
|
|
|
|
vscode = vscode-langservers-extracted;
|
|
|
|
typescript = typescript-language-server;
|
2024-11-21 09:24:15 +00:00
|
|
|
in {
|
2024-12-17 12:10:05 +00:00
|
|
|
nil.command = "${nil}/bin/nil";
|
2024-12-03 14:20:37 +00:00
|
|
|
nixd.command = "${nixd}/bin/nixd";
|
2024-12-17 12:10:05 +00:00
|
|
|
typescript.command = "${typescript}/bin/typescript-language-server";
|
2024-12-03 14:20:37 +00:00
|
|
|
vscode-html.command = "${vscode}/bin/vscode-html-language-server";
|
|
|
|
vscode-json.command = "${vscode}/bin/vscode-json-language-server";
|
|
|
|
vscode-css.command = "${vscode}/bin/vscode-css-language-server";
|
|
|
|
marksman.command = "${marksman}/bin/marksman";
|
2024-12-17 12:10:05 +00:00
|
|
|
ruff.command = "${ruff-lsp}/bin/ruff-lsp";
|
2024-12-03 14:20:37 +00:00
|
|
|
pyright = {
|
|
|
|
command = "${pyright}/bin/pyright-langserver";
|
|
|
|
args = [ "--stdio" ];
|
|
|
|
config = {
|
|
|
|
reportMissingTypeStubs = false;
|
|
|
|
python.analysis = {
|
|
|
|
typeCheckingMode = "basic";
|
|
|
|
autoImportCompletions = true;
|
|
|
|
};
|
|
|
|
};
|
2024-11-21 09:24:15 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
# OTHER LSP
|
|
|
|
yaml-language-server
|
|
|
|
lua-language-server
|
|
|
|
taplo
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|