-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Analyzer/fixer for converting Regex use to source generator #68147
Comments
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsFor
|
I already started looking into this on Thursday, so assigning to me. |
Oh, cool, thanks for sharing! |
@meziantou as @stephentoub pointed out, we really appreciate you sharing your work, I took a look and it indeed looks very similar to what we want to have, except that we want to make sure it ships on the same assembly as our source generator. We still need to get the analyzer approved, but once we do, would you be interested in contributing a PR for this analyzer? |
Once it is approved, and if I have time at that moment, I can contribute to this analyzer |
|
Hey @meziantou, this has now been approved, are you still interested on contributing an implementation? If not I already have an initial prototype but wanted to check with you first before I finished it and send out the PR review. |
@joperezr I'm on vacation for 2 weeks, so I won't be able to contribute at the moment. If you already have a prototype, you can create a PR. I will review the change when I get back to work and check if I can add something. |
Sounds good, enjoy your time off. |
Suggested severity: Info
Suggested category: Performance
For
new Regex(...)
andRegex.StaticMethod(...)
involving patterns, options, and timeouts known at compile time, we should provide an analyzer and fixer that will transform the regex into its corresponding RegexGenerator form, including fixing up the call sites.Flag
Don't Flag
Fixer
The fixer will mainly do three things:
partial
keyword (if it's not there already) to the type (or types for nested types) which contains the invocation that generated the diagnosticRegexGenerator
attribute and parameters so the source generator generates the Regex type.The text was updated successfully, but these errors were encountered: