- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.2k
Closed
Closed
Copy link
Labels
Area-CompilersBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
I am currently working on this PR for CsWin32: microsoft/CsWin32#621
We have this code that causes the xml comment to have an extra leading tab white space:
typeDeclaration = typeDeclaration
                    .WithLeadingTrivia()
                    .AddAttributeLists(AttributeList().AddAttributes(GeneratedCodeAttribute))
                    .WithLeadingTrivia(typeDeclaration.GetLeadingTrivia());typeDeclaration is MemberDeclarationSyntax.
The generated code attribute is:
private static readonly AttributeSyntax GeneratedCodeAttribute = Attribute(IdentifierName("global::System.CodeDom.Compiler.GeneratedCode"))
        .WithArgumentList(FixTrivia(AttributeArgumentList().AddArguments(
            AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(ThisAssembly.AssemblyName))),
            AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(ThisAssembly.AssemblyInformationalVersion))))));If we do not add the attribute, then the leading trivia xml comment is formatted correctly.
Am I missing something obvious?
Metadata
Metadata
Assignees
Labels
Area-CompilersBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it