-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Rename [RegexGenerator] to [GeneratedRegex] #72434
Rename [RegexGenerator] to [GeneratedRegex] #72434
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 DetailsRenamed Closes #62123,
|
@stephentoub, @joperezr, does it need API review? I have opened it as a Draft in case review is needed. |
It almost certainly needs an API review. |
Thanks for opening the PR @am11. Yes, it does require API review, we marked the corresponding issue as blocking to see if we could get to it in today's API Review but we ran out of time. We will likely go over it on Thursday at 10am, if you want to join, they are usually broadcasted live here: https://www.youtube.com/channel/UCiaZbznpWV1o-KLxj8zqR6A |
This PR will also have to update the analyzer and codefixer for the regex source generator: runtime/src/libraries/System.Text.RegularExpressions/gen/UpgradeToRegexGeneratorAnalyzer.cs Line 28 in c37f002
|
Thanks @joperezr.
Yup. I updated both in the first commit. |
We discussed this today in APIReview, the decision was to use |
Reiterating my comments from API review, runtime libraries flow at a different rate to dependent repos (e.g. dotnet/winforms) than does the generator. I suspect when this merges, we'll end up breaking one or more dependent repos when they try to pick up flowed runtime libraries. We'll end up having a few options I suspect:
I could be wrong, of course. Maybe everything will "just work" 😆 |
I agree that this could be problematic. After a quick search in source.dot.net seems like out of the repos where this could cause a problem, only winforms is actively using the attribute. This may or may not be very accurate since source.dot.net isn't a full representation of our repos consumption. All that said, even though you are right saying that sdk and runtime libraries flow at different rates to these other repos, I'd imagine that the attribute and generator would both be part of the targeting pack, so in theory this shouldn't be a problem if someone is updating their targeting pack that they build against faster than their sdk. In any case, if/when the time comes of a break, I will evaluate the solutions proposed above, and figure out what the best/easiest workaround is. I do very much appreciate the heads up as it is a very valid concern 😄 |
478cdef
to
a65b50f
Compare
src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.cs.xlf
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.cs.xlf
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/UpgradeToGeneratedRegexAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/UpgradeToGeneratedRegexCodeFixer.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.RegularExpressions/gen/UpgradeToGeneratedRegexCodeFixer.cs
Outdated
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.
Thanks for working on this.
I'm seeing that we still have several places where we make reference to "RegexGenerator" in your code, some of them should definitely be changed like:
Some I'm not so sure if we should change, like the actual |
We shouldn't change those. Those are about the generator. |
I was looking at the naming convention used by interop generator: Line 23 in 0fbdb1e
GeneratedRegexGenerator as it is redundant, so I left it as is (RegexGenerator ).
|
src/libraries/System.Text.RegularExpressions/gen/UpgradeToGeneratedRegexCodeFixer.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.
2 very minor comments but looks good otherwise. @am11 would you be able to fix the merge conflicts on the PR? If you need help with this let me know and I'm happy to do so.
ac23089
to
7313080
Compare
I have rebased and resolved the merged conflicts. Failures are unrelated network/infra issues. |
Renamed
[RegexGenerator]
to[GeneratedRegex]
, updated its usages, renamed analyzer & code fixer, and updated the docs. The internal implementation and some tests use the termRegexGenerator
in a few places, which were making less sense when I tried renaming to eitherGeneratedRegex
orGeneratedRegexAttribute
, so I have left those files alone.Closes #62123,