diff --git a/VSCodeHelper/VSCodeInstances.cs b/VSCodeHelper/VSCodeInstances.cs index 021d8c5..7b0a23e 100644 --- a/VSCodeHelper/VSCodeInstances.cs +++ b/VSCodeHelper/VSCodeInstances.cs @@ -67,15 +67,21 @@ public static void LoadVSCodeInstances() Instances = new List(); _systemPath = Environment.GetEnvironmentVariable("PATH") ?? ""; - var paths = _systemPath.Split(";"); - paths = paths.Where(x => x.Contains("VS Code")).Distinct().ToArray(); + var paths = _systemPath.Split(";").Where(x => + x.Contains("VS Code", StringComparison.OrdinalIgnoreCase) || + x.Contains("VSCodium", StringComparison.OrdinalIgnoreCase) || + x.Contains("vscode", StringComparison.OrdinalIgnoreCase)); foreach (var path in paths) { if (Directory.Exists(path)) { var files = Directory.GetFiles(path); var iconPath = Path.GetDirectoryName(path); - files = files.Where(x => x.Contains("code") && !x.EndsWith(".cmd")).ToArray(); + files = files.Where(x => + (x.Contains("code", StringComparison.OrdinalIgnoreCase) || + x.Contains("VSCodium", StringComparison.OrdinalIgnoreCase)) + && !x.EndsWith(".cmd", StringComparison.OrdinalIgnoreCase)).ToArray(); + if (files.Length > 0) { @@ -105,17 +111,18 @@ public static void LoadVSCodeInstances() if (version != string.Empty) { - instance.AppData = Path.Combine(_userAppDataPath, version); + var portableData = Path.Join(iconPath, "data"); + instance.AppData = Directory.Exists(portableData) ? Path.Join(portableData, "user-data") : Path.Combine(_userAppDataPath, version); var iconVSCode = Path.Join(iconPath, $"{version}.exe"); var bitmapIconVscode = Icon.ExtractAssociatedIcon(iconVSCode)?.ToBitmap(); // workspace - var folderIcon = (Bitmap)System.Drawing.Image.FromFile(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "//Images//folder.png"); + var folderIcon = (Bitmap)Image.FromFile(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "//Images//folder.png"); instance.WorkspaceIconBitMap = Bitmap2BitmapImage(BitmapOverlayToCenter(folderIcon, bitmapIconVscode)); // remote - var monitorIcon = (Bitmap)System.Drawing.Image.FromFile(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "//Images//monitor.png"); + var monitorIcon = (Bitmap)Image.FromFile(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "//Images//monitor.png"); instance.RemoteIconBitMap = Bitmap2BitmapImage(BitmapOverlayToCenter(monitorIcon, bitmapIconVscode)); diff --git a/plugin.json b/plugin.json index 6cc333d..0852964 100644 --- a/plugin.json +++ b/plugin.json @@ -4,7 +4,7 @@ "ActionKeyword": "{", "Name": "VS Code Workspaces", "Author": "ricardosantos9521", - "Version": "1.1.3", + "Version": "1.2.0", "Language": "csharp", "Website": "https://github.com/ricardosantos9521/PowerToys/", "ExecuteFileName": "Flow.Plugin.VSCodeWorkspaces.dll",