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

Fix #638: Convert colon to hex in URI #639

Closed
wants to merge 1 commit into from

Conversation

theothornhill
Copy link
Collaborator

@theothornhill theothornhill commented Mar 5, 2021

It looks like we need to convert the directory colon to a hex value, and the current implementation doesn't do that.

On close examination on both lsp-mode and vscode I see that all uris are on the form

file:///c%3A/Users/foo/bar, not file:///c:/Users/foo/bar

This commit addresses that by creating the new defconst and passing it on to hexify.

This was a convoluted bug to fix - suddenly flymake behaves! 😄

@theothornhill
Copy link
Collaborator Author

I see the code touches same areas as #637, but they still seem compatible.

* eglot.el (eglot--uri-path-allowed-chars): define what characters are allowed
in an URI. Specifically, convert ':' to '%3A' on windows.

* eglot.el (eglot--path-to-uri): ensure that the colon in 'file://' stays with a
colon, but hexify others.
@theothornhill
Copy link
Collaborator Author

Added a test to show that file:// stays with a colon, but c: is converted to c%3A

@joaotavora joaotavora closed this Mar 6, 2021
@joaotavora
Copy link
Owner

I pushed this with some minor tweaks.

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.

2 participants