Skip to content

Source generator not escaping dashes in assembly name #1800

Closed

Description

Our source generator has logic to escape the assembly name as it is used as part of the namespace for generated sources. The escaping logic doesn't handle dashes which it should.

    public static string EscapeTypeNameForIdentifier(string typeName)
    {
        return Regex.Replace(typeName, """[(\ |:<>,\.)]""", "_");
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions