简体   繁体   English

使用 Python 扩展时在 VS Code 中查看 Ipython Notebooks 的基于行的差异

[英]Viewing Ipython Notebooks' line based diff in VS Code while using the Python extension

I wonder how others use the diff view for notebooks in VS Code.我想知道其他人如何在 VS Code 中使用笔记本的差异视图。 With the recent updates the diff view change when I use the Python extension (which includes the Jupyter extension ).随着最近的更新,当我使用Python 扩展(包括Jupyter 扩展)时,差异视图发生了变化。

So before I used to see the line base text diffs, which I still see if I turn off the Python extension:所以在我以前看到行基础文本差异之前,如果我关闭 Python 扩展,我仍然会看到:

https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter

When I turn the Python extension on, I see a one-to-one comparison where I do not see much if the notebooks are a bit more complicated (changing some details in a Markdown-Cell):当我打开 Python 扩展时,我看到了一对一的比较,如果笔记本有点复杂(更改 Markdown-Cell 中的一些细节),我看不到太多: 在此处输入图像描述

Questions问题

  • Is there a way to get to the line-based first diff view using some command(s) other than turning the extension off?除了关闭扩展之外,有没有办法使用一些命令进入基于行的第一个差异视图?

I am on Windows and I tried to turn off several settings in the extension(s), without seeing any difference:我在 Windows 上,我尝试关闭扩展中的几个设置,但没有看到任何区别: 在此处输入图像描述

I also remember there being a "do not show automatically in notebook editor" setting, but I cannot see it right now, I have to manuelly start the notebook viewer in the File-Tab (first) as I want though.我还记得有一个“不在笔记本编辑器中自动显示”设置,但我现在看不到它,我必须按照我的意愿在文件选项卡(首先)中手动启动笔记本查看器。 so it is "off".所以它是“关闭”的。

Any ideas what I am missing or do you think this is a bug?任何想法我错过了什么或者你认为这是一个错误?

You could try the method in this link to test this process in " Visual Studio Code Insiders ": Git diff for ipynb files is being replaced by the notebook editor您可以尝试此链接中的方法在“ Visual Studio Code Insiders ”中测试此过程: Git ipynb 文件的差异正在被笔记本编辑器替换

Following Jill Cheng's comment, I know see the "rich" diff on default (and can turn it off using the settings snippet referenced:根据 Jill Cheng 的评论,我知道默认情况下会看到“丰富”的差异(并且可以使用引用的设置片段将其关闭:

在此处输入图像描述

Uncommenting these settings will give me the line-based diff, if I need to stage only parts of the notebook.如果我只需要暂存笔记本的一部分,取消注释这些设置将为我提供基于行的差异。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM