Setting up helix LSPs more reproducibly

This commit is contained in:
Haak Saxberg 2025-09-25 00:28:07 -07:00
parent 7a7e3d56b2
commit fc1075fc52

View file

@ -1,4 +1,8 @@
{ pkgs, ...}:
let
# We need a version of vscode-language-servers that's less than 4.10
oldNixpkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/f68797befe20fc56153363e71ea0f0b74542db4b.tar.gz") {};
in
{
programs.helix = {
enable = true;
@ -9,10 +13,29 @@
};
typescript-language-server = {
command = "typescript-language-server";
command = "${pkgs.typescript-language-server}/bin/typescript-language-server";
args = [ "--stdio" ];
config.hostInfo = "helix";
};
eslint = {
command = "${oldNixpkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-eslint-language-server";
args = ["--stdio"];
config = {
run = "onType";
validate = "on";
nodePath = "";
rulesCustomizations = [];
workingDirectory.mode = "location";
showDocumentation.enable = true;
experimental = { useFlatConfig = false; };
problems = { shortenToSingleLine = false; };
codeAction = {
enable = true;
location = "separateLine";
};
};
};
};
language = [
@ -25,11 +48,13 @@
}
{
name = "typescript";
file-types = [ "tsx" "ts" ];
auto-format = true;
formatter = { command = "prettier"; args = ["--parser=typescript"]; };
language-servers = [
{ name = "eslint"; }
{
name = "typescript-language-server";
except-features = [ "format" "diagnostics" ];
}
];
}
@ -45,6 +70,7 @@
normal = "block";
select = "block";
};
bufferline = "multiple";
};
keys = {
normal = {
@ -52,7 +78,6 @@
"ret" = [ "move_line_down" "goto_first_nonwhitespace" ]; # Maps the enter key to move to start of next line
X = "extend_line_above";
D = "delete_char_backward";
";" = "command_mode"; # Note: this shadows the normal use of ";", which is to reset the selection to the cursor.
"S-ret" = [ "move_line_up" "goto_first_nonwhitespace" ];
};
insert = {