For context: I use Cursor (Pro subscription) to develop in python. I work in Jupyter notebooks (.ipynb files) and also normal python files (.py files) which I use as libraries.
As of July 1, 2024, the auto-suggestions provided by Copilot++ have not been working as usual in my Jupyter notebooks.
Usually, the code suggestions are relevant to the code I am writing (example: suggesting appropriate next lines, completing loops, or filling out docstrings according to a function I just wrote).
Now the code suggestions are lines of code that are slightly above the cursor. For one notebook I was investigating, I noticed that it always suggested to replace/insert the line(s) of code that are 8 lines up in the notebook (this happens within cells and across cells, and it even suggests markdown lines in a python code cell). In another notebook, it’s always suggesting the lines at are around 14 lines above. In some other notebooks, Copilot++ works normally.
In my .py files, it’s working normally.
In investigating for this forum post, I found some partial fixes:
-
In the first couple code cells in the notebook, Copilot++ works normally.
-
I had an import (“from scipy.optimize import fsolve”) in a cell midway down the notebook. Moving this to the code cell near the beginning (with all the other imports) seemed to help: Copilot++ works normally further in to the notebook, but still suggests existing lines of code further down.
The request ids of some erroneous Copilot++ responses (with privacy mode turned off):
2085f15d-502d-4e06-83ae-907065398cdd
c0f9bdf0-2bae-4aad-9911-b9bb436b1687
66eb9c17-0090-4d1d-9d07-3b74d69d4449
6ea736fc-1040-45b1-a321-dde4650853c3
I think this bug is related (or the same) to the one brought up in this thread: Copilot++ Suggesting Markdown in Code Blocks/Other Extremely Wrong Things
I’ve tried the fixes they tried (restarting/trying to update cursor; turning Copilot++ off and on; fast and legacy modes) with no noticeable changes.
Please let me know if you would like any other information so that I can help with resolving this bug.