nix-community / nixd

Nix language server, based on nix libraries [maintainer=@inclyc,@Aleksanaa]
https://github.com/nix-community/nixd
GNU Lesser General Public License v3.0
919 stars 31 forks source link

NixVim \\ heavy flow of same errors then using nixd #604

Open Sk7Str1p3 opened 1 month ago

Sk7Str1p3 commented 1 month ago

Bug

image so any time i edit .nix file i get flow of those, exactly same errors

Logs

[START][2024-10-08 09:14:01] LSP logging initiated
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.121] 29882: <-- initialize(1)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.122] 29882"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    ": --> reply:initialize(1)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.122] 29882: --> call window/workDoneProgress/create(1)\nI[09:14:01.122] 29882: --> notify $/progress\nI[09:14:01.122] 29882: --> call attrset/evalExpr(1)\nI[09:14:01.123] 29882: --> call window/workDoneProgress/create(2)\nI[09:14:01.123] 29882: --> notify $/progress\nI[09:14:01.123] 29882: --> call attrset/evalExpr(1)\nI[09:14:01.123] 29882: --> call workspace/configuration(3)\nI[09:14:01.123] 29882: <-- initialized\nI[09:14:01.123] 29882: <-- textDocument/didOpen\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.124] 29882: --> notify textDocument/publishDiagnostics\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.125] 29882: <-- textDocument/inlayHint(2)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.125] 29882: <-- textDocument/inlayHint(3)\nI[09:14:01.125] 29882: <-- reply(1)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.125] 29882: --> call attrset/attrpathInfo(2)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.125] 29882: --> call attrset/attrpathInfo(3)\nI[09:14:01.125] 29882: <-- reply(2)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.125] 29882: <-- reply(3)\nE[09:14:01.125] 29882: workspace/configuration: parse error expected object\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.125] 29882: <-- textDocument/semanticTokens/full(4)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.128] 29882: --> reply:textDocument/semanticTokens/full(4)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.276] 29882: "
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "<-- reply(1)\nI[09:14:01.276] 29882: --> notify $/progress\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.277] 29882: <-- reply(2)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.277] 29882: <-- reply(3)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.277"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "] 29882: --> reply:textDocument/inlayHint(2)\nI[09:14:01.277] 29882: --> reply:textDocument/inlayHint(3)\n"
[ERROR][2024-10-08 09:14:01] .../vim/lsp/rpc.lua:770    "rpc"   "/nix/store/2dx04iayp5nl6zwsa60dsm82c58ghwk7-nixd-2.4.0/bin/nixd"   "stderr"    "I[09:14:01.646] 29882: <-- reply(1)\nI[09:14:01.646] 29882: --> notify $/progress\n"

Config

part of my NixVim Configuration, declaring LSPs:

lsp-lines.enable = true;
      lsp-format.enable = true;
      lsp = {
        enable = true;
        inlayHints = true;
        servers = {
          lua-ls = {
            enable = true;
          };
          pylsp = {
            enable = true;
          };
          nixd = {
            enable = true;
          };
          clangd = {
            enable = true;
          };
        };
      };

i guess something is missed here but cant understand or find any info what exactly. LSP works, the only problems are these error messages. thx

inclyc commented 1 month ago

nixvim issue: https://github.com/nix-community/nixvim/issues/2390

poperigby commented 1 month ago

Having the same issue, but not using NixVim. Just normally configured Neovim.

inclyc commented 1 month ago

This is a bug in nvim, see https://github.com/neovim/neovim/commit/84bbbd9fbee8b78e53a0ee956d623befa755dc65.

Deliganli commented 1 month ago

I have the same issue. I tried the suggested workarounds in the tickets linked but it doesn't stop logging. .local/state/nvim/lsp.log file is growing very fast.

It looks to me a different issue. In my understanding the issue in that ticket is triggered when the nix file contains a unicode character. In my case, logging very similarly to the ticket, file doesn't contain any special character.

It feels like nixd info logs are printed to stderr.

inclyc commented 2 weeks ago

So there is still reports on semantic tokens w/ Unicode character, let's reopen this issue and I'll inspect a little bit.

inclyc commented 1 week ago

Recently, I temporarily disabled semantic tokens in #616. We've received considerable feedback suggesting that this feature requires more thoughtful refinement. As of #616 (v2.5.1+), syntax coloring is now disabled in your editor by default. This should workaround the issue and ensure it no longer causes any inconvenience.

In the future, semantic highlighting may undergo a significant refactor before being reintroduced.

Happy coding!

inclyc commented 1 week ago

Part of #573.