diff --git a/home/programs/editors/helix/default.nix b/home/programs/editors/helix/default.nix index 458e94c..772c5f6 100644 --- a/home/programs/editors/helix/default.nix +++ b/home/programs/editors/helix/default.nix @@ -1,8 +1,9 @@ -{...}: { +_: { imports = [ ./languages.nix ./themes/tokyonight.nix ]; + programs.helix = { enable = true; defaultEditor = true; diff --git a/home/programs/editors/helix/languages.nix b/home/programs/editors/helix/languages.nix index d9d5219..1c6bdd2 100644 --- a/home/programs/editors/helix/languages.nix +++ b/home/programs/editors/helix/languages.nix @@ -3,11 +3,13 @@ lib, ... }: { + home.packages = [(pkgs.callPackage ../../../../pkgs/scls {})]; programs.helix.languages = { language = with pkgs; [ { name = "nix"; auto-format = true; + language-servers = ["scls" "nil"]; formatter = { command = lib.getExe alejandra; args = ["-q"]; @@ -16,9 +18,7 @@ { name = "rust"; auto-format = true; - language-servers = [ - "rust-analyzer" - ]; + language-servers = ["scls" "rust-analyzer"]; formatter = { command = lib.getExe rustfmt; args = ["--edition" "2021"]; @@ -27,12 +27,62 @@ { name = "lua"; auto-format = true; + language-servers = ["scls" "lua-language-server"]; formatter = { command = lib.getExe stylua; }; } + { + 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"]; + }; + } ]; language-server = with pkgs; { + scls = { + command = "simple-completion-language-server"; + config = { + feature_snippets = true; + feature_paths = true; + }; + }; nil = { command = lib.getExe nil; }; @@ -44,6 +94,17 @@ command = "${typescript-language-server}/bin/typescript-language-server"; args = ["--stdio"]; }; + lua = { + command = lib.getExe lua-language-server; + }; + taplo = { + command = lib.getExe taplo; + args = ["lsp" "stdio"]; + }; + ruff = { + command = lib.getExe ruff; + args = ["server" "--preview"]; + }; rust-analyzer.config = { checkOnSave.command = "clippy"; inlayHints = {