How can I easily edit a Jupyter notebook's JSON code in VS Code?

Viewed 711

I have a Jupyter notebook and I would like to directly edit its JSON code in VS Code. However, when I open the notebook, VS Code goes in "Jupyter" mode instead of showing me the actual JSON code.

My current workaround is to rename the file to .json, edit it, save it, then rename it back to .ipynb. That's not very convenient. Is there a better way?

2 Answers

Left panel -> Find your file -> Right Click -> Open With... -> Select "Text Editor"

You can then enable syntax highlighting by going in the bottom right, and selecting the right type for the file contents (in your particular case, it's JSON.)

Related