pylsp-rope icon indicating copy to clipboard operation
pylsp-rope copied to clipboard

Fix pylsp-rope compatibility with Jupyter Notebooks

Open mcepl opened this issue 2 weeks ago • 0 comments

Implement guard clauses to handle virtual documents (notebook cells) safely:

  • Add is_virtual_document() helper to detect non-file URIs
  • Update get_resource() to return None for virtual documents
  • Add early returns in pylsp_code_actions() and pylsp_rename() hooks
  • Prevent rope operations on virtual documents that don't correspond to files

This fixes the python-lsp-server notebook test failure where pylsp-rope was interfering with notebook cell handling by trying to treat virtual URIs as filesystem paths.

mcepl avatar Dec 30 '25 18:12 mcepl