oxalica / nil

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

Random crash #139

Closed gepbird closed 3 months ago

gepbird commented 3 months ago

This seems to happen randomly and silently, I don't even notice it until I don't see completions popping up.

[ERROR][2024-05-15 22:06:47] .../vim/lsp/rpc.lua:734    "rpc"   "/home/name/.nix-profile/bin/nil"   "stderr"    
"
thread 'main' panicked at /build/nil-2023-08-09-vendor.tar.gz/text-size/src/range.rs:48:9:
assertion failed: start.raw <= end.raw
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: nil::convert::from_range
   4: nil::server::Server::on_did_change
   5: async_lsp::router::Router<St,Error>::notification::{{closure}}
   6: <async_lsp::concurrency::Concurrency<S> as async_lsp::LspService>::notify
   7: <core::pin::Pin<P> as core::future::future::Future>::poll
   8: async_lsp::MainLoop<S>::run::{{closure}}::{{closure}}::{{closure}}
   9: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
  10: nil::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
"
oxalica commented 3 months ago

Please provide the offending code and changes to reproduce the issue.

gepbird commented 3 months ago

I didn't get this error since, maybe it's fixed, maybe it's just a rare error. I'll update you when I can reproduce it, feel free to close this issue for now.

Last time restarting nil fixed the issue.