Skip to content

Rust Analyzer Crashes When Opening Continue Diff in VSCode #17335

Closed
@chrisoutwright

Description

@chrisoutwright

rust-analyzer version: rust-analyzer 0.3.1975-standalone (71a816a 2024-05-26)

rustc version: rustc 1.63.0 (e4e8b5a6b 2023-06-30)

editor or extension: VSCode Version 1.89.1 (user setup) with Continue extension v0.8.38

relevant settings:

  • OS: Windows_NT x64 10.0.22631
  • LLM: Ollama self-hosted: codestral_22b-v0.1-q8_0

repository link (if public, optional):

code snippet to reproduce:

// Any code snippet will do, as the issue occurs when using the Continue extension to open the Continue Diff feature.
fn main() {
    println!("Hello, world!");
}

Description:
When using the Continue extension in Visual Studio Code, attempting to open the Continue Diff feature causes Rust Analyzer to crash. The crash occurs specifically when performing the following steps:

  1. Highlight any code with Shift-Ctrl-L and choose the action /edit within the Continue panel.
  2. Wait for the Continue Diff to open.

At this point, the Rust Analyzer panics and crashes with the following error message:

thread 'LspServer' panicked at crates\paths\src\lib.rs:200:9:
assertion failed: path.is_absolute()

This issue results in the Rust Analyzer becoming unresponsive, and subsequent attempts to use its features fail. The error message indicates a problem with path handling in the Rust Analyzer. This issue only occurs when the Continue Diff is opened or left opened when restarting.

Log output:

thread 'LspServer' panicked at crates\paths\src\lib.rs:200:9:
assertion failed: path.is_absolute()
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: core::panicking::panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:145
   3: rust_analyzer::global_state::GlobalState::new
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   6: rust_analyzer::main_loop::main_loop
   7: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread '<unnamed>' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\lsp-server-0.7.6\src\stdio.rs:28:37:
receiver was dropped, failed to send a message: "SendError(..)"
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: core::result::unwrap_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\result.rs:1654
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\jod-thread-0.1.2\src\lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: core::result::unwrap_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\result.rs:1654
   3: stdx::thread::JoinHandle<T>::join
   4: lsp_types::trace::_::<impl serde::de::Deserialize for lsp_types::trace::TraceValue>::deserialize
   5: lsp_types::trace::_::<impl serde::de::Deserialize for lsp_types::trace::TraceValue>::deserialize
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 6:39:28 PM] Client Rust Analyzer Language Server: connection to server is erroring. Shutting down server.
[Error - 6:39:28 PM] Request textDocument/semanticTokens/range failed.
  Message: write EPIPE
  Code: -32099 
[Error - 6:39:28 PM] Stopping server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 6:39:28 PM] Stopping server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions