-
Notifications
You must be signed in to change notification settings - Fork 232
Ignore case when parsing enum values in settings in VS Code #12667
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
Ignore case when parsing enum values in settings in VS Code #12667
Conversation
.../src/Microsoft.VisualStudioCode.RazorExtension/Services/CohostConfigurationChangedService.cs
Outdated
Show resolved
Hide resolved
.../src/Microsoft.VisualStudioCode.RazorExtension/Services/CohostConfigurationChangedService.cs
Outdated
Show resolved
Hide resolved
.../src/Microsoft.VisualStudioCode.RazorExtension/Services/CohostConfigurationChangedService.cs
Outdated
Show resolved
Hide resolved
.../src/Microsoft.VisualStudioCode.RazorExtension/Services/CohostConfigurationChangedService.cs
Outdated
Show resolved
Hide resolved
.../src/Microsoft.VisualStudioCode.RazorExtension/Services/CohostConfigurationChangedService.cs
Outdated
Show resolved
Hide resolved
...test/Microsoft.VisualStudioCode.RazorExtension.Test/CohostConfigurationChangedServiceTest.cs
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| if (Enum.TryParse<T>(jsonNode.GetValue<string>(), out var value)) | ||
| if (Enum.TryParse<T>(jsonNode.GetValue<string>(), ignoreCase: true, out var value)) |
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.
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.
I can't remember if it was paranoia or a user report, or maybe even me stuffing up my own settings file, but users directly modify the settings json in VS Code so the difference between "value": true and "value": "true" doesn't seem like it should be their problem, IMO.
Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
Noticed this when testing our latest VS Code insertion. I missed ignoring the case when parsing the enum, when adding this setting, and also missed that the tests we had were for the old language server so they didn't fail because I got that code right 🤦♂️