-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
area-System.Text.RegularExpressionsenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsiderationsource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature
Milestone
Description
Consider
private static Regex r = new Regex(@"a
b
c", RegexOptions.IgnorePatternWhitespace);
run the fixer, now I have
[GeneratedRegex("a\r\n b\r\n c", RegexOptions.IgnorePatternWhitespace)]
private static partial Regex MyRegex();
The semantics are the same, but the readability is gone. I would expect
[GeneratedRegex(@"a
b
c", RegexOptions.IgnorePatternWhitespace)]
private static partial Regex MyRegex();
I see #69616 which implies that whitespace is preserved but not comments. I don't see whitespace preserved, or at least not in the original form.
Copilot
Metadata
Metadata
Assignees
Labels
area-System.Text.RegularExpressionsenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsiderationsource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature