diff --git a/home/editors/helix/languages.nix b/home/editors/helix/languages.nix index 0000407e..c9f1d796 100644 --- a/home/editors/helix/languages.nix +++ b/home/editors/helix/languages.nix @@ -37,7 +37,8 @@ { name = "javascript"; auto-format = true; - language-servers = ["deno-lsp"]; + formatter = deno "javascript"; + language-servers = ["typescript-language-server"]; } { name = "json"; @@ -51,7 +52,8 @@ { name = "typescript"; auto-format = true; - language-servers = ["deno-lsp"]; + formatter = deno "typescript"; + language-servers = ["typescript-language-server"]; } ] ++ prettierLangs langs; @@ -95,6 +97,35 @@ config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"]; }; + typescript-language-server = { + command = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server"; + args = ["--stdio"]; + config = let + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + in { + typescript-language-server.source = { + addMissingImports.ts = true; + fixAll.ts = true; + organizeImports.ts = true; + removeUnusedImports.ts = true; + sortImports.ts = true; + }; + + typescript = {inherit inlayHints;}; + javascript = {inherit inlayHints;}; + + hostInfo = "helix"; + }; + }; + vscode-css-language-server = { command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; args = ["--stdio"];