Skip to content

Ruff crashes when marimo notebook and text editor views are open simultaneously #893

@manzt

Description

@manzt

We're preparing to ship the marimo VS Code extension and have identified a compatibility issue with Ruff.

Marimo notebooks use .py files and register as a custom notebook type via VS Code's notebook API. When the same file is open in both notebook view and text editor view, Ruff crashes with errors like:

ERROR An error occurred while running notebookDocument/didChange: Notebook document URI does not point to a notebook document
ERROR An error occurred while running notebookDocument/didChange: Document controller not available at `file:///path/to/notebook.py`

It appears Ruff's document tracking seems to get confused when it receives notifications about the same .py file existing as both vscode-notebook-cell:// URIs and regular file:// URIs. I'm guessing this works fine with Jupyter because it uses .ipynb files, but breaks with marimo where the notebook format is .py.

Reference:

Environment: Ruff extension 2025.28.0, VS Code 1.105.1, ruff.nativeServer: true

Metadata

Metadata

Assignees

No one assigned

    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