-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thread 'LspServer' panicked at 'called Option::unwrap()
on a None
value', crates/vfs/src/lib.rs:143:38
#13236
Comments
The panic comes from fetching file contents of a file that is not in the vfs ... I assume you |
Yes, although even after I restarted rust-analyzer it has been giving similar issues several times. Maybe the fact that the rust checkout is in the |
I doubt that, so this panic is odd, I wonder if there is a race condition here because we apparently created a |
Okay I can see one way how this can crash once (not repeatedly unless the same scenario is replicated). If in one |
To give a bit more info, the |
Ye that pretty much describes a series of action that can cause the problem described in my previous comment, but I am still unsure how that would get the server stuck in an inconsistent state, unless panicking in that code can poison something there 🤔 |
When receiving multiple change events for a single file id where the last change is a delete the server panics, as it tries to access the file contents of a deleted file. This occurs due to the VFS changes and the in memory file contents being updated immediately, while `process_changes` processes the events afterwards in sequence which no longer works as it will only observe the final file contents. By folding these events together, we will no longer try to process these intermediate changes, as they aren't relevant anyways. Potentially fixes rust-lang#13236
When receiving multiple change events for a single file id where the last change is a delete the server panics, as it tries to access the file contents of a deleted file. This occurs due to the VFS changes and the in memory file contents being updated immediately, while `process_changes` processes the events afterwards in sequence which no longer works as it will only observe the final file contents. By folding these events together, we will no longer try to process these intermediate changes, as they aren't relevant anyways. Potentially fixes rust-lang#13236
Amalgamate file changes for the same file ids in process_changes When receiving multiple change events for a single file id where the last change is a delete the server panics, as it tries to access the file contents of a deleted file. This occurs due to the VFS changes and the in memory file contents being updated immediately, while `process_changes` processes the events afterwards in sequence which no longer works as it will only observe the final file contents. By folding these events together, we will no longer try to process these intermediate changes, as they aren't relevant anyways. Potentially fixes #13236
I got the following error several times in a row while working on a project which has a rust-lang/rust checkout in a subdirectory. The final message that vscode won't restart rust-analyzer happened while I had a file in src/test/ui open.
rust-analyzer version: rust-analyzer version: 0.3.1203-standalone
rustc version: rustc 1.65.0-nightly (750bd1a7f 2022-09-14)
relevant settings: None that I know of.
The text was updated successfully, but these errors were encountered: