lsp: fix elixir lsp

This commit is contained in:
Pedro Alves 2022-10-22 15:45:03 +01:00
parent 2db1c36c30
commit c7b561b40c
4 changed files with 19 additions and 8 deletions

View file

@ -20,7 +20,8 @@ let
{ {
name = "elixirls"; name = "elixirls";
description = "Enable elixirls"; description = "Enable elixirls";
packages = [ pkgs.elixir_ls ]; packages = [ ];
cmd = "${pkgs.elixir_ls}/bin/elixir-ls";
} }
{ {
name = "gdscript"; name = "gdscript";

View file

@ -6,6 +6,7 @@
, description ? "Enable ${name}." , description ? "Enable ${name}."
, serverName ? name , serverName ? name
, packages ? [ pkgs.${name} ] , packages ? [ pkgs.${name} ]
, cmd ? null
, ... , ...
}: }:
# returns a module # returns a module
@ -24,7 +25,12 @@
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPackages = packages; extraPackages = packages;
plugins.lsp.enabledServers = [ serverName ]; plugins.lsp.enabledServers = [{
name = serverName;
extraOptions = {
inherit cmd;
};
}];
}; };
}; };
} }

12
tests/flake.lock generated
View file

@ -97,12 +97,12 @@
}, },
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-51K3gjUQAgBuXJMUCxloBqJeRiB5nwix0kMSbffDxak=", "narHash": "sha256-NLfZri8QaYVDjLHfDAqP+DHyIRsb+bXn+2dJtoFo1LM=",
"path": "/nix/store/y78h7ccdy3jdy4mwyw8dyg3prhwqx61f-source", "path": "/nix/store/j8vf0lmn4w9w18jva2dn9kfk2aw1niff-source",
"type": "path" "type": "path"
}, },
"original": { "original": {
"path": "/nix/store/y78h7ccdy3jdy4mwyw8dyg3prhwqx61f-source", "path": "/nix/store/j8vf0lmn4w9w18jva2dn9kfk2aw1niff-source",
"type": "path" "type": "path"
} }
}, },
@ -116,12 +116,12 @@
}, },
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-51K3gjUQAgBuXJMUCxloBqJeRiB5nwix0kMSbffDxak=", "narHash": "sha256-NLfZri8QaYVDjLHfDAqP+DHyIRsb+bXn+2dJtoFo1LM=",
"path": "/nix/store/y78h7ccdy3jdy4mwyw8dyg3prhwqx61f-source", "path": "/nix/store/j8vf0lmn4w9w18jva2dn9kfk2aw1niff-source",
"type": "path" "type": "path"
}, },
"original": { "original": {
"path": "/nix/store/y78h7ccdy3jdy4mwyw8dyg3prhwqx61f-source", "path": "/nix/store/j8vf0lmn4w9w18jva2dn9kfk2aw1niff-source",
"type": "path" "type": "path"
} }
}, },

View file

@ -52,6 +52,10 @@
nixGrammars = false; nixGrammars = false;
}; };
}; };
elixir-ls = build {
plugins.lsp.enable = true;
plugins.lsp.servers.elixirls.enable = true;
};
lsp-lines = build-stable { lsp-lines = build-stable {
plugins.lsp-lines.enable = true; plugins.lsp-lines.enable = true;