Skip to content
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

Normalize drive letter in Windows filepaths to uppercase #1772

Merged
merged 3 commits into from
Jul 1, 2021

Conversation

jwortmann
Copy link
Member

This fixes a bug with wrong labels for quick panel items after "Find References" and "Goto Definition..." if the server returns filepaths with lowercase drive letter, and also for Sublime's VCS status in the status bar when such a file link is opened.

Closes #1770.

@rwols
Copy link
Member

rwols commented Jul 1, 2021

How about removing the _lowercase_driveletter instead? I thought it would solve the duplicate goto-def issue but it looks like servers will have to account for that themselves. Which Intelephense does.

@rchl
Copy link
Member

rchl commented Jul 1, 2021

How about removing the _lowercase_driveletter instead? I thought it would solve the duplicate goto-def issue but it looks like servers will have to account for that themselves. Which Intelephense does.

Possibly it would even be safest to uppercase in both cases since the filename_to_uri might be used with file paths that come from somewhere else than ST (either server or user configuration).

@rwols
Copy link
Member

rwols commented Jul 1, 2021

Can you add some tests for this in tests/test_url.py so we don't regress in the future?

@jwortmann
Copy link
Member Author

Possibly it would even be safest to uppercase in both cases since the filename_to_uri might be used with file paths that come from somewhere else than ST (either server or user configuration).

Seems like the pathname2url already does the uppercasing for us if the filename has a lowercase drive letter. I removed the obsolete function.

Can you add some tests for this in tests/test_url.py so we don't regress in the future?

Yes, I guess these tests need to be adjusted now anyway to pass.

@jwortmann
Copy link
Member Author

I adjusted the outdated test, but I think the tests should already cover the critical cases. Anything more to add there?

@rwols rwols merged commit c441dc1 into sublimelsp:main Jul 1, 2021
@jwortmann jwortmann deleted the drive-letter branch July 1, 2021 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On Windows, the drive letter in server responsed file URIs are lowercase.
3 participants