Open paul-rogers opened 3 months ago
This issue also affects the left hand side ">" run menu for Python cells. Sometimes the "> v" pull-down does not appear for debugging. That is, the right-hand side contains only the ">" run triangle. Switching application windows, then switching back fixes the problem.
In addition, I observed the following which occurred after PyLance crashed due to a known bug that will be fixed in the next release. I don't see how the crash relates to the UI, however.
In the present case, clicking the "Debug" option did its thing, then the cell reverted to not having the debug pull-down. Switching application windows and back restored the pull-down.
Further, I decided to restart the notebook. However, the top Menu, where Restart is supposed to appear, did not contain the Restart button. An abbreviated set of options appeared instead. Again, switching application windows, and switching back to VS Code caused the full menu to appear.
Please can you share a screen recording of the issue.
You can use gifcap.dev
to record the screen into a gif file.
@DonJayamanne, please see the attached recording. It isn't a GIF: It is a video in a zip file. In it I create a new notebook. The default Python cell has the wrong menu. It changes to the correct one after I select a Python environment from a popup. Then, I add a Markdown cell. Wrong menu. I switch to another app and back. The menu corrects itself.
Let me know if you need more detail.
Just upgraded to the latest VS Code. Menu fonts changed, as did some aspects of notebooks. However, the menu behavior described here is, unfortunately, the same.
A few more hints.
import sys
. Flip away and back so that the menu is correct.test
. Flip away and back so the menu is correct.An interesting aspect is that if we now delete a Markdown cell, and add a new one in its place, the menu is correct. But, if we add a Markdown cell at the end, the menu starts wrong.
All of this points to something about the menu display being out-of-sync with respect to the cell type. Maybe the menu is a floating object and it is not being informed when it is moved from one cell to another, if the cell is in a "new" state?
Jupyter notebook cells provide a pop-up mention at the top-left corner of cell when focus is on the cell. However, the content of the menu fails to update to reflect the current cell. This seems to be a UI event issue.
To reproduce, read these instructions on your phone or a separate window so you don't have to change focus from VS code while following along.
import sys
. Notice that the cell menu contains "... <trashcan>".I have found that, sometimes, I can get the menus to reset by clicking onto another cell and back. I find I must frequently do this when adding a Markdown cell.
Here is another variation:
a = 10
. Switch away from VS code and back again to get the proper menu.Yet another variation. The above examples all added cells at the bottom. This time, we'll add one in the middle.
This behavior does not happen all the time. It only happens for new cells. If you click around your existing cells, you'll see that the cell menu is correct.
In short, it seems that the UI is not receiving some kind of UI event that tells it to switch the hover menu to the version for a newly created cell. The menu seems to lag a bit. We can force an update by switching application focus.
Workaround
Having incorrect menus is a nuisance. One can often get the correct menu by clicking on another cell, then back. Sometimes switching to another app and VS Code is necessary.
Environment data