jupyterlab-lsp: Incompatibility with JupyterLab core npm packages 3.0.10

Description

We use a custom version of JupyterLab which depends on the following dependencies that I upgraded: Screen Shot 2021-05-10 at 6 07 52 PM

Doing that broke the LSP extension in that the check if not uri.startswith(virtual_documents_uri) in “virtual_documents_shadow.py” at line 141 now fails. This is due to an additional “/” that gets inserted in the file URI as per this example:

uri file://c:/XXX/.virtual_documents/1%20Migration%20Guide.ipynb doesn't start with file:///c:/XXX/.virtual_documents

Reproduce

Bump up to the latest version of JupyterLab.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Maybe just strip the prefix before preforming the starts with check, whether it is file:// or file:///? Regular expression would be an alternative, but maybe better to avoid it.

I think the troublesome fix went into 1.5.0. It might be difficult to revert to an earlier version since it got a) a security fix label b) already merged and released by JupyterLab core. I was thinking about an upstream fix, or making our server side comparison be more lenient (as a special case for the lack/presence of triple /).

I think maybe the latter (making the server side comparison more lax), would be a good idea too in case something like this happens again — according to the issue you identified I get the impression that this kind of url parsing will remain problematic. I’m happy to create a PR to that effect if you want to tell me how you think the comparison should be performed.

I think the troublesome fix went into 1.5.0. It might be difficult to revert to an earlier version since it got a) a security fix label b) already merged and released by JupyterLab core. I was thinking about an upstream fix, or making our server side comparison be more lenient (as a special case for the lack/presence of triple /).