Outputs from dotnet-repl are not displayed in by VS Code extension
Describe the bug
I execute a notebook using dotnet-repl, but the outputs do not show up in VS Code notebook extension viewer. cc: @jonsequitur
This has come up in the effort to allow polyglot notebooks as input for writing library documentation using FSharp.Formatting.
Specifically, I run dotnet repl --run .\docs\literate-notebook.ipynb --exit-after-run --default-kernel fsharp --output-path .\docs\literate-notebook.ipynb.
When I open the notebook in VS Code the outputs are not displayed, yet if I open the file in text mode I can see the outputs there for the cell. Notebook gist here. Screensot of notebook in vs code below
Please complete the following:
Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):
-
OS
- [x] Windows 11
-
Frontend
- [x] Visual Studio Code
- [x] Visual Studio Code Insiders
Screenshots
If applicable, add screenshots to help explain your problem.
I have the same problem. I'm giving more information to help.
I used dotnet-repl for a C# .dib notebook.
dotnet repl --run test.dib --exit-after-run --output-path output.ipynb
When I load the output.ipynb file, the output cells are cleared.
I made an animation showing the problem with a 22 Kb ipynb file:
- start with no VS Code open
- double click on the ipynb file
- VS Code launches
- the ipynb file is open
- output cells are displayed
- output cells are cleared
- (the following instructions are extra steps to reproduce the bug each time)
- open a new blank document
- close the ipynb file (confirm)
- close the blank document
- close VS Code
This procedure has a few extra steps to reproduce the bug each time: I also create a blank new document before closing the ipynb file, then the blank document, then VS Code. Because if I just close the ipynb file and reopens it, the ipynb file is reopened with the cells already cleared (maybe because of a cache). By following the steps above, the bug can be reproduced each time.
Also, after the cells output have been cleared, the ipynb document is considered as modified. If I save it using Save As, the file is smaller (from 22 Kb to 10 Kb).
Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):
Version: 1.0.456201+e5dc02dbdc933d895d722e69bfa98d580dcda8d9
- OS
- [ ] Windows 11
- [x] Windows 10
- [ ] macOS
- [ ] Linux (Please specify distro)
- [ ] iOS
- [ ] Android
- Browser
- [ ] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari
- Frontend
- [ ] Jupyter Notebook
- [ ] Jupyter Lab
- [ ] nteract
- [x] Visual Studio Code
- [ ] Visual Studio Code Insiders
- [ ] Visual Studio
- [ ] Other (please specify)
This problem isn't specific to dotnet-repl. The same behavior is exhibited with files saved using Jupyter Lab.
This appears to be a regression in VS Code.