Skip to content

hovering over variable in jupyter notebook causes ruff server to crash #14768

@TheOnlyWayUp

Description

@TheOnlyWayUp

https://files.rambhat.la/s/ySXwKiXNSLwcyde

from langchain_core.prompts import ChatPromptTemplate

system = """..."""

prompt = ChatPromptTemplate.from_messages([("system", system), ("human", "{input}")])

prompted_llm = prompt | llm
output = prompted_llm.invoke(texts[1])
print(output)
2024-12-04 09:50:35.199 [info] panicked at crates/ruff_server/src/server/api/requests/hover.rs:36:10:
hover should only be called on text documents or notebook cells

2024-12-04 09:50:35.199 [info]    0: ruff_server::server::Server::run::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}

2024-12-04 09:50:35.200 [info]    3: std::sys::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   
2024-12-04 09:50:35.200 [info] 6: core::option::expect_failed
   7: <ruff_server::server::api::requests::hover::Hover
2024-12-04 09:50:35.200 [info]  as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
   8: core::
2024-12-04 09:50:35.200 [info] ops::function::FnOnce::call_once{{vtable.shim}}
   9: core::ops
2024-12-04 09:50:35.200 [info] ::function::FnOnce::call_once{{vtable.shim}}
  10: std::sys::backtrace::__rust_begin_short_backtrace
 
2024-12-04 09:50:35.200 [info]  11: core::ops::function::FnOnce::call_once{{vtable.shim}}
  
2024-12-04 09:50:35.200 [info] 12: std::sys::pal::unix::thread::Thread::new::thread_start
  13: 
2024-12-04 09:50:35.200 [info] start_thread
  14: clone

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnotebookRelated to (Jupyter) notebooksserverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions