-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
astral-sh/ruff
#15398Labels
bugSomething isn't workingSomething isn't working
Description
I am working in vscode on a .ipynb notebook, and everytime my cursor hovers over any code, i get the ruff panic message as above
example of the code it crashed over
def search_and_lookup(query_vector, top_k=10):
# Perform the search
results = ngt_corpus_index.search(query_vector, top_k)
# Look up the document information for each result
enriched_results = []
for ngt_index, distance in results:
# Find the corresponding document and chunk
cumulative_count = 0
for doc in lookup_table:
if ngt_index < cumulative_count + doc['num_chunks']:
chunk_id = ngt_index - cumulative_count
enriched_results.append({
'ngt_index': ngt_index,
'distance': distance,
'document_id': doc['document_id'],
'chunk_id': chunk_id
})
break
cumulative_count += doc['num_chunks']
return enriched_resultsRuff.log is here: It's the same message repeated.
2024-11-23 22:45:07.465 [info] Name: Ruff
2024-11-23 22:45:07.465 [info] Module: ruff
2024-11-23 22:45:07.465 [info] Python extension loading
2024-11-23 22:45:07.465 [info] Waiting for interpreter from python extension.
2024-11-23 22:45:07.465 [info] Python extension loaded
2024-11-23 22:45:07.465 [info] Using interpreter: /bin/python
2024-11-23 22:45:07.465 [info] Using bundled executable: /home/XX/.vscode-oss/extensions/charliermarsh.ruff-2024.56.0-linux-x64/bundled/libs/bin/ruff
2024-11-23 22:45:07.465 [info] Found Ruff 0.8.0 at /home/XX/.vscode-oss/extensions/charliermarsh.ruff-2024.56.0-linux-x64/bundled/libs/bin/ruff
2024-11-23 22:45:07.465 [info] Server run command: /home/XX/.vscode-oss/extensions/charliermarsh.ruff-2024.56.0-linux-x64/bundled/libs/bin/ruff server
2024-11-23 22:45:07.465 [info] Server: Start requested.
2024-11-23 23:37:34.744 [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-11-23 23:37:34.807 [info] 0:
2024-11-23 23:37:34.807 [info] ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:37:35.122 [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
0: ruff_server::server::Server::run::
2024-11-23 23:37:35.122 [info] {{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:37:35.316 [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
0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2024-11-23 23:37:35.316 [info]
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:37:37.547 [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
0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4
2024-11-23 23:37:37.547 [info] : rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:39:09.761 [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-11-23 23:39:09.762 [info] 0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::
2024-11-23 23:39:09.762 [info] thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:39:12.228 [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
0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
2024-11-23 23:39:12.229 [info] 6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:41:15.697 [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-11-23 23:41:15.698 [info] 0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:42:34.445 [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-11-23 23:42:34.445 [info] 0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2024-11-23 23:41:15.697 [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-11-23 23:41:15.698 [info] 0: ruff_server::server::Server::run::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::begin_panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: rust_begin_unwind
5: core::panicking::panic_fmt
6: core::option::expect_failed
7: <ruff_server::server::api::requests::hover::Hover as ruff_server::server::api::traits::BackgroundDocumentRequestHandler>::run_with_snapshot
8: core::ops::function::FnOnce::call_once{{vtable.shim}}
9: core::ops::function::FnOnce::call_once{{vtable.shim}}
10: std::sys::backtrace::__rust_begin_short_backtrace
11: core::ops::function::FnOnce::call_once{{vtable.shim}}
12: std::sys::pal::unix::thread::Thread::new::thread_start
13: start_thread
at ./nptl/pthread_create.c:447:8
14: clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working