We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
On Windows, the drive letter in server responsed file URIs are lowercase.
**Describe the bug**

I tried both intelephense and pyright, they both returned lowercased drive letter thus I suspect it's a standard. (or maybe VSCode's LSP lib does it)

https://user-images.githubusercontent.com/6594915/123961095-96286c80-d9e2-11eb-8ada-0da9af754a55.mp4

In "Goto Definition...", this causes ST to open a file whose drive letter is in lowercase. And that may cause various mysterious problem sometimes... Or maybe, this should be fixed in ST core.

**To Reproduce**
Steps to reproduce the behavior:
1. Install LSP-intelephense with a Windows build ST
2. Open a PHP project
3. Make sure the definition file is not opened in a tab already
4. Do "Goto Definition"
5. The newly opened tab should have a lower drive letter

**Expected behavior**

The drive letter should be uppercase.

**Environment (please complete the following information):**
- OS: Win10 21H1 x64
- Sublime Text version: 4109
- LSP version: 4070-1.6.1
- Language servers used: intelephense, pyright

**Additional context**

This is a Windows-only issue as it's case-insensitive.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `plugin/core/url.py`
Content:
```
1 from .typing import Any, Tuple
2 from urllib.parse import quote
3 from urllib.parse import urljoin
4 from urllib.parse import urlparse
5 from urllib.request import pathname2url
6 from urllib.request import url2pathname
7 import os
8 import re
9 
10 import sublime
11 
12 
13 def filename_to_uri(file_name: str) -> str:
14     """
15     Convert a file name obtained from view.file_name() into an URI
16     """
17     prefix = sublime.installed_packages_path()
18     if file_name.startswith(prefix):
19         return _to_resource_uri(file_name, prefix)
20     prefix = sublime.packages_path()
21     if file_name.startswith(prefix) and not os.path.exists(file_name):
22         return _to_resource_uri(file_name, prefix)
23     path = pathname2url(file_name)
24     re.sub(r"^([A-Z]):/", _lowercase_driveletter, path)
25     return urljoin("file:", path)
26 
27 
28 def view_to_uri(view: sublime.View) -> str:
29     file_name = view.file_name()
30     if not file_name:
31         return "buffer://sublime/{}".format(view.buffer_id())
32     return filename_to_uri(file_name)
33 
34 
35 def uri_to_filename(uri: str) -> str:
36     """
37     DEPRECATED: An URI associated to a view does not necessarily have a "file:" scheme.
38     Use urllib.parse.urlparse to determine the scheme and go from there.
39     Use urllib.parse.unquote to unquote the path.
40     """
41     parsed = urlparse(uri)
42     assert parsed.scheme == "file"
43     if os.name == 'nt':
44         # url2pathname does not understand %3A (VS Code's encoding forced on all servers :/)
45         return url2pathname(parsed.path).strip('\\')
46     else:
47         return url2pathname(parsed.path)
48 
49 
50 def parse_uri(uri: str) -> Tuple[str, str]:
51     """
52     Parses an URI into a tuple where the first element is the URI scheme. The
53     second element is the local filesystem path if the URI is a file URI,
54     otherwise the second element is the original URI.
55     """
56     parsed = urlparse(uri)
57     if parsed.scheme == "file":
58         if os.name == 'nt':
59             # TODO: this is wrong for UNC paths
60             return parsed.scheme, url2pathname(parsed.path).strip('\\')
61         return parsed.scheme, url2pathname(parsed.path)
62     return parsed.scheme, uri
63 
64 
65 def _to_resource_uri(path: str, prefix: str) -> str:
66     """
67     Terrible hacks from ST core leak into packages as well.
68 
69     See: https://github.com/sublimehq/sublime_text/issues/3742
70     """
71     return "res://Packages{}".format(quote(path[len(prefix):]))
72 
73 
74 def _lowercase_driveletter(match: Any) -> str:
75     """
76     For compatibility with certain other language clients.
77     """
78     return "{}:/".format(match.group(1).lower())
79
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/plugin/core/url.py b/plugin/core/url.py
--- a/plugin/core/url.py
+++ b/plugin/core/url.py
@@ -21,7 +21,6 @@
     if file_name.startswith(prefix) and not os.path.exists(file_name):
         return _to_resource_uri(file_name, prefix)
     path = pathname2url(file_name)
-    re.sub(r"^([A-Z]):/", _lowercase_driveletter, path)
     return urljoin("file:", path)
 
 
@@ -42,7 +41,8 @@
     assert parsed.scheme == "file"
     if os.name == 'nt':
         # url2pathname does not understand %3A (VS Code's encoding forced on all servers :/)
-        return url2pathname(parsed.path).strip('\\')
+        path = url2pathname(parsed.path).strip('\\')
+        return re.sub(r"^([a-z]):", _uppercase_driveletter, path)
     else:
         return url2pathname(parsed.path)
 
@@ -71,8 +71,8 @@
     return "res://Packages{}".format(quote(path[len(prefix):]))
 
 
-def _lowercase_driveletter(match: Any) -> str:
+def _uppercase_driveletter(match: Any) -> str:
     """
-    For compatibility with certain other language clients.
+    For compatibility with Sublime's VCS status in the status bar.
     """
-    return "{}:/".format(match.group(1).lower())
+    return "{}:".format(match.group(1).upper())

{"golden_diff": "diff --git a/plugin/core/url.py b/plugin/core/url.py\n--- a/plugin/core/url.py\n+++ b/plugin/core/url.py\n@@ -21,7 +21,6 @@\n     if file_name.startswith(prefix) and not os.path.exists(file_name):\n         return _to_resource_uri(file_name, prefix)\n     path = pathname2url(file_name)\n-    re.sub(r\"^([A-Z]):/\", _lowercase_driveletter, path)\n     return urljoin(\"file:\", path)\n \n \n@@ -42,7 +41,8 @@\n     assert parsed.scheme == \"file\"\n     if os.name == 'nt':\n         # url2pathname does not understand %3A (VS Code's encoding forced on all servers :/)\n-        return url2pathname(parsed.path).strip('\\\\')\n+        path = url2pathname(parsed.path).strip('\\\\')\n+        return re.sub(r\"^([a-z]):\", _uppercase_driveletter, path)\n     else:\n         return url2pathname(parsed.path)\n \n@@ -71,8 +71,8 @@\n     return \"res://Packages{}\".format(quote(path[len(prefix):]))\n \n \n-def _lowercase_driveletter(match: Any) -> str:\n+def _uppercase_driveletter(match: Any) -> str:\n     \"\"\"\n-    For compatibility with certain other language clients.\n+    For compatibility with Sublime's VCS status in the status bar.\n     \"\"\"\n-    return \"{}:/\".format(match.group(1).lower())\n+    return \"{}:\".format(match.group(1).upper())\n", "issue": "On Windows, the drive letter in server responsed file URIs are lowercase.\n**Describe the bug**\r\n\r\nI tried both intelephense and pyright, they both returned lowercased drive letter thus I suspect it's a standard. (or maybe VSCode's LSP lib does it)\r\n\r\nhttps://user-images.githubusercontent.com/6594915/123961095-96286c80-d9e2-11eb-8ada-0da9af754a55.mp4\r\n\r\nIn \"Goto Definition...\", this causes ST to open a file whose drive letter is in lowercase. And that may cause various mysterious problem sometimes... Or maybe, this should be fixed in ST core.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Install LSP-intelephense with a Windows build ST\r\n2. Open a PHP project\r\n3. Make sure the definition file is not opened in a tab already\r\n4. Do \"Goto Definition\"\r\n5. The newly opened tab should have a lower drive letter\r\n\r\n**Expected behavior**\r\n\r\nThe drive letter should be uppercase.\r\n\r\n**Environment (please complete the following information):**\r\n- OS: Win10 21H1 x64\r\n- Sublime Text version: 4109\r\n- LSP version: 4070-1.6.1\r\n- Language servers used: intelephense, pyright\r\n\r\n**Additional context**\r\n\r\nThis is a Windows-only issue as it's case-insensitive.\r\n\n", "before_files": [{"content": "from .typing import Any, Tuple\nfrom urllib.parse import quote\nfrom urllib.parse import urljoin\nfrom urllib.parse import urlparse\nfrom urllib.request import pathname2url\nfrom urllib.request import url2pathname\nimport os\nimport re\n\nimport sublime\n\n\ndef filename_to_uri(file_name: str) -> str:\n    \"\"\"\n    Convert a file name obtained from view.file_name() into an URI\n    \"\"\"\n    prefix = sublime.installed_packages_path()\n    if file_name.startswith(prefix):\n        return _to_resource_uri(file_name, prefix)\n    prefix = sublime.packages_path()\n    if file_name.startswith(prefix) and not os.path.exists(file_name):\n        return _to_resource_uri(file_name, prefix)\n    path = pathname2url(file_name)\n    re.sub(r\"^([A-Z]):/\", _lowercase_driveletter, path)\n    return urljoin(\"file:\", path)\n\n\ndef view_to_uri(view: sublime.View) -> str:\n    file_name = view.file_name()\n    if not file_name:\n        return \"buffer://sublime/{}\".format(view.buffer_id())\n    return filename_to_uri(file_name)\n\n\ndef uri_to_filename(uri: str) -> str:\n    \"\"\"\n    DEPRECATED: An URI associated to a view does not necessarily have a \"file:\" scheme.\n    Use urllib.parse.urlparse to determine the scheme and go from there.\n    Use urllib.parse.unquote to unquote the path.\n    \"\"\"\n    parsed = urlparse(uri)\n    assert parsed.scheme == \"file\"\n    if os.name == 'nt':\n        # url2pathname does not understand %3A (VS Code's encoding forced on all servers :/)\n        return url2pathname(parsed.path).strip('\\\\')\n    else:\n        return url2pathname(parsed.path)\n\n\ndef parse_uri(uri: str) -> Tuple[str, str]:\n    \"\"\"\n    Parses an URI into a tuple where the first element is the URI scheme. The\n    second element is the local filesystem path if the URI is a file URI,\n    otherwise the second element is the original URI.\n    \"\"\"\n    parsed = urlparse(uri)\n    if parsed.scheme == \"file\":\n        if os.name == 'nt':\n            # TODO: this is wrong for UNC paths\n            return parsed.scheme, url2pathname(parsed.path).strip('\\\\')\n        return parsed.scheme, url2pathname(parsed.path)\n    return parsed.scheme, uri\n\n\ndef _to_resource_uri(path: str, prefix: str) -> str:\n    \"\"\"\n    Terrible hacks from ST core leak into packages as well.\n\n    See: https://github.com/sublimehq/sublime_text/issues/3742\n    \"\"\"\n    return \"res://Packages{}\".format(quote(path[len(prefix):]))\n\n\ndef _lowercase_driveletter(match: Any) -> str:\n    \"\"\"\n    For compatibility with certain other language clients.\n    \"\"\"\n    return \"{}:/\".format(match.group(1).lower())\n", "path": "plugin/core/url.py"}], "after_files": [{"content": "from .typing import Any, Tuple\nfrom urllib.parse import quote\nfrom urllib.parse import urljoin\nfrom urllib.parse import urlparse\nfrom urllib.request import pathname2url\nfrom urllib.request import url2pathname\nimport os\nimport re\n\nimport sublime\n\n\ndef filename_to_uri(file_name: str) -> str:\n    \"\"\"\n    Convert a file name obtained from view.file_name() into an URI\n    \"\"\"\n    prefix = sublime.installed_packages_path()\n    if file_name.startswith(prefix):\n        return _to_resource_uri(file_name, prefix)\n    prefix = sublime.packages_path()\n    if file_name.startswith(prefix) and not os.path.exists(file_name):\n        return _to_resource_uri(file_name, prefix)\n    path = pathname2url(file_name)\n    return urljoin(\"file:\", path)\n\n\ndef view_to_uri(view: sublime.View) -> str:\n    file_name = view.file_name()\n    if not file_name:\n        return \"buffer://sublime/{}\".format(view.buffer_id())\n    return filename_to_uri(file_name)\n\n\ndef uri_to_filename(uri: str) -> str:\n    \"\"\"\n    DEPRECATED: An URI associated to a view does not necessarily have a \"file:\" scheme.\n    Use urllib.parse.urlparse to determine the scheme and go from there.\n    Use urllib.parse.unquote to unquote the path.\n    \"\"\"\n    parsed = urlparse(uri)\n    assert parsed.scheme == \"file\"\n    if os.name == 'nt':\n        # url2pathname does not understand %3A (VS Code's encoding forced on all servers :/)\n        path = url2pathname(parsed.path).strip('\\\\')\n        return re.sub(r\"^([a-z]):\", _uppercase_driveletter, path)\n    else:\n        return url2pathname(parsed.path)\n\n\ndef parse_uri(uri: str) -> Tuple[str, str]:\n    \"\"\"\n    Parses an URI into a tuple where the first element is the URI scheme. The\n    second element is the local filesystem path if the URI is a file URI,\n    otherwise the second element is the original URI.\n    \"\"\"\n    parsed = urlparse(uri)\n    if parsed.scheme == \"file\":\n        if os.name == 'nt':\n            # TODO: this is wrong for UNC paths\n            return parsed.scheme, url2pathname(parsed.path).strip('\\\\')\n        return parsed.scheme, url2pathname(parsed.path)\n    return parsed.scheme, uri\n\n\ndef _to_resource_uri(path: str, prefix: str) -> str:\n    \"\"\"\n    Terrible hacks from ST core leak into packages as well.\n\n    See: https://github.com/sublimehq/sublime_text/issues/3742\n    \"\"\"\n    return \"res://Packages{}\".format(quote(path[len(prefix):]))\n\n\ndef _uppercase_driveletter(match: Any) -> str:\n    \"\"\"\n    For compatibility with Sublime's VCS status in the status bar.\n    \"\"\"\n    return \"{}:\".format(match.group(1).upper())\n", "path": "plugin/core/url.py"}]}