Skip to content

Commit b4be9ba

Browse files
committed
Address Codacy issues
1 parent e9595a5 commit b4be9ba

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

src/PowerShellEditorServices/Workspace/ScriptFile.cs

-37
Original file line numberDiff line numberDiff line change
@@ -578,43 +578,6 @@ public BufferRange GetRangeBetweenOffsets(int startOffset, int endOffset)
578578

579579
#region Private Methods
580580

581-
private static string GetPathAsClientPath(string path)
582-
{
583-
const string fileUriPrefix = "file:///";
584-
585-
if (path.StartsWith("untitled:", StringComparison.Ordinal))
586-
{
587-
return path;
588-
}
589-
590-
if (path.StartsWith("file:///", StringComparison.Ordinal))
591-
{
592-
return path;
593-
}
594-
595-
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
596-
{
597-
return new Uri(path).AbsoluteUri;
598-
}
599-
600-
// VSCode file URIs on Windows need the drive letter lowercase, and the colon
601-
// URI encoded. System.Uri won't do that, so we manually create the URI.
602-
var newUri = System.Web.HttpUtility.UrlPathEncode(path);
603-
int colonIndex = path.IndexOf(":");
604-
for (var i = colonIndex - 1; i >= 0; i--)
605-
{
606-
newUri.Remove(i, 1);
607-
newUri.Insert(i, char.ToLowerInvariant(path[i]).ToString());
608-
}
609-
610-
return newUri
611-
.Remove(colonIndex, 1)
612-
.Insert(colonIndex, "%3A")
613-
.Replace("\\", "/")
614-
.Insert(0, fileUriPrefix)
615-
.ToString();
616-
}
617-
618581
private void SetFileContents(string fileContents)
619582
{
620583
// Split the file contents into lines and trim

0 commit comments

Comments
 (0)