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

Add escaping when comparing/hashing URI2 #702

Merged
merged 2 commits into from
May 18, 2020
Merged

Add escaping when comparing/hashing URI2 #702

merged 2 commits into from
May 18, 2020

Conversation

pxl-th
Copy link
Contributor

@pxl-th pxl-th commented May 17, 2020

  • Add function for escaping URI
  • Add tests for escaping/comparing/hashing URI

This is a continuation of discussion in #699 PR, that allows comparing URIs that were created using different encoding schemes.
Basically what it does is it escapes URI to bring it to the same encoding scheme as in vscode-uri.
This allows for following comparisons:

hash(LanguageServer.URI2("file:///D:/FOO/bar")) == hash(LanguageServer.URI2("file:///d%3A/FOO/bar"))

It escapes only file URI, since I'm not sure if escaping is needed in other cases.

Note: It still needs to be checked if "VS Code internally also treats two strings that stand for the same URI but use different encoding patterns as equal or not", so this may be considered as WIP.

- Add function for escaping URI
- Add tests for escaping/comparing/hashing URI
@davidanthoff davidanthoff added this to the Current milestone May 18, 2020
@davidanthoff davidanthoff merged commit 9600a50 into julia-vscode:master May 18, 2020
@davidanthoff
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants