Skip to content

Break in compatibility with jupyterlab-lsp + python-lsp-ruff since 0.0.285 #6847

Closed
@felix-cw

Description

@felix-cw

I'm not 100% sure this is the right project to raise this, since the problem comes from interaction with python-lsp-ruff and juptyerlab-lsp. I only raised it here since the issue arose from a change in ruff.

Since 0.0.285, the jupyterlab-lsp plugin now gives the following diagnostic message:

SyntaxError: Expected a Jupyter Notebook (.ipynb), which must be internally stored as JSON, but found a Python source file: expected value at line 1 column 1

I believe this is because jupyterlab-lsp extracts the python code from the notebook cells, then python-lsp-ruff passes it to ruff via stdin, and specifies --stdin-filename. Since #6628, this makes ruff expect ipynb JSON, rather than python code, which causes the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the command-line interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions