-
Notifications
You must be signed in to change notification settings - Fork 145
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 URI #692
Comments
In bsl language server we've created a helper class for handling non-canonical uri: https://github.com/1c-syntax/utils/blob/master/src/main/java/com/github/_1c_syntax/utils/Absolute.java |
Yes, we could do this as well (thanks for the sharing your solution!) but this would require a sweep kind of change, ie. |
@BoykoAlex Are you recommending adding a constructor to |
@jonahgraham I'd add a constructor that takes |
This part seems fine.
This part worries me because of double-escaping. But then looking at your above comment that would still need a sweeping change if we didn't adopt this part.
I don't see any issue with adding a new However having a I guess the real question is why not have TextDocumentIdentifier store a java.net.URI all the time? Is there some things that LSP URIs can store (as a string) that can't be represented properly by java.net.URI? |
I think having |
The common case of setting URI on lsp4j message object is
URI#toString()
call. For example LSP4E sets uri on theTextDocumentIdentifier
viaURI#toString()
call rather thanURI#toASCIIString()
. Therefore if the file name isClassWithSpécialCharacter.java
then onlyURI#toASCIIString()
would produce the valid URI with escaped non-ASCII charé
It'd be great if
TextDocumentIdentifier
(and perhaps other classes) taking string URIs would normalize the input URI to guard against the issue described above.The text was updated successfully, but these errors were encountered: