-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update url.py to fit WSL path that starts with "\\wsl.local" #2577
Conversation
@@ -56,7 +56,8 @@ def parse_uri(uri: str) -> tuple[str, str]: | |||
path = url2pathname(parsed.path) | |||
if os.name == 'nt': | |||
netloc = url2pathname(parsed.netloc) | |||
path = path.lstrip("\\") | |||
if path[0] == '\\': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if path[0] == '\\': | |
if path.startswith('\\'): |
Could you add a test in the I see there is already a test for a WSL URL at Lines 39 to 42 in c64ac00
but you could add another one after that which would be handled by the change in this pull request. |
Can you teach me how to use tests? |
Basically look at the code that I linked above. You can just copy the 3 lines and change the URL to parse (with something that currently doesn't work) and also the expected outcome. |
I don't know how to run this test. |
The CI check on GitHub will run it after you pushed another commit. |
Can't I run it locally? It's a bit annoying to have to push to GitHub every time I test the code. |
To manually run tests locally you need to install the UnitTesting package from package control. See https://github.com/sublimelsp/LSP/blob/main/CONTRIBUTING.md#testing I haven't done this though, but usually you know what the expected outcome should be, so it should be fine to just push new commits until it works. The commits will be squashed into a single one when the PR gets merged anyway. |
Okay |
To provide support for WSL paths, I think it would be better to update the underlying packages related to path handling rather than changing the program logic; the issue seems to have become somewhat complex. I think the best solution would be to create a branch that supports WSL paths. So this PR will be closed. |
No description provided.