Skip to content

Commit 47dd40a

Browse files
committed
Fixed "don't show duplicates" being slow
Removed ordering of files For sufficiently large solutions (e.g. Unreal Engine 4) my previous unique-only solution was very slow. I've switched to LINQ's Distinct() which is much faster (barely noticeable) and removed sorting to help with the small speed hit associated with that. Sorting would be nice, but getting files back in solution order is fine for now.
1 parent 961a744 commit 47dd40a

6 files changed

Lines changed: 5 additions & 24 deletions

File tree

Extensions.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

ListFiles.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal class EvnDTEConstants
2727

2828
public ListFiles(IEnumerable<ProjectItemWrapper> inItems)
2929
{
30-
items = new ObservableCollection<ProjectItemWrapper>(inItems.OrderBy(x => Path.GetFileName(x.Filename)));
30+
items = new ObservableCollection<ProjectItemWrapper>(inItems.Distinct());
3131
viewSource = new CollectionViewSource();
3232
viewSource.Source = items;
3333

OpenFileInSolution.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
<Reference Include="WindowsBase" />
128128
</ItemGroup>
129129
<ItemGroup>
130-
<Compile Include="Extensions.cs" />
131130
<Compile Include="Guids.cs" />
132131
<Compile Include="ListFiles.xaml.cs">
133132
<DependentUpon>ListFiles.xaml</DependentUpon>

OpenFileInSolutionPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private void MenuItemCallback(object sender, EventArgs e)
202202
var projItems = new List<ProjectItemWrapper>();
203203
foreach (var proj in GetProjects())
204204
{
205-
projItems.AddRangeUnique(EnumerateProjectItems(proj.ProjectItems));
205+
projItems.AddRange(EnumerateProjectItems(proj.ProjectItems));
206206
}
207207

208208
var wnd = new ListFiles(projItems);

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
// You can specify all the values or you can default the Revision and Build Numbers
3030
// by using the '*' as shown below:
3131

32-
[assembly: AssemblyVersion("1.11.2.0")]
33-
[assembly: AssemblyFileVersion("1.11.2.0")]
32+
[assembly: AssemblyVersion("1.11.3.0")]
33+
[assembly: AssemblyFileVersion("1.11.3.0")]
3434

3535

3636

source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="6bb18fff-9e74-4deb-97df-6a94ddafb74e" Version="1.11.2" Language="en-US" Publisher="Pernicious Games" />
4+
<Identity Id="6bb18fff-9e74-4deb-97df-6a94ddafb74e" Version="1.11.3" Language="en-US" Publisher="Pernicious Games" />
55
<DisplayName>OpenFileInSolution</DisplayName>
66
<Description>Shows a list of all files in the current solution and allows quickly filtering and opening them.</Description>
77
<License>LICENSE</License>

0 commit comments

Comments
 (0)