nix-community / nixvim

Configure Neovim with Nix! [maintainers=@GaetanLepage, @traxys, @mattsturgeon, @khaneliman]
https://nix-community.github.io/nixvim
MIT License
1.71k stars 263 forks source link

[BUG] LeanLS not working (LSP plugin) #2353

Open psyos10 opened 2 weeks ago

psyos10 commented 2 weeks ago
Field Description
Plugin LSP w/ leanls
Nixpkgs 24.05

Description

When adding leanls on nixos 24.05 with nixvim 24.05 branch, I receive an error: value is null while a set was expected' when rebuilding . I'm unsure whether this has something to do with me as I am not too familiar with debugging nix.

Minimal, Reproducible Example (MRE)

Add:

      lsp = {  
        enable = true;
        servers = {
            leanls.enable = true;
        };
      };

to config and it should error out (no extra config).

MattSturgeon commented 2 days ago

I receive an error: value is null while a set was expected' when rebuilding

Do you have the full error? In particular it'd help to know what option the error relates to.

Does this error only show up when lsp.servers.leanls.enable = true and disappears when false?

psyos10 commented 2 days ago

The error disappears when the optionlsp.servers.leanls.enable = true is set to false.

Full error (apologies it split into two):

`building Nix...
building the system configuration...
error:
       … while calling anonymous lambda
     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1571:24:

     1570|     let f = attrPath:
     1571|       zipAttrsWith (n: values:
         |                        ^
     1572|         let here = attrPath ++ [n]; in

   … while calling anonymous lambda

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1205:18:

     1204|         mapAttrs
     1205|           (name: value:
         |                  ^
     1206|             if isAttrs value && cond value

   … from call site

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1208:18:

     1207|             then recurse (path ++ [ name ]) value
     1208|             else f (path ++ [ name ]) value);
         |                  ^
     1209|     in

   … while calling anonymous lambda

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:242:72:

      241|           # For definitions that have an associated option
      242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
         |                                                                        ^
      243|

   … while evaluating the option `system.build.toplevel':

   … while calling anonymous lambda

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:824:28:

      823|         # Process mkMerge and mkIf properties.
      824|         defs' = concatMap (m:
         |                            ^
      825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

   … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix':

   … from call site

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:825:137:

      824|         defs' = concatMap (m:
      825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
         |                                                                                                                                         ^
      826|         ) defs;

   … while calling 'dischargeProperties'

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:896:25:

      895|   */
      896|   dischargeProperties = def:
         |                         ^
      897|     if def._type or "" == "merge" then

   … from call site

     at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:71:12:

       70|   # Replace runtime dependencies
       71|   system = foldr ({ oldDependency, newDependency }: drv:
         |            ^
       72|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

   … while calling 'foldr'

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:121:20:

      120|   */
      121|   foldr = op: nul: list:
         |                    ^
      122|     let

   … from call site

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:128:8:

      127|         else op (elemAt list n) (fold' (n + 1));
      128|     in fold' 0;
         |        ^
      129|

   … while calling 'fold''

     at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:124:15:

      123|       len = length list;
      124|       fold' = n:
         |               ^
      125|         if n == len

   … while calling anonymous lambda

     at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:64:50:

       63|
       64|   failedAssertions = map (x: x.message) (filter (x: !x.assertion) config.assertions);
         |                                                  ^
       65|

   error: value is null while a set was expected

`