Skip to content
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

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

joperezr
Copy link
Member

@joperezr joperezr commented Aug 5, 2022

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

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

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.

@joperezr joperezr added this to the 7.0.0 milestone Aug 5, 2022
@ghost ghost assigned joperezr Aug 5, 2022
@ghost
Copy link

ghost commented Aug 5, 2022

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: joperezr
Assignees: -
Labels:

area-System.Text.RegularExpressions, new-api-needs-documentation

Milestone: -

@joperezr joperezr added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 5, 2022
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Looks great, thanks.

@joperezr joperezr marked this pull request as ready for review August 9, 2022 21:03
@joperezr joperezr removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 9, 2022
@joperezr
Copy link
Member Author

The wasm failure is unrelated to this PR, so I'll go ahead and merge.

@joperezr joperezr merged commit cbe6514 into dotnet:main Aug 11, 2022
@joperezr joperezr deleted the SourceGenCulture branch August 11, 2022 01:06
@ghost ghost locked as resolved and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal] Add cultureName constructors to GeneratedRegex
2 participants