From b9587ff33446b10566aba1b9c20dea65e12431c8 Mon Sep 17 00:00:00 2001 From: Stefan Markovic Date: Thu, 8 Feb 2024 10:49:48 +0100 Subject: [PATCH] [PT Run][VS Code Workspaces] Do not check WSL paths --- .../WorkspacesHelper/VSCodeWorkspacesApi.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/WorkspacesHelper/VSCodeWorkspacesApi.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/WorkspacesHelper/VSCodeWorkspacesApi.cs index 0be408dc4947..6152d4c391f5 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/WorkspacesHelper/VSCodeWorkspacesApi.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/WorkspacesHelper/VSCodeWorkspacesApi.cs @@ -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; } @@ -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