From 066048f34e5d1d13591612d27ed7e63c486efc38 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Tue, 8 Aug 2023 10:38:31 +0100 Subject: [PATCH 1/3] Add an explicit note about drive letter colons See https://github.com/microsoft/vscode-languageserver-node/issues/1280 --- _includes/types/uri.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_includes/types/uri.md b/_includes/types/uri.md index 1ffd89829..86b5b067a 100644 --- a/_includes/types/uri.md +++ b/_includes/types/uri.md @@ -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 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: + +``` +file:///c:/project/readme.md +file:///c%3A/project/readme.md +``` +
```typescript From 2b9538771abdadf0de82724776211a42fe698159 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Tue, 8 Aug 2023 15:07:45 +0100 Subject: [PATCH 2/3] Tweak text --- _includes/types/uri.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/types/uri.md b/_includes/types/uri.md index 86b5b067a..ca2573356 100644 --- a/_includes/types/uri.md +++ b/_includes/types/uri.md @@ -16,7 +16,7 @@ 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 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: +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). ``` file:///c:/project/readme.md From 0bd305f1cffb3d67f476b85ea52faefd719e1e15 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Wed, 18 Oct 2023 10:03:57 +0100 Subject: [PATCH 3/3] Add a note about drive letter casing --- _includes/types/uri.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/types/uri.md b/_includes/types/uri.md index ca2573356..eba3d53e8 100644 --- a/_includes/types/uri.md +++ b/_includes/types/uri.md @@ -16,11 +16,11 @@ 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). +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 +file:///C%3A/project/readme.md ```