removed double suggestions when using vscode workspaces plugin

This commit is contained in:
coldfeudal 2024-02-08 18:42:13 +03:00
parent 3d39107e02
commit 60599d8fc9
No known key found for this signature in database
GPG Key ID: FFDC818B89C55282

View File

@ -38,11 +38,17 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
{
var results = new List<Result>();
var alreadyAddedPaths = new List<string>();
if (query != null)
{
// Search opened workspaces
_workspacesApi.Workspaces.ForEach(a =>
{
if (!alreadyAddedPaths.Contains(a.Path))
{
alreadyAddedPaths.Add(a.Path);
var title = a.WorkspaceType == WorkspaceType.ProjectFolder ? a.FolderName : a.FolderName.Replace(".code-workspace", $" ({Resources.Workspace})");
var typeWorkspace = a.WorkspaceEnvironmentToString();
@ -87,6 +93,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
},
ContextData = a,
});
}
});
// Search opened remote machines