Skip to content

Jupyter Notebooks (ipynb) should use the JSON formatter by default #140062

@SethFalco

Description

@SethFalco

Environment data

  • VS Code version: 1.65.0-insider
  • Jupyter Extension version (available under the Extensions sidebar): v2022.1.1001614873
  • Python Extension version (available under the Extensions sidebar): v2021.12.1559732655
  • OS (Windows | Mac | Linux distro) and version: Debian 11.1
  • Python and/or Anaconda version: 3.9.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): NA
  • Jupyter server running: N/A

Expected behaviour

By default, I would expect to be able to open a Jupyter Notebook file in the "Text Editor", then do the Format Document command to beautify the JSON file.

I have also tried setting the following setting, but it doesn't want to format unless I specifically set the language to JSON in the editor.

  "[jupyter]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },

Actual behaviour

Visual Studio Code - Insiders

There is no formatter for 'jupyter' files installed.
Install Formatters… | Cancel

Steps to reproduce:

  1. Open a ipynb file in Visual Studio Code in the Text Editor. (Right-ClickOpen With…Text Editor)
  2. Try to format it. (CTRL + SHIFT + PFormat Document)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions