pylsp-rope
pylsp-rope copied to clipboard
Fix pylsp-rope compatibility with Jupyter Notebooks
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.