Repository navigation
Add an explicit note about drive letter colons - #1786
Conversation
|
|
||
| Many of the interfaces contain fields that correspond to the URI of a document. For clarity, the type of such a field is declared as a `DocumentUri`. Over the wire, it will still be transferred as a string, but this guarantees that the contents of that string can be parsed as a valid URI. | ||
|
|
||
| Care should be taken to handle encoded in URIs. Some clients (such as VS Code) may encode colons in drive letters while others do not. The following URIs should be considered equivalent and are both valid for clients and servers to use: |
There was a problem hiding this comment.
I would actually phrase this more general saying that servers should handle all valid encoded URIs. For example clients might use either file:///c:/project/readme.md or file:///c%3A/project/readme.md to denote a file with a drive letter under Windows. However clients should be consistent in how they encode characters in URIs.
There was a problem hiding this comment.
However clients should be consistent in how they encode characters in URIs.
I don't like the word should 😁
I've pushed some tweaks - how's this? (I explicitly noted that one party should not assume the other party will use the same encoding, because I think it has to be that way - perhaps I should have noted the same about drive letter casing?)
There was a problem hiding this comment.
What could also be problematic and where care should be taken is when clients send symlinked file URIs. Or dealing with case-insensitive filenames. I would argue a server cannot rely on the string-representation of file URIs.
There was a problem hiding this comment.
Yep, there are definitely more edge cases than this, but this one is simple (it's just encoding/decoding) and already caused me a problem. It's much less clear to me what the spec should say about symlinks or casing so I think they could be handled in their own PRs (assuming some rules can be agreed!).
|
Dirk Bäumer (@dbaeumer) I pushed some tweaks based on your comments above. Would you like anything else changed? |
See microsoft/vscode-languageserver-node#1280