Skip to content

Commit

Permalink
[PT Run][VSCodeWorkspaces] Do not check WSL paths existence (#31351)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw authored Feb 8, 2024
1 parent 04f5147 commit dec535e
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private VSCodeWorkspace ParseVSCodeUriAndAuthority(string uri, string authority,
path = path[1..];
}

if (!DoesPathExist(path, workspaceEnv.Value, machineName))
if (!DoesPathExist(path, workspaceEnv.Value))
{
return null;
}
Expand All @@ -72,18 +72,11 @@ private VSCodeWorkspace ParseVSCodeUriAndAuthority(string uri, string authority,
};
}

private bool DoesPathExist(string path, WorkspaceEnvironment workspaceEnv, string machineName)
private bool DoesPathExist(string path, WorkspaceEnvironment workspaceEnv)
{
if (workspaceEnv == WorkspaceEnvironment.Local || workspaceEnv == WorkspaceEnvironment.RemoteWSL)
if (workspaceEnv == WorkspaceEnvironment.Local)
{
var resolvedPath = path;

if (workspaceEnv == WorkspaceEnvironment.RemoteWSL)
{
resolvedPath = $"\\\\wsl$\\{machineName}{resolvedPath.Replace('/', '\\')}";
}

return Directory.Exists(resolvedPath) || File.Exists(resolvedPath);
return Directory.Exists(path) || File.Exists(path);
}

// If the workspace environment is not Local or WSL, assume the path exists
Expand Down

0 comments on commit dec535e

Please sign in to comment.