oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.28k stars 39 forks source link

Nil not updating UI or stuck on loading #121

Open gytis-ivaskevicius opened 7 months ago

gytis-ivaskevicius commented 7 months ago

I've been trying out nil but I have consistently messages being stuck like this: image

After enabling debug logging (which should be mentioned in README.md) I noticed that it finishes loading inputs and there is nothing suspicious about the log

Log:

2024-01-28T00:07:17.076537Z  INFO nil::server: Loading flake workspace
2024-01-28T00:07:17.076550Z  INFO nil::server: Loading flake info
2024-01-28T00:07:17.092693Z  INFO nil::server: Evaluating NixOS options from /nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source
2024-01-28T00:07:17.092711Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: [], .. })
2024-01-28T00:07:17.092731Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 20.58µs
2024-01-28T00:07:17.092774Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 560ns
2024-01-28T00:07:17.880000Z  INFO nil::server: Loaded NixOS options (41 top-level options)
2024-01-28T00:07:17.880054Z  INFO nil::server: Evaluating 6 flake inputs
2024-01-28T00:07:17.880071Z DEBUG event{method="nil::server::SetNixosOptionsEvent"}: nil::server: Set NixOS options (41 top-levels)
2024-01-28T00:07:17.880085Z DEBUG event{method="nil::server::SetNixosOptionsEvent"}: nil::meter: handled event in 15.779µs
2024-01-28T00:07:17.880145Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 720ns
2024-01-28T00:07:17.895959Z DEBUG nil::server: Nix info: NixInfo { version: "2.18.1", flake: true, flake_show_filter_systems: true }
2024-01-28T00:07:17.895974Z  INFO nil::server: Evaluating flake input "devshell"
2024-01-28T00:07:17.916182Z  INFO nil::server: Evaluating flake input "home-manager"
2024-01-28T00:07:17.917567Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: ["devshell"], .. })
2024-01-28T00:07:17.917599Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 32.95µs
2024-01-28T00:07:17.917671Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 360ns
2024-01-28T00:07:17.973292Z  INFO nil::server: Evaluating flake input "nix2vim"
2024-01-28T00:07:17.974577Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: ["devshell", "home-manager"], .. })
2024-01-28T00:07:17.974631Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 54.74µs
2024-01-28T00:07:17.975383Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 490ns
2024-01-28T00:07:17.994648Z  INFO nil::server: Evaluating flake input "nixpkgs"
2024-01-28T00:07:17.996156Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: ["devshell", "nix2vim", "home-manager"], .. })
2024-01-28T00:07:17.996635Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 479.059µs
2024-01-28T00:07:17.997603Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 370ns
2024-01-28T00:07:18.460765Z  INFO nil::server: Evaluating flake input "unstable"
2024-01-28T00:07:18.462722Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: ["devshell", "nix2vim", "nixpkgs", "home-manager"], .. })
2024-01-28T00:07:18.463206Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 484.719µs
2024-01-28T00:07:18.467521Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 1.19µs
2024-01-28T00:07:18.931380Z  INFO nil::server: Evaluating flake input "utils"
2024-01-28T00:07:18.933798Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: ["devshell", "nix2vim", "nixpkgs", "unstable", "home-manager"], .. })
2024-01-28T00:07:18.937381Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 3.58441ms
2024-01-28T00:07:18.947013Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 1.26µs
2024-01-28T00:07:18.962275Z  INFO nil::server: Finished loading flake inputs. 0/6 failed
2024-01-28T00:07:18.968931Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::server: Set flake info: Some(FlakeInfo { flake_file: FileId(2), input_store_paths: {"utils": Path("/nix/store/c3ar4r81dxqmkcp3sc2glwc3xlrwfh0p-source"), "forgit-git": Path("/nix/store/zjs6ql3313v5iawcyf5yyvj7rxc60xq1-source"), "unstable": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "home-manager": Path("/nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source"), "nixpkgs": Path("/nix/store/km1dyj2f2maw20y3fai48q2r3j9x0myf-source"), "devshell": Path("/nix/store/x4211cj70jn5jxzcy8bw0nbr0ayyhaii-source"), "nix2vim": Path("/nix/store/32lfv8b7dd4wxhxlgbra5lzfr9rry8z0-source")}, input_flake_outputs: ["devshell", "nix2vim", "utils", "nixpkgs", "unstable", "home-manager"], .. })
2024-01-28T00:07:18.972737Z DEBUG event{method="nil::server::SetFlakeInfoEvent"}: nil::meter: handled event in 3.805569ms
2024-01-28T00:07:18.980313Z DEBUG event{method="nil::server::UpdateDiagnostics"}: nil::meter: handled event in 1.6µs

Config: (gets parsed to lspconfig)

  use.lspconfig.nil_ls.setup = callWith {
    cmd = [ (getExe pkgs.nil) ];
    inherit capabilities;
    settings = {
      "['nil']".nix = {
        maxMemoryMB = 8192;
        flake.autoArchive = true;
        flake.autoEvalInputs = true;
      };
    };
  };
gytis-ivaskevicius commented 7 months ago

Fixed it by:

  setup.fidget = {
    progress.display.progress_ttl = 3;
  };

Not sure if you'd like to keep this issue, probably missing some signal from lsp side to clear it