nix-community / vscode-nix-ide

Nix language support for VSCode editor [maintainer: @jnoortheen]
https://marketplace.visualstudio.com/items?itemName=jnoortheen.nix-ide
MIT License
273 stars 20 forks source link

NIL unwraps URI without checking path's existence #323

Closed spikespaz closed 1 year ago

spikespaz commented 1 year ago

The NIL server breaks when there is an unsaved, untitled file open (which is detected to be Nix).

I understand that this is an issue with NIL, but would it be best for the extension to not pass invalid file URIs?

[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
spikespaz commented 1 year ago

Oxalica thought this should be closed.