-
Notifications
You must be signed in to change notification settings - Fork 91
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
Notebook variables pane sync #5583
Conversation
846302b
to
faeb9b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM and confirmed the expected behavior locally. A few thoughts below:
Should variables also select the correct runtime on Positron startup? For example, I had a notebook opened from a previous session, and when I started Positron it wasn't selected. We might just need to check the active editor etc when we also register the event listeners.
Also, should variables switch to the notebook runtime when a notebook cell is executed?
src/vs/workbench/services/positronVariables/common/positronVariablesService.ts
Show resolved
Hide resolved
src/vs/workbench/services/positronVariables/common/positronVariablesService.ts
Outdated
Show resolved
Hide resolved
faeb9b3
to
fb8d591
Compare
…e flag into its own contributions script
…ing to non-jupyter notebook editors
fb8d591
to
dc597d7
Compare
…ing last console instance in favor of the foreground instance property on the session service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for laying the groundwork for unit testing the variables service!
Addresses #2452
This PR adds the ability for the variables pane to "follow" the user around as they work across different sessions (particularly useful for notebooks that have their own sessions.)
It works by automatically switching the variables pane in the following circumstances
variables-follow-mode.mov
All of this behavior can be turned off by setting the
positron.variables.followMode
setting to false. (src/vs/workbench/services/positronVariables/common/positronVariables.contribution.ts
)Annoyances
.R
or.py
script with a session. In this case we go back to the most recent console session, but that could be confusing if you clicked onto an R session and your most recent console was a python session. I left this behavior as is because it's what currently happens and it feels like the upcoming multi-session work will formalize behavior around this.Code Refactoring:
setActivePositronVariablesInstance
to_setActivePositronVariablesInstance
for consistency with other private methods. (src/vs/workbench/services/positronVariables/common/positronVariablesService.ts
)QA notes:
Should be able to fiddle between different notebooks and consoles and the variables pane should go to where you expect it to.