From 501c7fdf076380985dd89bd3f32c14c974fe9710 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Fri, 23 Feb 2024 20:58:00 +1300 Subject: [PATCH] feat: typescript language server => helix config --- .../console/editor/helix/languages.nix | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/home/modules/console/editor/helix/languages.nix b/home/modules/console/editor/helix/languages.nix index db7dffe..cf75133 100644 --- a/home/modules/console/editor/helix/languages.nix +++ b/home/modules/console/editor/helix/languages.nix @@ -93,6 +93,40 @@ in config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"]; }; + dprint = { + command = lib.getExe pkgs.dprint; + args = ["lsp"]; + }; + + 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"];