Skip to content

Commit be9c7b4

Browse files
committed
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck into InspectionBugs
2 parents c43884f + 88cb6c2 commit be9c7b4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,18 @@ public void AddProject(VBProject project)
8383
return;
8484
}
8585

86+
//assign a hashcode if no helpfile is present
8687
if (string.IsNullOrEmpty(project.HelpFile))
8788
{
8889
project.HelpFile = project.GetHashCode().ToString();
8990
}
91+
92+
//loop until the helpfile is unique for this host session
93+
while (_projects.Any(a => a.Key == project.HelpFile))
94+
{
95+
project.HelpFile = (project.GetHashCode() ^ project.HelpFile.GetHashCode()).ToString();
96+
}
97+
9098
var projectId = project.HelpFile;
9199
if (!_projects.ContainsKey(projectId))
92100
{

0 commit comments

Comments
 (0)