Skip to content

Commit 4eedd5c

Browse files
committed
Fix for multiple files with the same name.
When multiple files with the same filename, but different path, appear in the same solution, all files will be displayed. Duplicates of the same file path will still be removed. e.g. C:\Foo\Bar.h and C:\Baz\Bar.h will both be shown. However, if C:\Foo\Bar.h is referenced twice it will only be shown once.
1 parent 66a8c59 commit 4eedd5c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

OpenFileInSolutionPackage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public bool Equals(ProjectItemWrapper x, ProjectItemWrapper y)
4545

4646
public int GetHashCode(ProjectItemWrapper obj)
4747
{
48-
return obj.Filename.GetHashCode();
48+
return obj.Path.GetHashCode();
4949
}
5050
}
5151

@@ -180,7 +180,7 @@ private IEnumerable<ProjectItemWrapper> EnumerateProjectItems(ProjectItems items
180180
for (int i = 1; i <= items.Count; i++)
181181
{
182182
var itm = items.Item(i);
183-
183+
184184
foreach (var res in EnumerateProjectItems(itm.ProjectItems))
185185
{
186186
yield return res;
@@ -228,9 +228,9 @@ private void MenuItemCallback(object sender, EventArgs e)
228228
{
229229
foreach (var item in EnumerateProjectItems(proj.ProjectItems))
230230
{
231-
if (!projItems.ContainsKey(item.Filename))
231+
if (!projItems.ContainsKey(item.Path))
232232
{
233-
projItems.Add(item.Filename, item);
233+
projItems.Add(item.Path, item);
234234
}
235235
}
236236
}

0 commit comments

Comments
 (0)