Skip to content

Commit

Permalink
helix: use typescript-ls for js/ts
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Jan 29, 2024
1 parent 30f2098 commit 6b80981
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions home/editors/helix/languages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
{
name = "javascript";
auto-format = true;
language-servers = ["deno-lsp"];
formatter = deno "javascript";
language-servers = ["typescript-language-server"];
}
{
name = "json";
Expand All @@ -51,7 +52,8 @@
{
name = "typescript";
auto-format = true;
language-servers = ["deno-lsp"];
formatter = deno "typescript";
language-servers = ["typescript-language-server"];
}
]
++ prettierLangs langs;
Expand Down Expand Up @@ -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"];
Expand Down

0 comments on commit 6b80981

Please sign in to comment.