File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
protocol/source/served/lsp Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,15 @@ private void assertEquals(T)(T a, T b)
1414
1515DocumentUri uriFromFile (scope const (char )[] file)
1616{
17+ import std.ascii : isUpper, toLower;
1718 import std.uri : encodeComponent;
1819
1920 if ((! isAbsolute(file) && ! file.startsWith(" /" ))
2021 || ! file.length)
2122 throw new Exception (text(" Tried to pass relative path '" , file, " ' to uriFromFile" ));
22- file = file.buildNormalizedPath();
23- version (Windows )
24- {
25- file = file.replace(" \\ " , " /" );
26- file = driveName(file).toLower() ~ stripDrive(file);
27- }
23+ file = file.buildNormalizedPath().replace(" \\ " , " /" );
24+ if (file.length >= 2 && file[0 ].isUpper && file[1 ] == ' :' )
25+ file = file[0 ].toLower ~ file[1 .. $];
2826 assert (file.length);
2927 if (file.ptr[0 ] != ' /' )
3028 file = ' /' ~ file; // always triple slash at start but never quad slash
You can’t perform that action at this time.
0 commit comments