File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 5252 {
5353 package ? null ,
5454 description ? "The ${ name } language server." ,
55+ # lsp-packages.nix tracks some custom commands, however this is currently not used by the server submodule
56+ cmd ? null ,
5557 } :
5658 lib . mkOption {
5759 type = mkServerSubmodule { inherit name package ; } ;
5860 inherit description ;
5961 default = { } ;
6062 } ;
6163
62- # TODO: generate package defaults from lsp-packages.nix
63- serverSpecs = {
64- nixd . package = "nixd" ;
65- } ;
64+ # Combine `packages` and `customCmd` sets from `lsp-packages.nix`
65+ # We use this set to generate the package-option defaults
66+ serverPackages =
67+ (
68+ {
69+ unpackaged ,
70+ packages ,
71+ customCmd ,
72+ } :
73+ builtins . mapAttrs ( _ : package : { inherit package ; } ) packages // customCmd
74+ )
75+ ( import ../../plugins/lsp/lsp-packages.nix ) ;
6676in
6777{
6878 options . lsp = {
8191 servers = lib . mkOption {
8292 type = types . submodule {
8393 freeformType = types . attrsOf ( mkServerSubmodule { } ) ;
84- options = builtins . mapAttrs mkServerOption serverSpecs ;
94+ options = builtins . mapAttrs mkServerOption serverPackages ;
8595 } ;
8696
8797 description = ''
You can’t perform that action at this time.
0 commit comments