Skip to content

Commit

Permalink
Add an explicit note about drive letter colons (#1786)
Browse files Browse the repository at this point in the history
* Add an explicit note about drive letter colons

See microsoft/vscode-languageserver-node#1280

* Tweak text

* Add a note about drive letter casing

---------

Co-authored-by: Dirk Bäumer <dirkb@microsoft.com>
  • Loading branch information
DanTup and dbaeumer authored Oct 19, 2023
1 parent dbbb07d commit d5d8e04
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _includes/types/uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ We also maintain a node module to parse a string into `scheme`, `authority`, `pa

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 encoding in URIs. For example, some clients (such as VS Code) may encode colons in drive letters while others do not. The URIs below are both valid, but clients and servers should be consistent with the form they use themselves to ensure the other party doesn't interpret them as distinct URIs. Clients and servers should not assume that each other are encoding the same way (for example a client encoding colons in drive letters cannot assume server responses will have encoded colons). The same applies to casing of drive letters - one party should not assume the other party will return paths with drive letters cased the same as it.

```
file:///c:/project/readme.md
file:///C%3A/project/readme.md
```

<div class="anchorHolder"><a href="#documentUri" name="documentUri" class="linkableAnchor"></a></div>

```typescript
Expand Down

0 comments on commit d5d8e04

Please sign in to comment.