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

Git diff for ipynb files is being replaced by the notebook editor #633

Closed
wpbrown opened this issue Aug 22, 2020 · 32 comments
Closed

Git diff for ipynb files is being replaced by the notebook editor #633

wpbrown opened this issue Aug 22, 2020 · 32 comments
Labels
bug Issue identified by VS Code Team member as probable bug upstream-vscode Blocked on upstream VS code verified Verification succeeded
Milestone

Comments

@wpbrown
Copy link

wpbrown commented Aug 22, 2020

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. Click python notebook file with changes in the Git pane.

Actual behavior

Diff window shows briefly and then notebook editor replaces the tab.

Expected behavior

Diff editor should remain open. Notebook editor should not start in a git diff view.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Remote
  • Extension version: 2020.8.103604
  • VS Code version: 1.48.0
  • OS: Linux

Python Output

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

@bkowshik
Copy link

Diff window shows briefly and then notebook editor replaces the tab.

Same behavior to me too.

@dan1994
Copy link

dan1994 commented Aug 22, 2020

I also experience this. In general would love for the option to open the notebook outside the editor (like the edit settings in json button).

@DavidKutu
Copy link

Thank you for reporting the issue @wpbrown. This should be solved when we release the new native notebooks, you can try those here: https://devblogs.microsoft.com/python/notebooks-are-getting-revamped.

In the mean time, another solution is to turn off the setting 'python.dataScience.useNotebookEditor', that makes it so that the notebook editor does not open automatically when selecting a .ipynb file. Instead it'll open the json, and in the case of the diff window it will also display like normal.

If you disable the setting, you can still open your .ipynb's with the notebook editor by right clicking and selecting 'Open in Notebook Editor'.

Let me know if this helps.

@Victor-Savu
Copy link
Contributor

It is strange, because this used to work up until 3 weeks ago or so.

@joyceerhl joyceerhl self-assigned this Sep 9, 2020
@IanMatthewHuff IanMatthewHuff self-assigned this Sep 17, 2020
@IanMatthewHuff
Copy link
Member

Looks good now to me. Validated.

image.png

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 11, 2020
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug reason-regression labels Nov 11, 2020
@jamesmyatt
Copy link

Which version of the extension was this working in?

@jamesmyatt
Copy link

This was working in v2021.2.603412351, but broken again in v2021.3.619093157

@DavidKutu DavidKutu reopened this Mar 9, 2021
@IanMatthewHuff
Copy link
Member

Note we also used to have the jupyter.useNotebookEditor option, which would always open notebook files as json.

Pulling this back to triage. I believe that it was regressed by us full rolling out the CustomEditor. Fixing might depend on how fast we feel the new native UI is rolling out, as that would resolve this issue.

@greazer
Copy link
Member

greazer commented Mar 11, 2021

We believe this is a problem that should be solved on the VS Code side, because a custom editor should not be used for git diff.

@greazer greazer removed the upstream-vscode Blocked on upstream VS code label Mar 11, 2021
@joyceerhl
Copy link
Contributor

Filed upstream microsoft/vscode#118764

@joyceerhl
Copy link
Contributor

According to microsoft/vscode#118764 (comment), for custom editors if we want the raw json to show up in the diff view we would need to implement a raw text custom editor provider and reroute git diff file opens to that provider. Like Ian said earlier, whether we fix this depends on the rollout timeline for the new preview native notebooks.

@greazer greazer modified the milestones: May 2021 Release, June 2021 Release May 6, 2021
@oparaskos
Copy link

Is there a work-around for this;
So far I've tried all the workarounds i can find on the net:

  • adding "jupyter.useNotebookEditor": false, to settings; it greys out and doesnt recognise the setting
  • adding "jupyter.experiments.optOutFrom": [ "NativeNotebookEditor", ], doesnt help
  • adding "files.associations": { "*.ipynb": "text" }, no help
  • adding "notebook.diff.enablePreview": false, no help
  • disabling the plugin (apparently it is required by the python plugin, thus needs me to disable python too which is depended upon by other plugins i use)
  • can't set language mode as no text editor is active

@scrambldchannel
Copy link

I hacked around it by pinning to an earlier version.

I think I followed this from @jamesmyatt

This was working in v2021.2.603412351, but broken again in v2021.3.619093157

This might be a workaround if you don't need anything bleeding edge

@Ortega-Dan
Copy link

Is there a work-around for this;
So far I've tried all the workarounds i can find on the net:

  • adding "jupyter.useNotebookEditor": false, to settings; it greys out and doesnt recognise the setting
  • adding "jupyter.experiments.optOutFrom": [ "NativeNotebookEditor", ], doesnt help
  • adding "files.associations": { "*.ipynb": "text" }, no help
  • adding "notebook.diff.enablePreview": false, no help
  • disabling the plugin (apparently it is required by the python plugin, thus needs me to disable python too which is depended upon by other plugins i use)
  • can't set language mode as no text editor is active

You are right,
there seems to be no solution to this

@Ortega-Dan
Copy link

Ortega-Dan commented May 13, 2021

When pasting this in the settings.json (as in the last response from @chenfeibo) it just grays out and doesn't work.
image

image

Is this an issue ?, or the setting must go inside a different object than the root of the settins json object ?

@chenfeibo
Copy link

When pasting this in the settings.json (as in the last response from @chenfeibo) it just grays out and doesn't work.
image

image

Is this an issue ?, or the setting must go inside a different object than the root of the settins json object ?

Just re-checked mine, these lines are greyed as well. It could be some latest updates invalidated them. Then I don't know what operation helped, maybe the installation of a inside build.

@benlindsay
Copy link

I hacked around it by pinning to an earlier version.
I think I followed this from @jamesmyatt

This was working in v2021.2.603412351, but broken again in v2021.3.619093157

This might be a workaround if you don't need anything bleeding edge

Confirmed @jamesmyatt and @scrambldchannel's posts. I resorted to pinning Jupyter back to that version as well.

@Ortega-Dan
Copy link

Thanks. Then it seems like a confirmed issue on the current extension version.

@Ortega-Dan
Copy link

And in that case documenting here the temporal workaround can be very helpful.
I don't see any v2021.2.603412351 in the releases.
Am I looking at the right place ?
Or
Do you guys know if the following is the working version ?
image

@benlindsay
Copy link

@Ortega-Dan I don't know how the releases on github translate to the versions available in the VSCode app itself, but if you go to your extensions panel in VSCode, go to your Jupyter extension, click the gear, click "Install another version", should see "2021.2.603412351" as one of the options you can roll back to.

image

image

@DnL888
Copy link

DnL888 commented Jun 11, 2021

@Ortega-Dan Version 2021.2.603412351 doesn't seem to be working for me, I get the following error:

image

image

The most recent version 2021.6.999230701 loads two kernels side to side in the diff view but doesn't highlight the differences.

@Ortega-Dan
Copy link

Thank you so much for the great help. !!

It looks like it is working now on the latest version with stable vscode.

Here:
working

@scrambldchannel
Copy link

Cool, working for me too - thanks for sorting this out team 👍

@benlindsay
Copy link

Just to make sure I haven't messed up my settings too much, this is still just available on Insiders, not VSCode proper, right? That's how it's looking on my machine at least

@joyceerhl
Copy link
Contributor

joyceerhl commented Jul 7, 2021

@benlindsay It's available to everyone in Insiders and a fraction of users in Stable. If you're in VS Code stable you can also opt into the new native notebooks UI: https://github.com/microsoft/vscode-jupyter/wiki/Native-Notebook-Support-in-VS-Code#enabling-the-new-experience

@benlindsay
Copy link

@joyceerhl Neat, thanks for the info! I did that and got the new stuff in VSCode stable now. Git diffing looks great! The kernel stuff was acting really weird but that's a battle for another day :)

@oparaskos
Copy link

@joyceerhl Thank you so much; that new git diffing workflow is so much better 👏💯

@greazer greazer added important Issue identified as high-priority and removed important Issue identified as high-priority labels Jul 30, 2021
@greazer
Copy link
Member

greazer commented Aug 8, 2021

Thanks for your feedback. This issue is addressed with new native support for editing notebooks starting with v1.59 of VS Code. If this issue continues to occur in the latest build of VS Code, please reopen or enter a new issue.

@greazer greazer closed this as completed Aug 8, 2021
@greazer greazer added the verified Verification succeeded label Aug 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2021
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 upstream-vscode Blocked on upstream VS code verified Verification succeeded
Projects
None yet
Development

No branches or pull requests