Skip to content

Commit 8bb3ddf

Browse files
committed
Polish generated code formatting
1 parent 3b8d3c7 commit 8bb3ddf

130 files changed

Lines changed: 671 additions & 260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/LightupGenerator.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,19 @@ private void GenerateOperationInterface(in GeneratorExecutionContext context, Li
583583
.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName("System.Collections.Immutable")))
584584
.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName("Microsoft.CodeAnalysis"))),
585585
members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(wrapperStruct));
586-
context.AddSource(wrapperName + ".g.cs", SourceText.From(wrapperNamespace.NormalizeWhitespace().ToFullString(), Encoding.UTF8));
586+
587+
wrapperNamespace = wrapperNamespace
588+
.NormalizeWhitespace()
589+
.WithLeadingTrivia(
590+
SyntaxFactory.Comment("// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved."),
591+
SyntaxFactory.CarriageReturnLineFeed,
592+
SyntaxFactory.Comment("// Licensed under the MIT License. See LICENSE in the project root for license information."),
593+
SyntaxFactory.CarriageReturnLineFeed,
594+
SyntaxFactory.CarriageReturnLineFeed)
595+
.WithTrailingTrivia(
596+
SyntaxFactory.CarriageReturnLineFeed);
597+
598+
context.AddSource(wrapperName + ".g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8));
587599
}
588600

589601
private void GenerateOperationWrapperHelper(in GeneratorExecutionContext context, List<string> wrapperTypes)
@@ -754,7 +766,19 @@ private void GenerateOperationWrapperHelper(in GeneratorExecutionContext context
754766
.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName("System.Reflection")))
755767
.Add(SyntaxFactory.UsingDirective(SyntaxFactory.ParseName("Microsoft.CodeAnalysis"))),
756768
members: SyntaxFactory.SingletonList<MemberDeclarationSyntax>(wrapperHelperClass));
757-
context.AddSource("OperationWrapperHelper.g.cs", SourceText.From(wrapperNamespace.NormalizeWhitespace().ToFullString(), Encoding.UTF8));
769+
770+
wrapperNamespace = wrapperNamespace
771+
.NormalizeWhitespace()
772+
.WithLeadingTrivia(
773+
SyntaxFactory.Comment("// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved."),
774+
SyntaxFactory.CarriageReturnLineFeed,
775+
SyntaxFactory.Comment("// Licensed under the MIT License. See LICENSE in the project root for license information."),
776+
SyntaxFactory.CarriageReturnLineFeed,
777+
SyntaxFactory.CarriageReturnLineFeed)
778+
.WithTrailingTrivia(
779+
SyntaxFactory.CarriageReturnLineFeed);
780+
781+
context.AddSource("OperationWrapperHelper.g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8));
758782
}
759783

760784
private sealed class PropertyData

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IAddressOfOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -44,4 +47,4 @@ public static bool IsInstance(IOperation operation)
4447
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4548
}
4649
}
47-
}
50+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IAggregateQueryOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -47,4 +50,4 @@ public static bool IsInstance(IOperation operation)
4750
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4851
}
4952
}
50-
}
53+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IAnonymousFunctionOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -47,4 +50,4 @@ public static bool IsInstance(IOperation operation)
4750
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4851
}
4952
}
50-
}
53+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IAnonymousObjectCreationOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -44,4 +47,4 @@ public static bool IsInstance(IOperation operation)
4447
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4548
}
4649
}
47-
}
50+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IArgumentOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -50,4 +53,4 @@ public static bool IsInstance(IOperation operation)
5053
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
5154
}
5255
}
53-
}
56+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IArrayCreationOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -47,4 +50,4 @@ public static bool IsInstance(IOperation operation)
4750
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4851
}
4952
}
50-
}
53+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IArrayElementReferenceOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -47,4 +50,4 @@ public static bool IsInstance(IOperation operation)
4750
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4851
}
4952
}
50-
}
53+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IArrayInitializerOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -44,4 +47,4 @@ public static bool IsInstance(IOperation operation)
4447
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
4548
}
4649
}
47-
}
50+
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/StyleCop.Analyzers.CodeGeneration/StyleCop.Analyzers.CodeGeneration.LightupGenerator/IAssignmentOperationWrapper.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace StyleCop.Analyzers.Lightup
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Lightup
25
{
36
using System;
47
using System.Collections.Immutable;
@@ -52,4 +55,4 @@ internal static IAssignmentOperationWrapper FromUpcast(IOperation operation)
5255
return new IAssignmentOperationWrapper(operation);
5356
}
5457
}
55-
}
58+
}

0 commit comments

Comments
 (0)