Skip to content

Commit 70a49e9

Browse files
committed
Careful assignment of ProjectID - Avoids project collisions
All @Hosch250's work
1 parent 7123cac commit 70a49e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Rubberduck.Parsing/VBA/RubberduckParserState.cs

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

86-
if (string.IsNullOrEmpty(project.HelpFile))
86+
//if (string.IsNullOrEmpty(project.HelpFile))
87+
//{
88+
// project.HelpFile = project.GetHashCode().ToString();
89+
//}
90+
while (string.IsNullOrEmpty(project.HelpFile) || _projects.Any(a => a.Key == project.HelpFile))
8791
{
88-
project.HelpFile = project.GetHashCode().ToString();
92+
project.HelpFile = (project.GetHashCode() ^ project.HelpFile.GetHashCode()).ToString();
8993
}
94+
9095
var projectId = project.HelpFile;
9196
if (!_projects.ContainsKey(projectId))
9297
{

0 commit comments

Comments
 (0)