oxalica/nil

Crash when creating new files in the workspace

Closed this issue · 1 comments

When I create a new file into the workspace using a file manager plugin like chadtree, the LSP server crashes with this error message:

[ERROR][2024-05-09 14:23:17] .../vim/lsp/rpc.lua:734    "rpc"   "/nix/store/qz7jzxmwsv9xfxqsx03rmbdc4blhrhz2-nil-2023-08-09/bin/nil"    
"stderr"        "2024-05-09T11:23:17.089356Z ERROR nil: Unexpected error: Unhandled notification: workspace/didCreateFiles\n"

Using nixvim with config:

lsp.servers = {
  nil_ls = {
    enable = true;
    settings.formatting.command = ["alejandra"];
  };
};

"stderr" "2024-05-09T11:23:17.089356Z ERROR nil: Unexpected error: Unhandled notification: workspace/didCreateFiles\n"

According to the LSP 3.17 specification, client sends workspace/didCreateFiles only when the server announced the capability workspace.fileOperations.didCreate. We do not announce that.

I'd blame the LSP client implementation here.