Skip to content

Avoid global:: qualifying all names in the Regex source generator #63512

@stephentoub

Description

@stephentoub

Blocked on dotnet/csharplang#5529

In the Regex source generator, we currently fully-qualify with global:: every name to something in the core libraries, e.g. global::System.MemoryExtensions.IndexOf(span, value) rather than span.IndexOf(value). This is done to avoid accidentally referencing something of the same name in the user's code, but it also leads to generating code that's much harder to read (and the generator itself is more verbose).

Once we have a solution to dotnet/csharplang#5529, we can spit the Regex-derived type into its own namespace, and put usings inside that namespace for all of the System.* namespaces we consume. At that point, we will no longer need to fully-qualify and can go back to using simple names, using extension methods as extensions, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions