Skip to content

Formatting imports in notebook in VSCode injects random code into cell #680

@JohnAtl

Description

@JohnAtl

When I save the notebook after making changes to my imports, random bits of code from the file are interspersed and repeated in the cell containing the imports.

Version
2025.4.0
Last Updated
2025-01-24, 08:43:26

In this video, I click File|Save, and the reformatting happens. I closed and reopened the file, and it still happened. I closed and reopened VSCode, and it still happened, though the amount of code injected was less.

I haven't seen this occur in .py files, only .ipynb files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-actionsRelated to code actionsnotebookRelated to (Jupyter) notebooks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions