Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables explorer not updating when running the interactive session from the editor #6993

Closed
kylebradbury opened this issue Aug 7, 2021 · 13 comments · Fixed by #7118
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug interactive-window Impacts interactive window

Comments

@kylebradbury
Copy link

Environment data

  • VS Code version: 1.59.0
  • Jupyter Extension version (available under the Extensions sidebar): v2021.8.1195043623
  • Python Extension version (available under the Extensions sidebar): v2021.8.1105858891
  • OS (Windows | Mac | Linux distro) and version: Mac Big Sur 11.4 (20F71) (M1 processor, 2020)
  • Python and/or Anaconda version: Python 3.8.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

When a code segment is run from the editor in the interactive window, the variable list in the variables explorer would reflect those changes that occur in the interactive window.

Actual behaviour

The variable list in variables explorer does not update after running code in the interactive window from the editor. It updates after clicking on the interactive window; the variable values may reflect previous states of those variables in the meantime.

Steps to reproduce:

Demo reproducing the issue:

vscode-jupyter-issue

Logs

No output

@kylebradbury kylebradbury added the bug Issue identified by VS Code Team member as probable bug label Aug 7, 2021
@jon9885
Copy link

jon9885 commented Aug 7, 2021

I Have the same problem.
The temporary fix is to return to the old interface using "jupyter.enableNativeInteractiveWindow": false

@joyceerhl
Copy link
Contributor

Thanks for filing a bug and sorry for the trouble. This is an oversight and is due to the fact that our variable explorer is populated based on an active notebook editor (and the interactive window contains an embedded notebook editor). The desired behavior is for the variable explorer for the interactive window to be populated based on a visible but not active interactive window, and to remain populated when focus is placed in a #%% file.

@joyceerhl
Copy link
Contributor

On restart the variable explorer doesn't get cleared for the interactive window either; it should.

@thor4
Copy link

thor4 commented Aug 10, 2021

I Have the same problem.
The temporary fix is to return to the old interface using "jupyter.enableNativeInteractiveWindow": false

I've tried checking and unchecking that box. Neither action results in correct variable explorer behavior. I have to click into the interactive window to trigger an update.

Separately, there are times when the variable explorer disappears entirely for me. I have to close the interactive window and re-open it, starting over, for it to function again. I have not been able to pinpoint the steps to reproduce this error, but if I do, I will post them here.

Finally, I really dislike this new layout for the variable explorer. Are we stuck with having it tied to the bottom panel with "problems, output, etc.."? Before, it fit neatly in the top of the interactive window layout (see attached screenshot).
prev_interactive_window_layout

@joyceerhl
Copy link
Contributor

@thor4 If you reload VS Code after toggling that setting to 'false', you should get back the old interactive window behavior. That will be a temporary fix.

The current plan is to have the variable explorer in the bottom panel, and this is also how the variable explorer for native notebooks works. An alternative would be have VS Code provide a grid view and render that as part of the interactive composite editor. Please consider filing a feature request on https://github.com/microsoft/vscode (fyi @rebornix)

@mosierbryon
Copy link

Can I just say that I love the "old" style and desperately want it to always be an option.

@thor4
Copy link

thor4 commented Aug 11, 2021

Thanks, I will look at the feature request option when I get some time. If someone is able to do it before me, please link here so I and others can provide support. Otherwise I will link here when I am able to do it.

In the meantime, I was able to reproduce the issue of all variables disappearing completely. If you right click on the bottom panel and move it to the right of the screen, all variables disappear, including the table styling and everything. Trying to move it back to the bottom of the screen does nothing. You have to completely close out of the interactive window and restart it. Please let me know if you need further information.

@joyceerhl
Copy link
Contributor

I was able to reproduce the issue of all variables disappearing completely

@thor4 Thanks for the clear repro steps, looks like it actually impacts regular Jupyter notebooks too, I've created #7065 to track that bug.

@joyceerhl
Copy link
Contributor

@mosierbryon Thanks for the feedback--it would help us to understand why the old style is better. Are you referring to the old interactive window all up, or the old variable explorer (embedded in the interactive window) specifically? What about it do you prefer?

@JoschD
Copy link

JoschD commented Aug 12, 2021

Related: On my machine the whole new interactive window and variable explorer is very buggy.

  • I also have to click on the interactive window (especially into the "type code here" box) and even then the variables often don't update.
  • I have to click on the interactive window first, before opening the variables in the data viewer, as soon as I clicked on my code tab in between (without running anything between looking at different variables).
  • I can't seem to get the old style back in my WSL VSCode. The setting you describe above isn't there at all (I guess the Jupyter extension is only installed in the local VSCode?). And setting it in the local VSCode has no effect on the WSL. It's always the view with the variables at the bottom.

@mosierbryon
Copy link

mosierbryon commented Aug 12, 2021

@mosierbryon Thanks for the feedback--it would help us to understand why the old style is better. Are you referring to the old interactive window all up, or the old variable explorer (embedded in the interactive window) specifically? What about it do you prefer?

Hi @joyceerhl, I'm referring to the variable explorer embedded in the interactive window. For me it's the most efficient use of space. The script has the left 2/3 of the screen and the interactive window has the other 1/3.

@alandema
Copy link

Also, opening a big variable in the Data Viewer is super slow. I work a lot with big np arrays (~100000:~10:~100), and I can't use the Variable Explorer from VSCode properly because some don't even open and others takes forever.

@joyceerhl
Copy link
Contributor

@JoschD You will also need to reload VS Code after that setting update. Additionally that setting is a user-level setting, so please ensure that you are adding it to your user settings and not your machine settings. Please let us know if that doesn't work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug interactive-window Impacts interactive window
Projects
None yet
8 participants