Open aflip opened 4 days ago
I changed the source of ruff from bundled to environment and now it's not crashing. I don't get it.
This sounds similar to https://github.com/astral-sh/ruff-vscode/issues/607
I changed the source of ruff from bundled to environment and now it's not crashing. I don't get it.
Oh, that's interesting. What ruff version do you use locally (non bundled)?
Do you have a notebook that you could share that we can use for reproduction?
I just tried creating a notebook with the code above and I can't get Ruff to crash when hovering. Can you tell me a bit more about your setup? What extensions are you using? What VS code version are you using? Can you share a video where you hover over a name and Ruff crashes. I wonder what I do wrong that I'm unable to reproduce.
I am unable to reproduce the bug myself. it was present all day yesterday, despite various usual interventions like restarting code, the system etc.It stopped when I switched to useenv, but it's still using the bundled ruff. Found Ruff 0.8.0 at /home/XXX/.vscode-oss/extensions/charliermarsh.ruff-2024.56.0-linux-x64/bundled/libs/bin/ruff
and i am usually running the notebook from a mamba environment that doesn't have ruff so internally, nothing has changed. this is the notebook i was running https://github.com/pinecone-io/examples/blob/master/learn/generation/better-rag/02a-alt-chunking-methods.ipynb
should i mark this closed since i cant reproduce it?
I don't mind keeping the issue open for a little longer. Maybe you'll be able to reproduce the bug in the coming days. I do think there's a bug in Ruff or VS Code (or in combination with some other extension), but we just have never been able to reproduce it, which makes it hard to fix.
Thanks for the issue.
As per the panic message, it should only occur when a hover request is being made by the client for the entire notebook instead of a single text document (Python file) or a notebook cell. But, the method through which is panics (DocumentQuery::as_single_document
) could also return None
if there's a bug in adding the cell index (NotebookDocument.cell_index
field) or if the NotebookCell
itself doesn't exists in the vector (NotebookDocument.cells
field). If we can figure out which one is the actual cause of this issue, that can be very helpful.
I think we can update the return type of as_single_document
from Option
to Result
in which we can capture what the source of the error is.
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
settins.json
Ruff.log is here: It's the same message repeated.