-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Adding cultureName to GeneratedRegexAttribute #73490
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsFixes #59492 This adds changes the default behavior of the source generated engine to use Invariant Culture for case-sensitive comparisons, as well as adds two APIs on the GeneratedRegex attribute that take in a cultureName that let's the user override that behavior. This also updates the regex source generator's analyzer and codefixer to be explicit into which constructor it picks and select the one that has the explicit cultureName with it. Note: This API hasn't been approved yet, hence I'm starting the PR as a draft, and we will take this API to review next Tuesday. cc: @stephentoub @tarekgh @GrabYourPitchforks
|
src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Tests.Common.cs
Outdated
Show resolved
Hide resolved
...System.Text.RegularExpressions/tests/FunctionalTests/UpgradeToGeneratedRegexAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs
Show resolved
Hide resolved
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.
Looks great, thanks.
The wasm failure is unrelated to this PR, so I'll go ahead and merge. |
Fixes #59492
This adds changes the default behavior of the source generated engine to use Invariant Culture for case-sensitive comparisons, as well as adds two APIs on the GeneratedRegex attribute that take in a cultureName that let's the user override that behavior. This also updates the regex source generator's analyzer and codefixer to be explicit into which constructor it picks and select the one that has the explicit cultureName with it.
Note: This API hasn't been approved yet, hence I'm starting the PR as a draft, and we will take this API to review next Tuesday.
cc: @stephentoub @tarekgh @GrabYourPitchforks