-
Notifications
You must be signed in to change notification settings - Fork 243
fix references crash #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix references crash #826
Conversation
| : new OrderedDictionary(StringComparer.OrdinalIgnoreCase); | ||
|
|
||
| foreach (ScriptFile file in referencedFiles) | ||
| foreach (ScriptFile scriptFile in referencedFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| foreach (ScriptFile scriptFile in referencedFiles) | ||
| { | ||
| fileMap.Add(file.FilePath, file); | ||
| if (!fileMap.Contains(scriptFile.FilePath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also use the indexer:
fileMap[scriptFile.FilePath] = scriptFile;
That creates the entry if it doesn't exist and writes a new value if it does exist.
rkeithhill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rjmholt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
SeeminglyScience
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes PowerShell/vscode-powershell#1652 by making the OrderedDictionaries more resilient