Interactive Window improvements and issues
See original GitHub issueHi! I tried to integrate notebooks-related functionality in my daily workflow. Not everything was smooth and I returned to JupyterLab in the end. However, the transition was very close to becoming successful, I really liked some features! I would like to share some feedback.
High level impressions
I realized that “cells” within .py-files is the best form of a “Notebook” to me. Reasons:
- I get 100% of VSCode functionality (especially the editor)
- I have one and only one interface for code editing, regardless of what I am doing (writing C++ or drawing plots with Python in “Notebook”)
- I can run ad hoc snippets in the interactive window without touching the original script
- I can seamlessly switch between running the script with the “python” command in the terminal and running it in the Interactive Mode without conversions from .py to .ipynb and vice versa
- I get clear diffs when VCS is involved
- everything else where .py is better at than .ipynb
In fact, all listed reasons can be compressed to one: “I strongly prefer .py files to .ipynb”.
Cells within .py
I mean the “# %%” thing that I praised above 😄 I had the following problems with it:
- Performance decreases over time. I use VSCode to work on remote machine (not sure if it matters). After every (or so) kernel reloading the lag between my “shift+enter” and the VSCode’s reaction (in the form of running the cell/selected code in the interactive window) becomes larger and larger up to 10 seconds (I needed to reload absolutely everything, VSCode included, in order to fix this). In other words, something was leaking, but I didn’t understand, what exactly. Probably, the problem is there for Notebook Editor as well, but I spent less time with it, so I’m not sure.
- No cells folding. I missed this feature from JupyterLab.
- No shortcuts for operations within cells such as “go to the first line of cell”, “select all the code within the cell” and so on.
- No cell-level navigation. In JupyterLab, I can navigate between cells by exiting the editor mode (by pressing Esc) and using arrows. The functionality is not somewhat crucial, but some shortcut for traveling between cells would be nice to have.
- No notebook-shortcuts (except for the “Shift+Enter”). Things like “Create a cell below” would make my life a bit easier.
In fact, only the first reason is a major blocker for me.
Notebook editor
For now, I prefer JupyterLab for working with .ipynb, however, I spent some time with Notebook Editor and here are some things I would like to mention:
- No “Go To Definition”
- No multiple cursors across cells (I mean the “Cmd+D” thing).
- No rulers
- Color theme doesn’t work properly (the dark theme I use (“1337”) is automatically replaced with the native dark theme).
- No brackets highlighting
- No cells folding
1, 2, 3 and 5 seem to be caused by the same fact that the editor is different from the native VSCode editor.
Common for both
- I still don’t understand how I can shutdown running kernels.
- No shortcut for reloading the kernel (had to do that with the mouse 😄 ).
Software:
Visual Studio Code: 1.45.0
Python (VSCode extension): 2020.5.78807
python==3.7.7
jupyterlab==2.1.2
Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:10 (6 by maintainers)
Top GitHub Comments
Thanks for all the great feedback! The biggest takeaway I’m getting from this is that the interactive experience could literally be a replacement for notebook development, IF it supported/emulated some of the same experiences that are possible in a notebook. In addition, @earthastronaut, your closing thought is really interesting new idea about enabling a mix of standard python script with embedded “cells”. I’m generalizing your suggestion beyond just doing it for the if…main… block, say for example if you could define a function and within that function have a concept of cells. This sounds like it could become a complicated problem, but I believe it’s worth thinking about.
I’m going to turn this issue into one that is specifically designed to exist as an “idea-factory” for things we could do to make the current script cell experience more powerful and useful. From this issue, ideas that have merit for further investigation should be pulled out into separate issues.
The notebook-specific feedback here is covered by what @rchiodo said above – those limitations will be addressed when we finally can move to the VS Code native notebook API.
Thanks for the detailed answer! I will remember the trick with searching desired command in the palette 😃
Here are the examples of commands that are missing and that I use in JupyterLab: