Skip to content

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Jan 11, 2026

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 🤦‍♂️

@davidwengier davidwengier requested a review from a team as a code owner January 11, 2026 21:57
}

if (Enum.TryParse<T>(jsonNode.GetValue<string>(), out var value))
if (Enum.TryParse<T>(jsonNode.GetValue<string>(), ignoreCase: true, out var value))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetValue

Out of curiosity, this code uses GetValue, but GetBooleanOptionsValue above it does a ToString. Is there a reason GetBooleanOptionsValue doesn't use GetValue?

Copy link
Member Author

@davidwengier davidwengier Jan 12, 2026

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>
@davidwengier davidwengier merged commit d52086b into dotnet:main Jan 12, 2026
10 checks passed
@davidwengier davidwengier deleted the IgnoreCaseInVSCodeSettings branch January 12, 2026 22:05
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants