Merge pull request #41747 from neikeq/issue-41446

Fix parsing of C# files with spaces in the path
This commit is contained in:
Rémi Verschelde 2020-09-04 08:16:56 +02:00 committed by GitHub
commit 15efe040f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,10 +14,11 @@ namespace GodotTools.Core
if (Path.DirectorySeparatorChar == '\\')
dir = dir.Replace("/", "\\") + "\\";
Uri fullPath = new Uri(Path.GetFullPath(path), UriKind.Absolute);
Uri relRoot = new Uri(Path.GetFullPath(dir), UriKind.Absolute);
var fullPath = new Uri(Path.GetFullPath(path), UriKind.Absolute);
var relRoot = new Uri(Path.GetFullPath(dir), UriKind.Absolute);
return relRoot.MakeRelativeUri(fullPath).ToString();
// MakeRelativeUri converts spaces to %20, hence why we need UnescapeDataString
return Uri.UnescapeDataString(relRoot.MakeRelativeUri(fullPath).ToString());
}
public static string NormalizePath(this string path)