oxalica / nil

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

Server unexpected shutdown on non-file URI `untitled:Untitled-1` from vscode #58

Closed spikespaz closed 1 year ago

spikespaz commented 1 year ago
[Error - 2:12:44 PM] Client Nix: connection to server is erroring. Shutting down server.
[Error - 2:12:44 PM] Connection to server got closed. Server will not be restarted.
[Error - 2:12:44 PM] Stopping server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 2:12:44 PM] Stopping server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /build/cargo-vendor-dir/lsp-server-0.7.0/src/stdio.rs:29:37
stack backtrace:
2023-02-04T21:12:44.371058Z ERROR nil: Unexpected error: Non-file URI: untitled:Untitled-1
Non-file URI: untitled:Untitled-1

Also cross-posted to vscode-nix-ide because I don't even think they should be sending you invalid URIs.

https://github.com/nix-community/vscode-nix-ide/issues/323

oxalica commented 1 year ago

:thinking: So vscode sends untitled:... URI instead of normal file://... ones. It's a valid URI according to LSP specs and is mentioned. We need some special handling for it.

Also cross-posted to vscode-nix-ide because I don't even think they should be sending you invalid URIs.

I think there's nothing to do with vscode-nix-ide.