Skip to content

Consider propagating regex comments to source-generated code #69616

@stephentoub

Description

@stephentoub

If a developer specifies RegexOptions.IgnorePatternWhitespace or uses the (?x) inline option, they can embed # comments inside their regex pattern. Today the parser simply throws these away. When in the context of the source generator, we could instead store them and try to propagate them to the generated C# code as C# comments at an appropriate location in the source.

Metadata

Metadata

Assignees

Labels

area-System.Text.RegularExpressionshelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions