Skip to content

Server panic when shuffling a mixed of code and markdown cells #575

Open
@dhruvmanila

Description

@dhruvmanila

Huh, this did give me the following (unrelated) panic though:

2024-08-07 15:37:33.967 [info] panicked at crates/ruff_server/src/server/api/requests/format.rs:67:10:
format should only be called on text documents or notebook cells

2024-08-07 15:37:33.975 [info]    0: std::backtrace::Backtrace::force_capture
   1: ruff_server::server::Server::run
   2: std::panicking::rust_panic_with_hook
   3: <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box
   4: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   5: _rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::option::expect_failed
   8: <ruff_server::server::api::requests::format::Format as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
   9: ruff_server::session::Session::take_snapshot
  10: ruff_python_trivia::pragmas::is_pragma_comment
  11: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
  12: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
  13: std::sys::pal::unix::thread::Thread::new
  14: __pthread_joiner_wake

And, then the editor hangs at "Saving 'issue.ipynb'"

Originally posted by @dhruvmanila in #573 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnotebookRelated to (Jupyter) notebooks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions