From fec0970a4c05255984d9dbbe65e8691cc3358805 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 10:27:44 -0500 Subject: [PATCH 01/21] Working on moving around tests --- .../FormattingTestsGenerator.cs | 7 ++++--- .../FormattingTestsGenerator.sbntxt | 2 +- Src/CSharpier.Tests/CSharpier.Tests.csproj | 10 +++++----- Src/CSharpier.Tests/FormattingTests/BaseTest.cs | 7 ++++--- .../AddressOfExpressions.test} | 0 .../AliasQualifiedNames.test} | 0 .../AnonymousMethodExpressions.test} | 0 .../AnonymousObjectCreationExpressions.test} | 0 .../ArgumentLists.test} | 0 .../ArrayCreationExpressions.test} | 0 .../AsExpressions.test} | 0 .../AssignmentExpressions.test} | 0 .../AttributeListNewLines.expected.test} | 0 .../AttributeListNewLines.test} | 0 .../AttributeLists.test} | 0 .../AutoDashGenerated.test} | 0 .../AutoGenerated.test} | 0 .../AwaitExpressions.test} | 0 .../BaseExpressions.test} | 0 .../BinaryExpressions.test} | 0 .../CSharpierIgnore.expected.test} | 0 .../CSharpierIgnore.test} | 0 .../CSharpierIgnore_CompilationUnit.expected.test} | 0 .../CSharpierIgnore_CompilationUnit.test} | 0 .../CSharpierIgnore_Dont.expected.test} | 0 .../CSharpierIgnore_Dont.test} | 0 .../CSharpierIgnore_TopLevel.expected.test} | 0 .../CSharpierIgnore_TopLevel.test} | 0 .../CastExpressions.test} | 0 .../CheckedStatements.test} | 0 .../ClassDeclarations.test} | 0 .../ClassDeclarations_EdgeCase.expected.test} | 0 .../ClassDeclarations_EdgeCase.test} | 0 .../ClassDeclarations_Tabs.test} | 0 .../CloseBraceRemovesLines.expected.test} | 0 .../CloseBraceRemovesLines.test} | 0 .../CoalesceExpressions.test} | 0 .../{Comments.cst => CSharp/Comments.test} | 0 .../Comments_EdgeCase.expected.test} | 0 .../Comments_EdgeCase.test} | 0 .../CompilationUnitAttributes.expected.test} | 0 .../CompilationUnitAttributes.test} | 0 .../CompilationUnitIfDirectiveEdgeCase.test} | 0 .../CompilationUnitIfDirectiveEdgeCase2.test} | 0 .../CompilationUnitIfDirectiveEdgeCase3.test} | 0 .../CompilationUnitIfDirectiveEdgeCase4.test} | 0 .../CompilationUnitIfDirectiveEdgeCase5.test} | 0 .../CompilationUnitIfDirectiveEdgeCase6.test} | 0 .../CompilationUnitIfDirectiveEdgeCase7.test} | 0 .../ConditionalAccessExpressions.test} | 0 .../ConditionalExpressions.test} | 0 .../ConditionalExpressions_Tabs.test} | 0 .../ConstructorDeclarations.test} | 0 .../ConversionOperatorDeclarations.test} | 0 .../DeclarationExpressions.test} | 0 .../DefaultExpressions.test} | 0 .../DelegateDeclarations.test} | 0 .../DestructorDeclarations.test} | 0 .../{Directives.cst => CSharp/Directives.test} | 0 .../Directives_AddAndRemoveLines.expected.test} | 0 .../Directives_AddAndRemoveLines.test} | 0 .../Directives_CompilationUnit.test} | 0 .../Directives_FileScopedNamespace.test} | 0 .../Directives_Namespace.test} | 0 .../Directives_Regions.test} | 0 .../{DoStatements.cst => CSharp/DoStatements.test} | 0 .../ElementAccessExpressions.test} | 0 .../ElementBindingExpressions.test} | 0 .../ElseStatements.test} | 0 .../EmptyLines.expected.test} | 0 .../{EmptyLines.cst => CSharp/EmptyLines.test} | 0 .../EnumDeclarationComments.expected.test} | 0 .../EnumDeclarationComments.test} | 0 .../EnumDeclarations.test} | 0 .../EventDeclarations.test} | 0 .../EventFieldDeclarations.test} | 0 .../ExternAliasDirectives.test} | 0 .../FieldDeclarations.test} | 0 .../FileEncoding_USC2LEBOM.test} | Bin .../FileEncoding_UTF8.test} | 0 .../FileEncoding_UTF8BOM.test} | 0 .../FileScopedNamespaceDeclaration.test} | 0 .../FixedStatements.test} | 0 .../ForEachStatements.test} | 0 .../ForEachVariableStatements.test} | 0 .../ForStatements.test} | 0 .../FunctionPointerTypes.test} | 0 .../GlobalStatements.test} | 0 .../{IfStatements.cst => CSharp/IfStatements.test} | 0 .../ImplicitArrayCreationExpressions.test} | 0 .../ImplicitElementAccesses.test} | 0 ...ImplicitStackAllocArrayCreationExpressions.test} | 0 .../IndexerDeclarations.test} | 0 .../InitializerExpressions.test} | 0 .../InterfaceDeclarations.test} | 0 .../InterpolatedStringExpressions.test} | 0 .../InvocationExpressions.test} | 0 .../IsExpressions.test} | 0 .../IsPatternExpressions.test} | 0 .../LabeledStatements.test} | 0 .../{ListPatterns.cst => CSharp/ListPatterns.test} | 0 .../LocalDeclarationStatements.test} | 0 .../LocalFunctionStatements.test} | 0 .../LockStatements.test} | 0 .../MakeRefExpressions.test} | 0 .../MemberAccessExpressions.test} | 0 .../MemberLines.expected.test} | 0 .../{MemberLines.cst => CSharp/MemberLines.test} | 0 .../MethodDeclarations.test} | 0 .../NamespaceDeclarations.test} | 0 .../NullableTypes.test} | 0 .../ObjectCreationExpressions.test} | 0 .../ObnoxiousEdgeCases.test} | 0 .../OperatorDeclarations.test} | 0 .../ParenthesizedExpressions.test} | 0 .../ParenthesizedLambdaExpressions.test} | 0 .../ParenthesizedVariableDesignations.test} | 0 .../PostIncrementExpressions.test} | 0 .../PreIncrementExpressions.test} | 0 .../PreprocessorSymbols.expected.test} | 0 .../PreprocessorSymbols.test} | 0 .../PreprocessorSymbols_KeepNewIines.test} | 0 .../PropertyDeclarations.test} | 0 .../QueryExpressions.test} | 0 .../QueryExpressions_RemoveSpaces.expected.test} | 0 .../QueryExpressions_RemoveSpaces.test} | 0 .../RangeExpressions.test} | 0 .../RecordDeclarations.test} | 0 .../RefExpressions.test} | 0 .../{RefTypes.cst => CSharp/RefTypes.test} | 0 .../ReturnStatements.test} | 0 .../SimpleLambdaExpressions.test} | 0 .../StackAllocArrayCreationExpressions.test} | 0 .../StringLiterals.test} | 0 .../StructDeclarations.test} | 0 .../SwitchExpressions.test} | 0 .../SwitchExpressions_Tabs.test} | 0 .../SwitchStatements.test} | 0 .../ThrowExpressions.test} | 0 .../ThrowStatements.test} | 0 .../TryStatements.test} | 0 .../TupleExpressions.test} | 0 .../TypeArgumentLists.test} | 0 .../TypeOfExpressions.test} | 0 .../TypeParameterConstraintClauses.test} | 0 .../UnaryMinusExpressions.test} | 0 .../UnaryPlusExpressions.test} | 0 .../UnsafeStatements.test} | 0 .../UsingDirectives.test} | 0 .../UsingStatements.test} | 0 .../VariableDeclarations.test} | 0 .../WhileStatements.test} | 0 .../WithExpressions.test} | 0 .../YieldReturnStatements.test} | 0 154 files changed, 14 insertions(+), 12 deletions(-) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AddressOfExpressions.cst => CSharp/AddressOfExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AliasQualifiedNames.cst => CSharp/AliasQualifiedNames.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AnonymousMethodExpressions.cst => CSharp/AnonymousMethodExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AnonymousObjectCreationExpressions.cst => CSharp/AnonymousObjectCreationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ArgumentLists.cst => CSharp/ArgumentLists.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ArrayCreationExpressions.cst => CSharp/ArrayCreationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AsExpressions.cst => CSharp/AsExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AssignmentExpressions.cst => CSharp/AssignmentExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AttributeListNewLines.expected.cst => CSharp/AttributeListNewLines.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AttributeListNewLines.cst => CSharp/AttributeListNewLines.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AttributeLists.cst => CSharp/AttributeLists.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AutoDashGenerated.cst => CSharp/AutoDashGenerated.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AutoGenerated.cst => CSharp/AutoGenerated.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{AwaitExpressions.cst => CSharp/AwaitExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{BaseExpressions.cst => CSharp/BaseExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{BinaryExpressions.cst => CSharp/BinaryExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore.expected.cst => CSharp/CSharpierIgnore.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore.cst => CSharp/CSharpierIgnore.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore_CompilationUnit.expected.cst => CSharp/CSharpierIgnore_CompilationUnit.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore_CompilationUnit.cst => CSharp/CSharpierIgnore_CompilationUnit.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore_Dont.expected.cst => CSharp/CSharpierIgnore_Dont.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore_Dont.cst => CSharp/CSharpierIgnore_Dont.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore_TopLevel.expected.cst => CSharp/CSharpierIgnore_TopLevel.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharpierIgnore_TopLevel.cst => CSharp/CSharpierIgnore_TopLevel.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CastExpressions.cst => CSharp/CastExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CheckedStatements.cst => CSharp/CheckedStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ClassDeclarations.cst => CSharp/ClassDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ClassDeclarations_EdgeCase.expected.cst => CSharp/ClassDeclarations_EdgeCase.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ClassDeclarations_EdgeCase.cst => CSharp/ClassDeclarations_EdgeCase.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ClassDeclarations_Tabs.cst => CSharp/ClassDeclarations_Tabs.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CloseBraceRemovesLines.expected.cst => CSharp/CloseBraceRemovesLines.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CloseBraceRemovesLines.cst => CSharp/CloseBraceRemovesLines.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CoalesceExpressions.cst => CSharp/CoalesceExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Comments.cst => CSharp/Comments.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Comments_EdgeCase.expected.cst => CSharp/Comments_EdgeCase.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Comments_EdgeCase.cst => CSharp/Comments_EdgeCase.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitAttributes.expected.cst => CSharp/CompilationUnitAttributes.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitAttributes.cst => CSharp/CompilationUnitAttributes.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase.cst => CSharp/CompilationUnitIfDirectiveEdgeCase.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase2.cst => CSharp/CompilationUnitIfDirectiveEdgeCase2.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase3.cst => CSharp/CompilationUnitIfDirectiveEdgeCase3.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase4.cst => CSharp/CompilationUnitIfDirectiveEdgeCase4.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase5.cst => CSharp/CompilationUnitIfDirectiveEdgeCase5.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase6.cst => CSharp/CompilationUnitIfDirectiveEdgeCase6.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CompilationUnitIfDirectiveEdgeCase7.cst => CSharp/CompilationUnitIfDirectiveEdgeCase7.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ConditionalAccessExpressions.cst => CSharp/ConditionalAccessExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ConditionalExpressions.cst => CSharp/ConditionalExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ConditionalExpressions_Tabs.cst => CSharp/ConditionalExpressions_Tabs.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ConstructorDeclarations.cst => CSharp/ConstructorDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ConversionOperatorDeclarations.cst => CSharp/ConversionOperatorDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{DeclarationExpressions.cst => CSharp/DeclarationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{DefaultExpressions.cst => CSharp/DefaultExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{DelegateDeclarations.cst => CSharp/DelegateDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{DestructorDeclarations.cst => CSharp/DestructorDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives.cst => CSharp/Directives.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives_AddAndRemoveLines.expected.cst => CSharp/Directives_AddAndRemoveLines.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives_AddAndRemoveLines.cst => CSharp/Directives_AddAndRemoveLines.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives_CompilationUnit.cst => CSharp/Directives_CompilationUnit.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives_FileScopedNamespace.cst => CSharp/Directives_FileScopedNamespace.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives_Namespace.cst => CSharp/Directives_Namespace.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{Directives_Regions.cst => CSharp/Directives_Regions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{DoStatements.cst => CSharp/DoStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ElementAccessExpressions.cst => CSharp/ElementAccessExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ElementBindingExpressions.cst => CSharp/ElementBindingExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ElseStatements.cst => CSharp/ElseStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EmptyLines.expected.cst => CSharp/EmptyLines.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EmptyLines.cst => CSharp/EmptyLines.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EnumDeclarationComments.expected.cst => CSharp/EnumDeclarationComments.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EnumDeclarationComments.cst => CSharp/EnumDeclarationComments.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EnumDeclarations.cst => CSharp/EnumDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EventDeclarations.cst => CSharp/EventDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{EventFieldDeclarations.cst => CSharp/EventFieldDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ExternAliasDirectives.cst => CSharp/ExternAliasDirectives.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FieldDeclarations.cst => CSharp/FieldDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FileEncoding_USC2LEBOM.cst => CSharp/FileEncoding_USC2LEBOM.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FileEncoding_UTF8.cst => CSharp/FileEncoding_UTF8.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FileEncoding_UTF8BOM.cst => CSharp/FileEncoding_UTF8BOM.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FileScopedNamespaceDeclaration.cst => CSharp/FileScopedNamespaceDeclaration.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FixedStatements.cst => CSharp/FixedStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ForEachStatements.cst => CSharp/ForEachStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ForEachVariableStatements.cst => CSharp/ForEachVariableStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ForStatements.cst => CSharp/ForStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{FunctionPointerTypes.cst => CSharp/FunctionPointerTypes.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{GlobalStatements.cst => CSharp/GlobalStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{IfStatements.cst => CSharp/IfStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ImplicitArrayCreationExpressions.cst => CSharp/ImplicitArrayCreationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ImplicitElementAccesses.cst => CSharp/ImplicitElementAccesses.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ImplicitStackAllocArrayCreationExpressions.cst => CSharp/ImplicitStackAllocArrayCreationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{IndexerDeclarations.cst => CSharp/IndexerDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{InitializerExpressions.cst => CSharp/InitializerExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{InterfaceDeclarations.cst => CSharp/InterfaceDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{InterpolatedStringExpressions.cst => CSharp/InterpolatedStringExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{InvocationExpressions.cst => CSharp/InvocationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{IsExpressions.cst => CSharp/IsExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{IsPatternExpressions.cst => CSharp/IsPatternExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{LabeledStatements.cst => CSharp/LabeledStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ListPatterns.cst => CSharp/ListPatterns.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{LocalDeclarationStatements.cst => CSharp/LocalDeclarationStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{LocalFunctionStatements.cst => CSharp/LocalFunctionStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{LockStatements.cst => CSharp/LockStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{MakeRefExpressions.cst => CSharp/MakeRefExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{MemberAccessExpressions.cst => CSharp/MemberAccessExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{MemberLines.expected.cst => CSharp/MemberLines.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{MemberLines.cst => CSharp/MemberLines.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{MethodDeclarations.cst => CSharp/MethodDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{NamespaceDeclarations.cst => CSharp/NamespaceDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{NullableTypes.cst => CSharp/NullableTypes.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ObjectCreationExpressions.cst => CSharp/ObjectCreationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ObnoxiousEdgeCases.cst => CSharp/ObnoxiousEdgeCases.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{OperatorDeclarations.cst => CSharp/OperatorDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ParenthesizedExpressions.cst => CSharp/ParenthesizedExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ParenthesizedLambdaExpressions.cst => CSharp/ParenthesizedLambdaExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ParenthesizedVariableDesignations.cst => CSharp/ParenthesizedVariableDesignations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{PostIncrementExpressions.cst => CSharp/PostIncrementExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{PreIncrementExpressions.cst => CSharp/PreIncrementExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{PreprocessorSymbols.expected.cst => CSharp/PreprocessorSymbols.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{PreprocessorSymbols.cst => CSharp/PreprocessorSymbols.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{PreprocessorSymbols_KeepNewIines.cst => CSharp/PreprocessorSymbols_KeepNewIines.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{PropertyDeclarations.cst => CSharp/PropertyDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{QueryExpressions.cst => CSharp/QueryExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{QueryExpressions_RemoveSpaces.expected.cst => CSharp/QueryExpressions_RemoveSpaces.expected.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{QueryExpressions_RemoveSpaces.cst => CSharp/QueryExpressions_RemoveSpaces.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{RangeExpressions.cst => CSharp/RangeExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{RecordDeclarations.cst => CSharp/RecordDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{RefExpressions.cst => CSharp/RefExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{RefTypes.cst => CSharp/RefTypes.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ReturnStatements.cst => CSharp/ReturnStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{SimpleLambdaExpressions.cst => CSharp/SimpleLambdaExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{StackAllocArrayCreationExpressions.cst => CSharp/StackAllocArrayCreationExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{StringLiterals.cst => CSharp/StringLiterals.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{StructDeclarations.cst => CSharp/StructDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{SwitchExpressions.cst => CSharp/SwitchExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{SwitchExpressions_Tabs.cst => CSharp/SwitchExpressions_Tabs.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{SwitchStatements.cst => CSharp/SwitchStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ThrowExpressions.cst => CSharp/ThrowExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{ThrowStatements.cst => CSharp/ThrowStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{TryStatements.cst => CSharp/TryStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{TupleExpressions.cst => CSharp/TupleExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{TypeArgumentLists.cst => CSharp/TypeArgumentLists.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{TypeOfExpressions.cst => CSharp/TypeOfExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{TypeParameterConstraintClauses.cst => CSharp/TypeParameterConstraintClauses.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{UnaryMinusExpressions.cst => CSharp/UnaryMinusExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{UnaryPlusExpressions.cst => CSharp/UnaryPlusExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{UnsafeStatements.cst => CSharp/UnsafeStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{UsingDirectives.cst => CSharp/UsingDirectives.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{UsingStatements.cst => CSharp/UsingStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{VariableDeclarations.cst => CSharp/VariableDeclarations.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{WhileStatements.cst => CSharp/WhileStatements.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{WithExpressions.cst => CSharp/WithExpressions.test} (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{YieldReturnStatements.cst => CSharp/YieldReturnStatements.test} (100%) diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs index 3672043a7..deea73383 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs @@ -15,15 +15,16 @@ protected override object GetModel(GeneratorExecutionContext context) var tests = context.AdditionalFiles .Where( o => - o.Path.EndsWith(".cst") - && !o.Path.EndsWith(".actual.cst") - && !o.Path.EndsWith(".expected.cst") + o.Path.EndsWith(".test") + && !o.Path.EndsWith(".actual.test") + && !o.Path.EndsWith(".expected.test") ) .Select( o => new { Name = Path.GetFileNameWithoutExtension(o.Path), + Type = new FileInfo(o.Path).Directory.Name, UseTabs = Path.GetFileNameWithoutExtension(o.Path).EndsWith("_Tabs") } ); diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt index 4977f33a9..3b66f17ad 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt @@ -10,7 +10,7 @@ namespace CSharpier.Tests.FormattingTests [Test] public void {{ test.Name }}() { - this.RunTest("{{ test.Name }}"{{ if test.UseTabs }}, true{{ end }}); + this.RunTest("{{ test.Name }}", "{{ test.Type }}"{{ if test.UseTabs }}, true{{ end }}); } {{- end }} } diff --git a/Src/CSharpier.Tests/CSharpier.Tests.csproj b/Src/CSharpier.Tests/CSharpier.Tests.csproj index f73a005bb..cafce0e3e 100644 --- a/Src/CSharpier.Tests/CSharpier.Tests.csproj +++ b/Src/CSharpier.Tests/CSharpier.Tests.csproj @@ -17,14 +17,14 @@ - + - - $([System.String]::Copy(%(Filename)).Replace('.actual', '.cst')) + + $([System.String]::Copy(%(Filename)).Replace('.actual', '.test')) - - $([System.String]::Copy(%(Filename)).Replace('.expected', '.cst')) + + $([System.String]::Copy(%(Filename)).Replace('.expected', '.test')) diff --git a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs index 4efdca91e..be2430413 100644 --- a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs +++ b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs @@ -11,13 +11,14 @@ public class BaseTest { private readonly DirectoryInfo rootDirectory = DirectoryFinder.FindParent("CSharpier.Tests"); - protected void RunTest(string fileName, bool useTabs = false) + protected void RunTest(string fileName, string type, bool useTabs = false) { var filePath = Path.Combine( this.rootDirectory.FullName, "FormattingTests", "TestFiles", - fileName + ".cst" + type, + fileName + ".test" ); var fileReaderResult = FileReader .ReadFile(filePath, new FileSystem(), CancellationToken.None) @@ -30,7 +31,7 @@ protected void RunTest(string fileName, bool useTabs = false) new PrinterOptions { Width = PrinterOptions.WidthUsedByTests, UseTabs = useTabs } ); - var actualFilePath = filePath.Replace(".cst", ".actual.cst"); + var actualFilePath = filePath.Replace(".test", ".actual.test"); File.WriteAllText(actualFilePath, result.Code, fileReaderResult.Encoding); var filePathToChange = filePath; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AddressOfExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AddressOfExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AliasQualifiedNames.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AliasQualifiedNames.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AnonymousMethodExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AnonymousMethodExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AnonymousObjectCreationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AnonymousObjectCreationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ArgumentLists.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ArgumentLists.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ArrayCreationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ArrayCreationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AsExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AsExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AssignmentExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AssignmentExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AttributeListNewLines.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AttributeListNewLines.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AttributeListNewLines.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AttributeListNewLines.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AttributeLists.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AttributeLists.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AutoDashGenerated.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AutoDashGenerated.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AutoGenerated.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AutoGenerated.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/AwaitExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/AwaitExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/BaseExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/BaseExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/BinaryExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/BinaryExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_CompilationUnit.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_CompilationUnit.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_CompilationUnit.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_CompilationUnit.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_Dont.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_Dont.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_Dont.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_Dont.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_TopLevel.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_TopLevel.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_TopLevel.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_TopLevel.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CastExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CastExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CheckedStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CheckedStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations_EdgeCase.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations_EdgeCase.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations_EdgeCase.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations_EdgeCase.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations_Tabs.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ClassDeclarations_Tabs.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CloseBraceRemovesLines.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CloseBraceRemovesLines.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CloseBraceRemovesLines.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CloseBraceRemovesLines.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CoalesceExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CoalesceExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Comments.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Comments.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Comments_EdgeCase.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Comments_EdgeCase.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Comments_EdgeCase.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Comments_EdgeCase.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitAttributes.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitAttributes.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitAttributes.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitAttributes.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase2.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase2.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase3.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase3.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase4.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase4.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase5.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase5.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase6.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase6.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase7.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CompilationUnitIfDirectiveEdgeCase7.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ConditionalAccessExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ConditionalAccessExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ConditionalExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ConditionalExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ConditionalExpressions_Tabs.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ConditionalExpressions_Tabs.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ConstructorDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ConstructorDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ConversionOperatorDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ConversionOperatorDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/DeclarationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/DeclarationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/DefaultExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/DefaultExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/DelegateDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/DelegateDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/DestructorDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/DestructorDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_AddAndRemoveLines.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_AddAndRemoveLines.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_AddAndRemoveLines.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_AddAndRemoveLines.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_CompilationUnit.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_CompilationUnit.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_FileScopedNamespace.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_FileScopedNamespace.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_Namespace.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_Namespace.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_Regions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_Regions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/DoStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/DoStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ElementAccessExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ElementAccessExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ElementBindingExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ElementBindingExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ElseStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ElseStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EmptyLines.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EmptyLines.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EmptyLines.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EmptyLines.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EnumDeclarationComments.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EnumDeclarationComments.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EnumDeclarationComments.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EnumDeclarationComments.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EnumDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EnumDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EventDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EventDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/EventFieldDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/EventFieldDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ExternAliasDirectives.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ExternAliasDirectives.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FieldDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FieldDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FileEncoding_USC2LEBOM.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FileEncoding_USC2LEBOM.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FileEncoding_UTF8.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FileEncoding_UTF8.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FileEncoding_UTF8BOM.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FileEncoding_UTF8BOM.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FileScopedNamespaceDeclaration.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FileScopedNamespaceDeclaration.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FixedStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FixedStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ForEachStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ForEachStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ForEachVariableStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ForEachVariableStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ForStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ForStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/FunctionPointerTypes.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/FunctionPointerTypes.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/GlobalStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/GlobalStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/IfStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/IfStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ImplicitArrayCreationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ImplicitArrayCreationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ImplicitElementAccesses.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ImplicitElementAccesses.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ImplicitStackAllocArrayCreationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ImplicitStackAllocArrayCreationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/IndexerDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/IndexerDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/InitializerExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/InitializerExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/InterfaceDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/InterfaceDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/InterpolatedStringExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/InterpolatedStringExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/InvocationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/InvocationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/IsExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/IsExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/IsPatternExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/IsPatternExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/LabeledStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/LabeledStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ListPatterns.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ListPatterns.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/LocalDeclarationStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/LocalDeclarationStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/LocalFunctionStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/LocalFunctionStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/LockStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/LockStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/MakeRefExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/MakeRefExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/MemberAccessExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/MemberAccessExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/MemberLines.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/MemberLines.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/MemberLines.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/MemberLines.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/MethodDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/MethodDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/NamespaceDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/NamespaceDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/NullableTypes.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/NullableTypes.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ObjectCreationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ObjectCreationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ObnoxiousEdgeCases.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ObnoxiousEdgeCases.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/OperatorDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/OperatorDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ParenthesizedExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ParenthesizedExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ParenthesizedLambdaExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ParenthesizedLambdaExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ParenthesizedVariableDesignations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ParenthesizedVariableDesignations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/PostIncrementExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/PostIncrementExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/PreIncrementExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/PreIncrementExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/PreprocessorSymbols.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/PreprocessorSymbols.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/PreprocessorSymbols.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/PreprocessorSymbols.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/PreprocessorSymbols_KeepNewIines.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/PreprocessorSymbols_KeepNewIines.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/PropertyDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/PropertyDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions_RemoveSpaces.expected.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions_RemoveSpaces.expected.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions_RemoveSpaces.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions_RemoveSpaces.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/RangeExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/RangeExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/RecordDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/RecordDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/RefExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/RefExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/RefTypes.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/RefTypes.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ReturnStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ReturnStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/SimpleLambdaExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/SimpleLambdaExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/StackAllocArrayCreationExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/StackAllocArrayCreationExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/StringLiterals.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/StringLiterals.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/StructDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/StructDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/SwitchExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/SwitchExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/SwitchExpressions_Tabs.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/SwitchExpressions_Tabs.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/SwitchStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/SwitchStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ThrowExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ThrowExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/ThrowStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/ThrowStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/TryStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/TryStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/TupleExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/TupleExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/TypeArgumentLists.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/TypeArgumentLists.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/TypeOfExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/TypeOfExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/TypeParameterConstraintClauses.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/TypeParameterConstraintClauses.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/UnaryMinusExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/UnaryMinusExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/UnaryPlusExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/UnaryPlusExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/UnsafeStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/UnsafeStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/UsingDirectives.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/UsingDirectives.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/UsingStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/UsingStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/VariableDeclarations.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/VariableDeclarations.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/WhileStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/WhileStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/WithExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/WithExpressions.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/YieldReturnStatements.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/YieldReturnStatements.cst rename to Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.test From ee131148652224fb376a0536e0280d3c40cbe31f Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 10:45:50 -0500 Subject: [PATCH 02/21] Making some changes so that adding more file types is easier to test --- .../ClientApp/package-lock.json | 3339 ++++++++++++++++- .../FormattingTestsGenerator.cs | 2 +- .../FormattingTests/SetUpFixture.cs | 2 +- .../CSharp/AddressOfExpressions.actual.test | 9 + .../CSharp/AliasQualifiedNames.actual.test | 7 + .../AnonymousMethodExpressions.actual.test | 34 + ...ymousObjectCreationExpressions.actual.test | 18 + .../CSharp/ArgumentLists.actual.test | 9 + .../ArrayCreationExpressions.actual.test | 22 + .../CSharp/AsExpressions.actual.test | 7 + .../CSharp/AssignmentExpressions.actual.test | 86 + .../CSharp/AttributeListNewLines.actual.test | 12 + .../CSharp/AttributeLists.actual.test | 114 + .../CSharp/AutoDashGenerated.actual.test | 26 + .../CSharp/AutoGenerated.actual.test | 4 + .../CSharp/AwaitExpressions.actual.test | 7 + .../CSharp/BaseExpressions.actual.test | 7 + .../CSharp/BinaryExpressions.actual.test | 219 ++ .../CSharp/CSharpierIgnore.actual.test | 148 + ...SharpierIgnore_CompilationUnit.actual.test | 8 + .../CSharp/CSharpierIgnore_Dont.actual.test | 20 + .../CSharpierIgnore_TopLevel.actual.test | 19 + .../CSharp/CastExpressions.actual.test | 45 + .../CSharp/CheckedStatements.actual.test | 21 + .../CSharp/ClassDeclarations.actual.test | 61 + .../ClassDeclarations_EdgeCase.actual.test | 3 + .../CSharp/ClassDeclarations_Tabs.actual.test | 59 + .../CSharp/CloseBraceRemovesLines.actual.test | 7 + .../CSharp/CoalesceExpressions.actual.test | 4 + .../TestFiles/CSharp/Comments.actual.test | 105 + .../CSharp/Comments_EdgeCase.actual.test | 51 + .../CompilationUnitAttributes.actual.test | 6 + ...ilationUnitIfDirectiveEdgeCase.actual.test | 10 + ...lationUnitIfDirectiveEdgeCase2.actual.test | 12 + ...lationUnitIfDirectiveEdgeCase3.actual.test | 6 + ...lationUnitIfDirectiveEdgeCase4.actual.test | 6 + ...lationUnitIfDirectiveEdgeCase5.actual.test | 6 + ...lationUnitIfDirectiveEdgeCase6.actual.test | 5 + ...lationUnitIfDirectiveEdgeCase7.actual.test | 8 + .../ConditionalAccessExpressions.actual.test | 7 + .../CSharp/ConditionalExpressions.actual.test | 143 + .../ConditionalExpressions_Tabs.actual.test | 143 + .../ConstructorDeclarations.actual.test | 130 + ...ConversionOperatorDeclarations.actual.test | 23 + .../CSharp/DeclarationExpressions.actual.test | 7 + .../CSharp/DefaultExpressions.actual.test | 7 + .../CSharp/DelegateDeclarations.actual.test | 7 + .../CSharp/DestructorDeclarations.actual.test | 5 + .../TestFiles/CSharp/Directives.actual.test | 99 + .../Directives_AddAndRemoveLines.actual.test | 75 + .../Directives_CompilationUnit.actual.test | 19 + ...Directives_FileScopedNamespace.actual.test | 15 + .../CSharp/Directives_Namespace.actual.test | 16 + .../CSharp/Directives_Regions.actual.test | 42 + .../TestFiles/CSharp/DoStatements.actual.test | 22 + .../ElementAccessExpressions.actual.test | 5 + .../ElementBindingExpressions.actual.test | 7 + .../CSharp/ElseStatements.actual.test | 35 + .../TestFiles/CSharp/EmptyLines.actual.test | 26 + .../EnumDeclarationComments.actual.test | 21 + .../CSharp/EnumDeclarations.actual.test | 13 + .../CSharp/EventDeclarations.actual.test | 13 + .../CSharp/EventFieldDeclarations.actual.test | 4 + .../CSharp/ExternAliasDirectives.actual.test | 15 + .../CSharp/FieldDeclarations.actual.test | 116 + .../CSharp/FileEncoding_USC2LEBOM.actual.test | Bin 0 -> 130 bytes .../CSharp/FileEncoding_UTF8.actual.test | 10 + .../CSharp/FileEncoding_UTF8BOM.actual.test | 10 + ...FileScopedNamespaceDeclaration.actual.test | 7 + .../CSharp/FixedStatements.actual.test | 45 + .../CSharp/ForEachStatements.actual.test | 123 + .../ForEachVariableStatements.actual.test | 10 + .../CSharp/ForStatements.actual.test | 104 + .../CSharp/FunctionPointerTypes.actual.test | 26 + .../CSharp/GlobalStatements.actual.test | 10 + .../TestFiles/CSharp/IfStatements.actual.test | 82 + ...plicitArrayCreationExpressions.actual.test | 36 + .../ImplicitElementAccesses.actual.test | 10 + ...kAllocArrayCreationExpressions.actual.test | 7 + .../CSharp/IndexerDeclarations.actual.test | 4 + .../CSharp/InitializerExpressions.actual.test | 242 ++ .../CSharp/InterfaceDeclarations.actual.test | 14 + .../InterpolatedStringExpressions.actual.test | 28 + .../CSharp/InvocationExpressions.actual.test | 242 ++ .../CSharp/IsExpressions.actual.test | 7 + .../CSharp/IsPatternExpressions.actual.test | 242 ++ .../CSharp/LabeledStatements.actual.test | 8 + .../TestFiles/CSharp/ListPatterns.actual.test | 21 + .../LocalDeclarationStatements.actual.test | 9 + .../LocalFunctionStatements.actual.test | 20 + .../CSharp/LockStatements.actual.test | 13 + .../CSharp/MakeRefExpressions.actual.test | 7 + .../MemberAccessExpressions.actual.test | 17 + .../TestFiles/CSharp/MemberLines.actual.test | 160 + .../CSharp/MethodDeclarations.actual.test | 124 + .../CSharp/NamespaceDeclarations.actual.test | 20 + .../CSharp/NullableTypes.actual.test | 4 + .../ObjectCreationExpressions.actual.test | 43 + .../CSharp/ObnoxiousEdgeCases.actual.test | 162 + .../CSharp/OperatorDeclarations.actual.test | 21 + .../ParenthesizedExpressions.actual.test | 16 + ...ParenthesizedLambdaExpressions.actual.test | 91 + ...enthesizedVariableDesignations.actual.test | 12 + .../PostIncrementExpressions.actual.test | 7 + .../PreIncrementExpressions.actual.test | 7 + .../CSharp/PreprocessorSymbols.actual.test | 52 + ...eprocessorSymbols_KeepNewIines.actual.test | 17 + .../CSharp/PropertyDeclarations.actual.test | 105 + .../CSharp/QueryExpressions.actual.test | 102 + .../QueryExpressions_RemoveSpaces.actual.test | 14 + .../CSharp/RangeExpressions.actual.test | 14 + .../CSharp/RecordDeclarations.actual.test | 53 + .../CSharp/RefExpressions.actual.test | 7 + .../TestFiles/CSharp/RefTypes.actual.test | 7 + .../CSharp/ReturnStatements.actual.test | 25 + .../SimpleLambdaExpressions.actual.test | 25 + ...kAllocArrayCreationExpressions.actual.test | 10 + .../CSharp/StringLiterals.actual.test | 165 + .../CSharp/StructDeclarations.actual.test | 3 + .../CSharp/SwitchExpressions.actual.test | 92 + .../CSharp/SwitchExpressions_Tabs.actual.test | 92 + .../CSharp/SwitchStatements.actual.test | 116 + .../CSharp/ThrowExpressions.actual.test | 7 + .../CSharp/ThrowStatements.actual.test | 7 + .../CSharp/TryStatements.actual.test | 59 + .../CSharp/TupleExpressions.actual.test | 53 + .../CSharp/TypeArgumentLists.actual.test | 4 + .../CSharp/TypeOfExpressions.actual.test | 7 + ...TypeParameterConstraintClauses.actual.test | 89 + .../CSharp/UnaryMinusExpressions.actual.test | 4 + .../CSharp/UnaryPlusExpressions.actual.test | 4 + .../CSharp/UnsafeStatements.actual.test | 10 + .../CSharp/UsingDirectives.actual.test | 28 + .../CSharp/UsingStatements.actual.test | 70 + .../CSharp/VariableDeclarations.actual.test | 184 + .../CSharp/WhileStatements.actual.test | 58 + .../CSharp/WithExpressions.actual.test | 14 + .../CSharp/YieldReturnStatements.actual.test | 8 + 138 files changed, 9062 insertions(+), 13 deletions(-) create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.actual.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.actual.test diff --git a/Src/CSharpier.Playground/ClientApp/package-lock.json b/Src/CSharpier.Playground/ClientApp/package-lock.json index c4909115f..22acf3ded 100644 --- a/Src/CSharpier.Playground/ClientApp/package-lock.json +++ b/Src/CSharpier.Playground/ClientApp/package-lock.json @@ -1,8 +1,3315 @@ { "name": "playground", "version": "0.1.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "playground", + "version": "0.1.0", + "dependencies": { + "@babel/core": "7.18.2", + "@types/codemirror": "5.60.5", + "@types/react": "16.14.2", + "@types/react-dom": "16.9.10", + "@types/react-router-dom": "5.1.7", + "@vitejs/plugin-react": "1.3.2", + "codemirror": "5.65.4", + "prettier": "2.2.1", + "react": "16.14.0", + "react-codemirror2": "7.2.1", + "react-dom": "16.14.0", + "react-json-view": "1.21.3", + "react-router-dom": "5.2.0", + "rimraf": "3.0.2", + "sass": "^1.52.1", + "typescript": "4.1.3", + "vite": "2.9.9", + "vite-plugin-svgr": "2.1.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dependencies": { + "@babel/highlight": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz", + "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.2.tgz", + "integrity": "sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ==", + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-compilation-targets": "^7.18.2", + "@babel/helper-module-transforms": "^7.18.0", + "@babel/helpers": "^7.18.2", + "@babel/parser": "^7.18.0", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", + "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", + "dependencies": { + "@babel/types": "^7.18.2", + "@jridgewell/gen-mapping": "^0.3.0", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz", + "integrity": "sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ==", + "dependencies": { + "@babel/compat-data": "^7.17.10", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.20.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz", + "integrity": "sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.0", + "@babel/types": "^7.18.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz", + "integrity": "sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ==", + "dependencies": { + "@babel/types": "^7.18.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.2.tgz", + "integrity": "sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg==", + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.3.tgz", + "integrity": "sha512-rL50YcEuHbbauAFAysNsJA4/f89fGTOBRNs9P81sniKnKAr4xULe5AecolcsKbi88xu0ByWYDj/S1AJ3FSFuSQ==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz", + "integrity": "sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.7.tgz", + "integrity": "sha512-8D16ye66fxiE8m890w0BpPpngG9o9OVBBy0gH2E+2AR7qMR2ZpTYJEqLxAsoroenMId0p/wMW+Blc0meDgu0Ag==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.16.7.tgz", + "integrity": "sha512-RMvQWvpla+xy6MlBpPlrKZCMRs2AGiHOGHY3xRwl0pEeim348dDyxeH4xBsMPbIMhujeq7ihE702eM2Ew0Wo+A==", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.17.12.tgz", + "integrity": "sha512-7S9G2B44EnYOx74mue02t1uD8ckWZ/ee6Uz/qfdzc35uWHX5NgRy9i+iJSb2LFRgMd+QV9zNcStQaazzzZ3n3Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.17.12" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self/node_modules/@babel/helper-plugin-utils": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz", + "integrity": "sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.16.7.tgz", + "integrity": "sha512-rONFiQz9vgbsnaMtQlZCjIRwhJvlrPET8TabIUK2hzlXw9B9s2Ieaxte1SCOOXMbWRHodbKixNf3BLcWVOQ8Bw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/helper-annotate-as-pure": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/types": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", + "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz", + "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-environment-visitor": "^7.18.2", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.18.0", + "@babel/types": "^7.18.2", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/helper-environment-visitor": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz", + "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.2.tgz", + "integrity": "sha512-0On6B8A4/+mFUto5WERt3EEuG1NznDirvwca1O8UwXQHVY8g3R7OzYgxXdOfMwLO08UrpUD/2+3Bclyq+/C94Q==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", + "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@types/codemirror": { + "version": "5.60.5", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.5.tgz", + "integrity": "sha512-TiECZmm8St5YxjFUp64LK0c8WU5bxMDt9YaAek1UqUb9swrSCoJhh92fWu1p3mTEqlHjhB5sY7OFBhWroJXZVg==", + "dependencies": { + "@types/tern": "*" + } + }, + "node_modules/@types/estree": { + "version": "0.0.51", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", + "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==" + }, + "node_modules/@types/history": { + "version": "4.7.9", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.9.tgz", + "integrity": "sha512-MUc6zSmU3tEVnkQ78q0peeEjKWPUADMlC/t++2bI8WnAG2tvYRPIgHG8lWkXwqc8MsUF6Z2MOf+Mh5sazOmhiQ==" + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" + }, + "node_modules/@types/prop-types": { + "version": "15.7.4", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz", + "integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==" + }, + "node_modules/@types/react": { + "version": "16.14.2", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.2.tgz", + "integrity": "sha512-BzzcAlyDxXl2nANlabtT4thtvbbnhee8hMmH/CcJrISDBVcJS1iOsP1f0OAgSdGE0MsY9tqcrb9YoZcOFv9dbQ==", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "16.9.10", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.10.tgz", + "integrity": "sha512-ItatOrnXDMAYpv6G8UCk2VhbYVTjZT9aorLtA/OzDN9XJ2GKcfam68jutoAcILdRjsRUO8qb7AmyObF77Q8QFw==", + "dependencies": { + "@types/react": "^16" + } + }, + "node_modules/@types/react-router": { + "version": "5.1.17", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.17.tgz", + "integrity": "sha512-RNSXOyb3VyRs/EOGmjBhhGKTbnN6fHWvy5FNLzWfOWOGjgVUKqJZXfpKzLmgoU8h6Hj8mpALj/mbXQASOb92wQ==", + "dependencies": { + "@types/history": "*", + "@types/react": "*" + } + }, + "node_modules/@types/react-router-dom": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.7.tgz", + "integrity": "sha512-D5mHD6TbdV/DNHYsnwBTv+y73ei+mMjrkGrla86HthE4/PVvL1J94Bu3qABU+COXzpL23T1EZapVVpwHuBXiUg==", + "dependencies": { + "@types/history": "*", + "@types/react": "*", + "@types/react-router": "*" + } + }, + "node_modules/@types/tern": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.4.tgz", + "integrity": "sha512-JAUw1iXGO1qaWwEOzxTKJZ/5JxVeON9kvGZ/osgZaJImBnyjyn0cjovPsf6FNLmyGY8Vw9DoXZCMlfMkMwHRWg==", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-1.3.2.tgz", + "integrity": "sha512-aurBNmMo0kz1O4qRoY+FM4epSA39y3ShWGuqfLRA/3z0oEJAdtoSfgA3aO98/PCCHAqMaduLxIxErWrVKIFzXA==", + "dependencies": { + "@babel/core": "^7.17.10", + "@babel/plugin-transform-react-jsx": "^7.17.3", + "@babel/plugin-transform-react-jsx-development": "^7.16.7", + "@babel/plugin-transform-react-jsx-self": "^7.16.7", + "@babel/plugin-transform-react-jsx-source": "^7.16.7", + "@rollup/pluginutils": "^4.2.1", + "react-refresh": "^0.13.0", + "resolve": "^1.22.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/compat-data": { + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz", + "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/core": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.2.tgz", + "integrity": "sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ==", + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-compilation-targets": "^7.18.2", + "@babel/helper-module-transforms": "^7.18.0", + "@babel/helpers": "^7.18.2", + "@babel/parser": "^7.18.0", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/generator": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", + "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", + "dependencies": { + "@babel/types": "^7.18.2", + "@jridgewell/gen-mapping": "^0.3.0", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-annotate-as-pure": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-compilation-targets": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz", + "integrity": "sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ==", + "dependencies": { + "@babel/compat-data": "^7.17.10", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.20.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-function-name": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-module-transforms": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz", + "integrity": "sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.0", + "@babel/types": "^7.18.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-plugin-utils": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz", + "integrity": "sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-simple-access": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz", + "integrity": "sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ==", + "dependencies": { + "@babel/types": "^7.18.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/helpers": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.2.tgz", + "integrity": "sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg==", + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/parser": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.3.tgz", + "integrity": "sha512-rL50YcEuHbbauAFAysNsJA4/f89fGTOBRNs9P81sniKnKAr4xULe5AecolcsKbi88xu0ByWYDj/S1AJ3FSFuSQ==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/plugin-syntax-jsx": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.17.12.tgz", + "integrity": "sha512-spyY3E3AURfxh/RHtjx5j6hs8am5NbUBGfcZ2vB3uShSpZdQyXSf5rR5Mk76vbtlAZOelyVQ71Fg0x9SG4fsog==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.17.12" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.17.12.tgz", + "integrity": "sha512-Lcaw8bxd1DKht3thfD4A12dqo1X16he1Lm8rIv8sTwjAYNInRS1qHa9aJoqvzpscItXvftKDCfaEQzwoVyXpEQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.17.12", + "@babel/plugin-syntax-jsx": "^7.17.12", + "@babel/types": "^7.17.12" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/traverse": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz", + "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-environment-visitor": "^7.18.2", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.18.0", + "@babel/types": "^7.18.2", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/traverse/node_modules/@babel/helper-environment-visitor": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz", + "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@babel/types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.2.tgz", + "integrity": "sha512-0On6B8A4/+mFUto5WERt3EEuG1NznDirvwca1O8UwXQHVY8g3R7OzYgxXdOfMwLO08UrpUD/2+3Bclyq+/C94Q==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/browserslist": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz", + "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001332", + "electron-to-chromium": "^1.4.118", + "escalade": "^3.1.1", + "node-releases": "^2.0.3", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/caniuse-lite": { + "version": "1.0.30001344", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001344.tgz", + "integrity": "sha512-0ZFjnlCaXNOAYcV7i+TtdKBp0L/3XEU2MF/x6Du1lrh+SRX4IfzIVL4HNJg5pB2PmFb8rszIGyOvsZnqqRoc2g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] + }, + "node_modules/@vitejs/plugin-react/node_modules/electron-to-chromium": { + "version": "1.4.141", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.141.tgz", + "integrity": "sha512-mfBcbqc0qc6RlxrsIgLG2wCqkiPAjEezHxGTu7p3dHHFOurH4EjS9rFZndX5axC8264rI1Pcbw8uQP39oZckeA==" + }, + "node_modules/@vitejs/plugin-react/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/@vitejs/plugin-react/node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/node-releases": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==" + }, + "node_modules/@vitejs/plugin-react/node_modules/react-refresh": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.13.0.tgz", + "integrity": "sha512-XP8A9BT0CpRBD+NYLLeIhld/RqG9+gktUjW1FkE+Vm7OCinbG1SshcK5tb9ls4kzvjZr9mOQc7HYgBngEyPAXg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dependencies": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base16": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base16/-/base16-1.0.0.tgz", + "integrity": "sha1-4pf2DX7BAUp6lxo568ipjAtoHnA=" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz", + "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001332", + "electron-to-chromium": "^1.4.118", + "escalade": "^3.1.1", + "node-releases": "^2.0.3", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001344", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001344.tgz", + "integrity": "sha512-0ZFjnlCaXNOAYcV7i+TtdKBp0L/3XEU2MF/x6Du1lrh+SRX4IfzIVL4HNJg5pB2PmFb8rszIGyOvsZnqqRoc2g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/codemirror": { + "version": "5.65.4", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.4.tgz", + "integrity": "sha512-tytrSm5Rh52b6j36cbDXN+FHwHCl9aroY4BrDZB2NFFL3Wjfq9nuYVLFFhaOYOczKAg3JXTr8BuT8LcE5QY4Iw==" + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/cosmiconfig": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", + "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dependencies": { + "node-fetch": "2.6.7" + } + }, + "node_modules/csstype": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.9.tgz", + "integrity": "sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw==" + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.141", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.141.tgz", + "integrity": "sha512-mfBcbqc0qc6RlxrsIgLG2wCqkiPAjEezHxGTu7p3dHHFOurH4EjS9rFZndX5axC8264rI1Pcbw8uQP39oZckeA==" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/esbuild": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.41.tgz", + "integrity": "sha512-uZl2CH5nwayLPi1Unhfk+vBBjD3FDlYQ+v24qAlj2oZMYQP8pFs1k3DK5ViD+keF3JnuV4K7JtqVvBmTDwVEbA==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.41", + "esbuild-android-arm64": "0.14.41", + "esbuild-darwin-64": "0.14.41", + "esbuild-darwin-arm64": "0.14.41", + "esbuild-freebsd-64": "0.14.41", + "esbuild-freebsd-arm64": "0.14.41", + "esbuild-linux-32": "0.14.41", + "esbuild-linux-64": "0.14.41", + "esbuild-linux-arm": "0.14.41", + "esbuild-linux-arm64": "0.14.41", + "esbuild-linux-mips64le": "0.14.41", + "esbuild-linux-ppc64le": "0.14.41", + "esbuild-linux-riscv64": "0.14.41", + "esbuild-linux-s390x": "0.14.41", + "esbuild-netbsd-64": "0.14.41", + "esbuild-openbsd-64": "0.14.41", + "esbuild-sunos-64": "0.14.41", + "esbuild-windows-32": "0.14.41", + "esbuild-windows-64": "0.14.41", + "esbuild-windows-arm64": "0.14.41" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.41.tgz", + "integrity": "sha512-byyo8LPOGHzAqxbwh2Q72d7L+rXXTsr/KALjsiCySrJ60CGMe80i3bwoQ+WODxsGaH08R//yg5oc7xHKgQz4uw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.41.tgz", + "integrity": "sha512-7koo9Dm/mwK4M8PGQX8JQRc4UQ4Wj7DT1nD4BQkVs2jxtHbYOlnsQH0fneKSXZVmnBIHYcntr/e1VU5gnYLvGQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.41.tgz", + "integrity": "sha512-kW8fC2auh9jjmBXudTmlMfbBCMYMuujhxG40CxMhKiQ8NLBK4RU9yUYY6ss7QJp24kVTtKd4IvfwOio9SE53MA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.41.tgz", + "integrity": "sha512-cO0EPkiQt0bERH9sZFIoTywWfGhEpshdpvQpDfLh/ZJLeioQfaarM9YDrmID+f7k77djh0mdyfsC6XpS0HlLsw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.41.tgz", + "integrity": "sha512-6tsMDK6b7czCOjsr68BgVogFXcTCWL3T7yFXRFuAmXwY9ybYgX8sybD7ztrRB03dLAPeMxHo+PzeMD6LdVrLdQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.41.tgz", + "integrity": "sha512-AQ2S/VCLKVBe/+HNiFLyp3w9i7AEtCOWEzKHSkfHk0VO5bPzHd7WJfWmj1Bxliu7vdPESbiDUTJIH3rDt4bzSA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.41.tgz", + "integrity": "sha512-sb7Kah5Px6BNZ6gzm0nJLuDeAJKbIlaKIoI9zgZ5dFDxZSn91TMAHJz5W39YDJ8+ZaGJYIdqZSpDo+4G769mZw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.41.tgz", + "integrity": "sha512-PeI0bfbv+5ondZRhPRszptp3RQRRAPxpOB2CYDphKske5+UlCXPi4Af+T++OqhV5TEpymTfxJdJQ1sn1w32coA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.41.tgz", + "integrity": "sha512-8DQ6Sv3XNwgu0cnPA3q+kJSqfOYLDqWzpW8dPF+/Or23bS/5EIT/CzN73uIhR8A3AokXIczn88VKti7Xtv+V2g==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.41.tgz", + "integrity": "sha512-aAhBX6kVG8hTVuANE90ORobioHdpZLzy8Fibf4XBuG4IuJfjgM5N4wFIq2Tpd+Ykit432PL/YOQhZ4W6nVc4cQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.41.tgz", + "integrity": "sha512-88xo4FRYQ2laMJnrqZu8j5q531XT/odZnhO5NLWO/NdweIdT8F+QL0fNIBIf+nVkC1d0Psgmt+g35GAODMDl8g==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.41.tgz", + "integrity": "sha512-kJ0r/Cg3LzFzHhbBsvqi/hDPGKMGzFiPGOmUvqTkfVXhRUQtOMkXkyKdP7OEMRb8ctPtnptsZOOXPHRdU0NdJQ==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.41.tgz", + "integrity": "sha512-ZJ7d/qFRx14J3aP75ccrFSZyuYZ1hu8IVfwVqyQg4jQFgNME2FMz7pZMskBJ0fSW8QcYUnN3RubFXWijyjKUug==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.41.tgz", + "integrity": "sha512-xeWAEZt1jAfYkYuyIUuHKpH/oj7O862Je5HTH9E+4sEfoOnZaAmFrisbXjGDKXjMRKYscFlM8wXdNBmiqQlT8g==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.41.tgz", + "integrity": "sha512-X/UE3Asqy594/atYi/STgYtaMQBJwtZKF0KFFdJTkwb6rtaoHCM1o482iHibgnSK7CicuRhyTZ+cNx4OFqRQAg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.41.tgz", + "integrity": "sha512-6m+1dtdO+4KaU3R0UTT82hxWxWpFCjgSHhQl/PKtMmq+CvvxRQDcTwujLC843M7ChGVWNM2q1s6YCwoA0WQ9kw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.41.tgz", + "integrity": "sha512-p96tTTcE8/WY7A4Udh+fxVUTGL8rIXOpyxyhZiXug+f7DGbjE24PbewqgIBRSDyM7xRUty+1RzqyJz73YIV6yg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.41.tgz", + "integrity": "sha512-jS+/pGyPPzrL8tgcvOxLEatV1QPICghKm13EjEVgkeRftl8X6tqRyFv/9eKutczdD3sklMDOJfivoPD32D46Ww==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.41.tgz", + "integrity": "sha512-vLqmKbV8FJ7LFMrT3zEQpojnUUbXyqhRPVGnAYzc0ESY5yAuom4E9tL7KzZ5H8KEuCUf//AvbyxpE+yOcjpyjA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.14.41", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.41.tgz", + "integrity": "sha512-TOvj7kRTfpH4GPPmblvuMNf8oNJ3y2h7a6HttanVnc3QLMm5bNFYLSo6TShLOn0SbqFWGJwHIhGhw2JK96aVhg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fbemitter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fbemitter/-/fbemitter-3.0.0.tgz", + "integrity": "sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw==", + "dependencies": { + "fbjs": "^3.0.0" + } + }, + "node_modules/fbjs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.4.tgz", + "integrity": "sha512-ucV0tDODnGV3JCnnkmoszb5lf4bNpzjv80K41wd4k798Etq+UYD0y0TIfalLjZoKgjive6/adkRnszwapiDgBQ==", + "dependencies": { + "cross-fetch": "^3.1.5", + "fbjs-css-vars": "^1.0.0", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.30" + } + }, + "node_modules/fbjs-css-vars": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz", + "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flux": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/flux/-/flux-4.0.3.tgz", + "integrity": "sha512-yKAbrp7JhZhj6uiT1FTuVMlIAT1J4jqEyBpFApi1kxpGZCvacMVc/t1pMQyotqHhAgvoE3bNvAykhCo2CLjnYw==", + "dependencies": { + "fbemitter": "^3.0.0", + "fbjs": "^3.0.1" + }, + "peerDependencies": { + "react": "^15.0.2 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/immutable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==" + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + }, + "node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/lodash.curry": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz", + "integrity": "sha1-JI42By7ekGUB11lmIAqG2riyMXA=" + }, + "node_modules/lodash.flow": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", + "integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dependencies": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + }, + "peerDependencies": { + "prop-types": "^15.0.0", + "react": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dependencies": { + "asap": "~2.0.3" + } + }, + "node_modules/prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/pure-color": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/pure-color/-/pure-color-1.3.0.tgz", + "integrity": "sha1-H+Bk+wrIUfDeYTIKi/eWg2Qi8z4=" + }, + "node_modules/react": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-base16-styling": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/react-base16-styling/-/react-base16-styling-0.6.0.tgz", + "integrity": "sha1-7yFW1mz0E5aVyKFniGy2nqZgeSw=", + "dependencies": { + "base16": "^1.0.0", + "lodash.curry": "^4.0.1", + "lodash.flow": "^3.3.0", + "pure-color": "^1.2.0" + } + }, + "node_modules/react-codemirror2": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/react-codemirror2/-/react-codemirror2-7.2.1.tgz", + "integrity": "sha512-t7YFmz1AXdlImgHXA9Ja0T6AWuopilub24jRaQdPVbzUJVNKIYuy3uCFZYa7CE5S3UW6SrSa5nAqVQvtzRF9gw==", + "peerDependencies": { + "codemirror": "5.x", + "react": ">=15.5 <=16.x" + } + }, + "node_modules/react-dom": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.19.1" + }, + "peerDependencies": { + "react": "^16.14.0" + } + }, + "node_modules/react-json-view": { + "version": "1.21.3", + "resolved": "https://registry.npmjs.org/react-json-view/-/react-json-view-1.21.3.tgz", + "integrity": "sha512-13p8IREj9/x/Ye4WI/JpjhoIwuzEgUAtgJZNBJckfzJt1qyh24BdTm6UQNGnyTq9dapQdrqvquZTo3dz1X6Cjw==", + "dependencies": { + "flux": "^4.0.1", + "react-base16-styling": "^0.6.0", + "react-lifecycles-compat": "^3.0.4", + "react-textarea-autosize": "^8.3.2" + }, + "peerDependencies": { + "react": "^17.0.0 || ^16.3.0 || ^15.5.4", + "react-dom": "^17.0.0 || ^16.3.0 || ^15.5.4" + } + }, + "node_modules/react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + }, + "node_modules/react-router": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router-dom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/react-textarea-autosize": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.3.3.tgz", + "integrity": "sha512-2XlHXK2TDxS6vbQaoPbMOfQ8GK7+irc2fVK6QFIcC8GOnH3zI/v481n+j1L0WaPVvKxwesnY93fEfH++sus2rQ==", + "dependencies": { + "@babel/runtime": "^7.10.2", + "use-composed-ref": "^1.0.0", + "use-latest": "^1.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "2.66.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.66.0.tgz", + "integrity": "sha512-L6mKOkdyP8HK5kKJXaiWG7KZDumPJjuo1P+cfyHOJPNNTK3Moe7zCH5+fy7v8pVmHXtlxorzaBjvkBMB23s98g==", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/sass": { + "version": "1.52.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.52.1.tgz", + "integrity": "sha512-fSzYTbr7z8oQnVJ3Acp9hV80dM1fkMN7mSD/25mpcct9F7FPBMOI8krEYALgU1aZoqGhQNhTPsuSmxjnIvAm4Q==", + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/scheduler": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", + "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svg-parser": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", + "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" + }, + "node_modules/tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, + "node_modules/tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-essentials": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-2.0.12.tgz", + "integrity": "sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==" + }, + "node_modules/typescript": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/ua-parser-js": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", + "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ], + "engines": { + "node": "*" + } + }, + "node_modules/use-composed-ref": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.1.0.tgz", + "integrity": "sha512-my1lNHGWsSDAhhVAT4MKs6IjBUtG6ZG11uUqexPH9PptiIZDQOzaF4f5tEbJ2+7qvNbtXNBbU3SfmN+fXlWDhg==", + "dependencies": { + "ts-essentials": "^2.0.3" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0" + } + }, + "node_modules/use-isomorphic-layout-effect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.1.tgz", + "integrity": "sha512-L7Evj8FGcwo/wpbv/qvSfrkHFtOpCzvM5yl2KVyDJoylVuSvzphiiasmjgQPttIGBAy2WKiBNR98q8w7PiNgKQ==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-latest": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-latest/-/use-latest-1.2.0.tgz", + "integrity": "sha512-d2TEuG6nSLKQLAfW3By8mKr8HurOlTkul0sOpxbClIv4SQ4iOd7BYr7VIzdbktUCnv7dua/60xzd8igMU6jmyw==", + "dependencies": { + "use-isomorphic-layout-effect": "^1.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, + "node_modules/vite": { + "version": "2.9.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.9.tgz", + "integrity": "sha512-ffaam+NgHfbEmfw/Vuh6BHKKlI/XIAhxE5QSS7gFLIngxg171mg1P3a4LSRME0z2ZU1ScxoKzphkipcYwSD5Ew==", + "dependencies": { + "esbuild": "^0.14.27", + "postcss": "^8.4.13", + "resolve": "^1.22.0", + "rollup": "^2.59.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": ">=12.2.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "less": "*", + "sass": "*", + "stylus": "*" + }, + "peerDependenciesMeta": { + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + } + } + }, + "node_modules/vite-plugin-svgr": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vite-plugin-svgr/-/vite-plugin-svgr-2.1.0.tgz", + "integrity": "sha512-3J19p8pmGfRt297yvc8Fd36+0AC0sLgA/gZYQDjotNAhv3CmSTQyviXIrDbwiRFVrsZjSlHJH1vca7OGFmjDcA==", + "dependencies": { + "@svgr/core": "^6.2.1" + }, + "peerDependencies": { + "vite": "^2.6.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/compat-data": { + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz", + "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/core": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.2.tgz", + "integrity": "sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ==", + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-compilation-targets": "^7.18.2", + "@babel/helper-module-transforms": "^7.18.0", + "@babel/helpers": "^7.18.2", + "@babel/parser": "^7.18.0", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/generator": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", + "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", + "dependencies": { + "@babel/types": "^7.18.2", + "@jridgewell/gen-mapping": "^0.3.0", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-compilation-targets": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz", + "integrity": "sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ==", + "dependencies": { + "@babel/compat-data": "^7.17.10", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.20.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-function-name": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-module-transforms": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz", + "integrity": "sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.0", + "@babel/types": "^7.18.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-simple-access": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz", + "integrity": "sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ==", + "dependencies": { + "@babel/types": "^7.18.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/helpers": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.2.tgz", + "integrity": "sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg==", + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/parser": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.3.tgz", + "integrity": "sha512-rL50YcEuHbbauAFAysNsJA4/f89fGTOBRNs9P81sniKnKAr4xULe5AecolcsKbi88xu0ByWYDj/S1AJ3FSFuSQ==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/traverse": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz", + "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-environment-visitor": "^7.18.2", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.18.0", + "@babel/types": "^7.18.2", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/traverse/node_modules/@babel/helper-environment-visitor": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz", + "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@babel/types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.2.tgz", + "integrity": "sha512-0On6B8A4/+mFUto5WERt3EEuG1NznDirvwca1O8UwXQHVY8g3R7OzYgxXdOfMwLO08UrpUD/2+3Bclyq+/C94Q==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-add-jsx-attribute": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.0.0.tgz", + "integrity": "sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-remove-jsx-attribute": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-6.0.0.tgz", + "integrity": "sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-remove-jsx-empty-expression": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-6.0.0.tgz", + "integrity": "sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-replace-jsx-attribute-value": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-6.0.0.tgz", + "integrity": "sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-svg-dynamic-title": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-6.0.0.tgz", + "integrity": "sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-svg-em-dimensions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-6.0.0.tgz", + "integrity": "sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-transform-react-native-svg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-6.0.0.tgz", + "integrity": "sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-plugin-transform-svg-component": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-6.2.0.tgz", + "integrity": "sha512-bhYIpsORb++wpsp91fymbFkf09Z/YEKR0DnFjxvN+8JHeCUD2unnh18jIMKnDJTWtvpTaGYPXELVe4OOzFI0xg==", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/babel-preset": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-6.2.0.tgz", + "integrity": "sha512-4WQNY0J71JIaL03DRn0vLiz87JXx0b9dYm2aA8XHlQJQoixMl4r/soYHm8dsaJZ3jWtkCiOYy48dp9izvXhDkQ==", + "dependencies": { + "@svgr/babel-plugin-add-jsx-attribute": "^6.0.0", + "@svgr/babel-plugin-remove-jsx-attribute": "^6.0.0", + "@svgr/babel-plugin-remove-jsx-empty-expression": "^6.0.0", + "@svgr/babel-plugin-replace-jsx-attribute-value": "^6.0.0", + "@svgr/babel-plugin-svg-dynamic-title": "^6.0.0", + "@svgr/babel-plugin-svg-em-dimensions": "^6.0.0", + "@svgr/babel-plugin-transform-react-native-svg": "^6.0.0", + "@svgr/babel-plugin-transform-svg-component": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/core": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@svgr/core/-/core-6.2.1.tgz", + "integrity": "sha512-NWufjGI2WUyrg46mKuySfviEJ6IxHUOm/8a3Ph38VCWSp+83HBraCQrpEM3F3dB6LBs5x8OElS8h3C0oOJaJAA==", + "dependencies": { + "@svgr/plugin-jsx": "^6.2.1", + "camelcase": "^6.2.0", + "cosmiconfig": "^7.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/hast-util-to-babel-ast": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-6.2.1.tgz", + "integrity": "sha512-pt7MMkQFDlWJVy9ULJ1h+hZBDGFfSCwlBNW1HkLnVi7jUhyEXUaGYWi1x6bM2IXuAR9l265khBT4Av4lPmaNLQ==", + "dependencies": { + "@babel/types": "^7.15.6", + "entities": "^3.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, + "node_modules/vite-plugin-svgr/node_modules/@svgr/plugin-jsx": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-6.2.1.tgz", + "integrity": "sha512-u+MpjTsLaKo6r3pHeeSVsh9hmGRag2L7VzApWIaS8imNguqoUwDq/u6U/NDmYs/KAsrmtBjOEaAAPbwNGXXp1g==", + "dependencies": { + "@babel/core": "^7.15.5", + "@svgr/babel-preset": "^6.2.0", + "@svgr/hast-util-to-babel-ast": "^6.2.1", + "svg-parser": "^2.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@svgr/core": "^6.0.0" + } + }, + "node_modules/vite-plugin-svgr/node_modules/browserslist": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz", + "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001332", + "electron-to-chromium": "^1.4.118", + "escalade": "^3.1.1", + "node-releases": "^2.0.3", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/vite-plugin-svgr/node_modules/caniuse-lite": { + "version": "1.0.30001344", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001344.tgz", + "integrity": "sha512-0ZFjnlCaXNOAYcV7i+TtdKBp0L/3XEU2MF/x6Du1lrh+SRX4IfzIVL4HNJg5pB2PmFb8rszIGyOvsZnqqRoc2g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] + }, + "node_modules/vite-plugin-svgr/node_modules/electron-to-chromium": { + "version": "1.4.141", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.141.tgz", + "integrity": "sha512-mfBcbqc0qc6RlxrsIgLG2wCqkiPAjEezHxGTu7p3dHHFOurH4EjS9rFZndX5axC8264rI1Pcbw8uQP39oZckeA==" + }, + "node_modules/vite-plugin-svgr/node_modules/entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/vite-plugin-svgr/node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/vite-plugin-svgr/node_modules/node-releases": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==" + }, + "node_modules/vite/node_modules/nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/vite/node_modules/postcss": { + "version": "8.4.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", + "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "dependencies": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/vite/node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dependencies": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "engines": { + "node": ">= 6" + } + } + }, "dependencies": { "@ampproject/remapping": { "version": "2.2.0", @@ -1610,7 +4917,8 @@ "react-codemirror2": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/react-codemirror2/-/react-codemirror2-7.2.1.tgz", - "integrity": "sha512-t7YFmz1AXdlImgHXA9Ja0T6AWuopilub24jRaQdPVbzUJVNKIYuy3uCFZYa7CE5S3UW6SrSa5nAqVQvtzRF9gw==" + "integrity": "sha512-t7YFmz1AXdlImgHXA9Ja0T6AWuopilub24jRaQdPVbzUJVNKIYuy3uCFZYa7CE5S3UW6SrSa5nAqVQvtzRF9gw==", + "requires": {} }, "react-dom": { "version": "16.14.0", @@ -1832,7 +5140,8 @@ "use-isomorphic-layout-effect": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.1.tgz", - "integrity": "sha512-L7Evj8FGcwo/wpbv/qvSfrkHFtOpCzvM5yl2KVyDJoylVuSvzphiiasmjgQPttIGBAy2WKiBNR98q8w7PiNgKQ==" + "integrity": "sha512-L7Evj8FGcwo/wpbv/qvSfrkHFtOpCzvM5yl2KVyDJoylVuSvzphiiasmjgQPttIGBAy2WKiBNR98q8w7PiNgKQ==", + "requires": {} }, "use-latest": { "version": "1.2.0", @@ -2097,42 +5406,50 @@ "@svgr/babel-plugin-add-jsx-attribute": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.0.0.tgz", - "integrity": "sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==" + "integrity": "sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==", + "requires": {} }, "@svgr/babel-plugin-remove-jsx-attribute": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-6.0.0.tgz", - "integrity": "sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==" + "integrity": "sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==", + "requires": {} }, "@svgr/babel-plugin-remove-jsx-empty-expression": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-6.0.0.tgz", - "integrity": "sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==" + "integrity": "sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==", + "requires": {} }, "@svgr/babel-plugin-replace-jsx-attribute-value": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-6.0.0.tgz", - "integrity": "sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==" + "integrity": "sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==", + "requires": {} }, "@svgr/babel-plugin-svg-dynamic-title": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-6.0.0.tgz", - "integrity": "sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==" + "integrity": "sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==", + "requires": {} }, "@svgr/babel-plugin-svg-em-dimensions": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-6.0.0.tgz", - "integrity": "sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==" + "integrity": "sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==", + "requires": {} }, "@svgr/babel-plugin-transform-react-native-svg": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-6.0.0.tgz", - "integrity": "sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==" + "integrity": "sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==", + "requires": {} }, "@svgr/babel-plugin-transform-svg-component": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-6.2.0.tgz", - "integrity": "sha512-bhYIpsORb++wpsp91fymbFkf09Z/YEKR0DnFjxvN+8JHeCUD2unnh18jIMKnDJTWtvpTaGYPXELVe4OOzFI0xg==" + "integrity": "sha512-bhYIpsORb++wpsp91fymbFkf09Z/YEKR0DnFjxvN+8JHeCUD2unnh18jIMKnDJTWtvpTaGYPXELVe4OOzFI0xg==", + "requires": {} }, "@svgr/babel-preset": { "version": "6.2.0", diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs index deea73383..66523bcee 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs @@ -24,7 +24,7 @@ protected override object GetModel(GeneratorExecutionContext context) new { Name = Path.GetFileNameWithoutExtension(o.Path), - Type = new FileInfo(o.Path).Directory.Name, + Type = new FileInfo(o.Path).Directory!.Name, UseTabs = Path.GetFileNameWithoutExtension(o.Path).EndsWith("_Tabs") } ); diff --git a/Src/CSharpier.Tests/FormattingTests/SetUpFixture.cs b/Src/CSharpier.Tests/FormattingTests/SetUpFixture.cs index a9f5f1715..b871f4b2b 100644 --- a/Src/CSharpier.Tests/FormattingTests/SetUpFixture.cs +++ b/Src/CSharpier.Tests/FormattingTests/SetUpFixture.cs @@ -10,7 +10,7 @@ public class SetUpFixture [OneTimeSetUp] public void OneTimeSetUp() { - EmptyFiles.Extensions.AddTextExtension(".cst"); + EmptyFiles.Extensions.AddTextExtension(".test"); DiffTools.AddToolBasedOn( DiffTool.WinMerge, name: "WritableWinMerge", diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.actual.test new file mode 100644 index 000000000..9bb2f2aaf --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.actual.test @@ -0,0 +1,9 @@ +class ClassName +{ + void MethodName() + { + Point point; + Point* p = &point; + p->x = 10; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.actual.test new file mode 100644 index 000000000..4dd06229f --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + global::System.String s = "a"; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.actual.test new file mode 100644 index 000000000..86e2f7a4d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.actual.test @@ -0,0 +1,34 @@ +class ClassName +{ + void MethodName() + { + Func f1 = delegate(bool a) + { + return !a; + }; + + Func f2 = static delegate(bool a) + { + return !a; + }; + + Func f3 = async delegate(bool a) + { + return await !a; + }; + + Func f4 = async static delegate(bool a) + { + return await !a; + }; + + Func f5 = delegate( + string longName, + string longerName, + string longestName________________________________________ + ) + { + return !a; + }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.actual.test new file mode 100644 index 000000000..7cfb349d5 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.actual.test @@ -0,0 +1,18 @@ +public class ClassName +{ + public dynamic ShortValue = new { Property = true }; + + public dynamic LongValue = new + { + One = "One", + Two = "Two", + ThreeThreeThree = "ThreeThreeThree" + }; + + public dynamic Value = new { NoName }; + + public void Method() + { + var x = new { }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.actual.test new file mode 100644 index 000000000..9ac5f6f5d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.actual.test @@ -0,0 +1,9 @@ +public class ClassName +{ + public void MethodName() + { + this.Method(true); + + this.NamedArguments(b: true, c: "false"); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.actual.test new file mode 100644 index 000000000..8612227c8 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.actual.test @@ -0,0 +1,22 @@ +class ClassName +{ + float[] arrayWithInitializer = new float[5] { 0f, 1.1f }; + + int[] array = new int[5]; + + var anArray = new int[5, 10]; + + var aLongArray_________________________________________________________________________ = + new int[5, 10]; + + var anArrayWithLongRanks = new byte[ + someReallyLongThing__________________________, + someReallyLongThing__________________________ + ]; + + private static readonly char[] initializerIndents = new char[] + { + Path.DirectorySeparatorChar, + Path.AltDirectorySeparatorChar + }; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.actual.test new file mode 100644 index 000000000..292606a15 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + var x = null as object ?? null; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.actual.test new file mode 100644 index 000000000..562ba833f --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.actual.test @@ -0,0 +1,86 @@ +class ClassName +{ + void MethodName() + { + var x = 0; + x = 15; + + // leading on statement + var x = 0; + + // leading on expression + x = 15; + + x = 25; // trailing!!!! + + assignmentInstructionalText = + editAssignmentViewModel.InstructionalTextxxxxxxxxxx ?? string.Empty; + + value = + someLongValue__________________________________ + && someOtherValue__________________________________ + ? trueValue + : falseValue; + + value = someLongCondition________________________________ + ? "someLongValue" + : "someOtherLongValue"; + + var nonChainFormatting = anotherVariable1 = + "someValue____________________________________________"; + + nonChainFormatting = anotherVariable1 = + "someValue____________________________________________"; + + var chainFormatting = + anotherVariable1 = + anotherVariable2 = + "someValue____________________________________________"; + + chainFormatting = + anotherVariable1 = + anotherVariable2 = + "someValue____________________________________________"; + + var nonChainFormatting = anotherVariable1 = CallMethod( + parameter________________________________, + parameter________________________________ + ); + + nonChainFormatting = anotherVariable1 = CallMethod( + parameter________________________________, + parameter________________________________ + ); + + var chainFormatting = + anotherVariable1 = + anotherVariable2 = + CallMethod( + parameter________________________________, + parameter________________________________ + ); + + chainFormatting = + anotherVariable1 = + anotherVariable2 = + CallMethod( + parameter________________________________, + parameter________________________________ + ); + } + + public SomeExpressionBodyMethod() => + nonChainFormatting = anotherVariable1 = ( + someCondition________________________________ + || someOtherCondition___________________________ + ); + + public SomeExpressionBodyMethod() => + chainFormatting = + anotherVariable1 = + anotherVariable2 = + ( + someCondition________________________________ + || someOtherCondition___________________________ + ); +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.actual.test new file mode 100644 index 000000000..efd8c9dbe --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.actual.test @@ -0,0 +1,12 @@ +namespace Namespace +{ + [Obsolete] + class ClassOne { } + + [Obsolete] + [NoNewLine] + // do stuff + class ClassTwo { } + + class ClassThree { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.actual.test new file mode 100644 index 000000000..815492798 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.actual.test @@ -0,0 +1,114 @@ +[assembly: System.Copyright("(C) 2009")] +[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] + +[Obsolete] +class ClassName +{ + [Obsolete] + private string Field; + + [Obsolete] + public string Property + { + [Obsolete] + get; + [Obsolete] + set; + } + + [Obsolete, NonSerialized] + void MethodName([In] string value) { } + + [ + Obsolete, + System.NonSerialized, + NonSerialized, + CLSCompliant(true || false & true), + AnotherRandomAttribute + ] + private volatile int f2; + + [DllImport("kernel32", SetLastError = true)] + static extern bool NameEquals(string name, SecurityAttribute sa); + + [Obsolete("Error", error: true)] + void NameColon() { } + + [return: Obsolete] + [method: Obsolete] + void Targets() { } + + // leading + [Obsolete] // trailing + class ClassOne { } + + // leading with new line + [Obsolete] // more trailing + // leading before class + class ClassTwo { } + + [LongAttributeWithParametersBreaking( + "someValue_____________", + "someValue_____________", + "someValue_____________" + )] + void LongAttribute() { } + + public void MethodName([FromBody] SomeParameter parameter) + { + return; + } + + public void MethodName( + int someParameter, + [ShortAttributeName] AnotherObject anotherObject, + [VeryLongAttributeName(SomeFlag.SomeValue, SomeOtherFlag.SomeOtherLongValue)] + string tabbedBreakParameter, + bool anotherParameter + ) + { + return; + } + + public void MethodWithAttributesOnTypeParameters<[SomeShort] T, K>() { } + + public void MethodWithAttributesOnTypeParameters< + [SomeLongAttribute__________________________] T, + K + >() { } + + public void MethodWithAttributesOnTypeParameters< + [SomeLongAttribute__________________________] + TSomeMuchLongerName___________________________________, + K + >() { } + + public void MethodWithAttributesOnTypeParameters< + [SomeAttributeWithParameters( + longParameter_____________________________, + longParameter_____________________________ + )] + TSomeMuchLongerName___________________________________, + K + >() { } +} + +[ + LongAttributeWithParametersBreaking( + "someValue_____________", + "someValue_____________", + "someValue_____________" + ), + AnotherAttribute +] +public class ClassName { } + +[GenericAttribute()] +public class ClassName { } + +[Generic< + LongName______________________, + LongName______________________, + LongName______________________ +>] +public class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.actual.test new file mode 100644 index 000000000..ecce5c838 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.actual.test @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Insite.WIS.Epicor.Epicor10CashGrpService { + using System.Runtime.Serialization; + using System; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="IceTableset", Namespace="http://schemas.datacontract.org/2004/07/Ice")] + [System.SerializableAttribute()] + [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.BOUpdErrorTableset))] + [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.CashGrpListTableset))] + [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.UpdExtCashGrpTableset))] + [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.CashGrpTableset))] + public partial class IceTableset : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + } +} \ No newline at end of file diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.actual.test new file mode 100644 index 000000000..2f7e5ec5a --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.actual.test @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.actual.test new file mode 100644 index 000000000..783dfafbe --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + async void MethodName() + { + await System.Threading.Tasks.Task.Delay(0); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.actual.test new file mode 100644 index 000000000..656c20bf4 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + return base.MethodName(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.actual.test new file mode 100644 index 000000000..f398085ba --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.actual.test @@ -0,0 +1,219 @@ +class TestClass +{ + public string SomeProperty => + "someLongStringValue__________________________" + + "someOtherLongStringValue_______________________________"; + + void TestMethod() + { + var someVar = "a string" + thatIsJust(shortEnough) + "to not wrap"; + + var someLongVariableName = + "a long string with just concatenation" + + "will break this way" + + "because of reasons such as the fact it is too long"; + + var someLongVariableName = + "a really loooooooooooooooong string" + + someMethodCall("with long args") + + "really long string"; + + var samePrecedenceAligns = + one_________________________________ + + two_______________________________ + - three_____________________________ + + four______________________________; + + var coalesceIsSpecial = + someValue_________________________ + ?? someOtherValue_______________________ + ?? someOtherValue_______________________; + + coalesceIsSpecial ??= + someValue_________________________ + ?? someOtherValue_______________________ + ?? someOtherValue_______________________; + + CallSomeLongMethodWithStringConcatenationThatShouldNotBreak( + csharpDirectory + ".generated.cs", + output.ToString() + ); + + var commentsDontBreakBinary = + // shouldn't break next line + true || false; + + var commentsDontBreakBinary = + // shouldn't break next line + // shouldn't break next line + true || false; + + var directivesDontBreakBinary = +#pragma + true || false; + + var conditionalIndentation = someBoolean + ? someLongValue____________________________________ + + someLongValue____________________________________ + : someLongValue____________________________________ + + someLongValue____________________________________; + + var someValue = + value1__________________ == value2_________________ + != (value3_______________________ == value4___________________); + + if ( + one == two + || someValue_______________ + == thisWillIndent_______________________________________________________________ + ) { } + + while ( + one == two + || someValue_______________ + == thisWillIndent_______________________________________________________________ + ) { } + + switch ( + one == two + || someValue_______________ + == thisWillIndent_______________________________________________________________ + ) { } + + do + { + CallSomething(); + } while ( + one == two + || someValue_______________ + == thisWillIndent_______________________________________________________________ + ); + + CallMethod( + "shouldIndentToMakeItClearWhereParametersAre" + + "someLongString_________________________________", + "SecondParameter" + ); + + var y = someList.Where( + o => + someLongValue_______________________ + && theseShouldNotIndent_________________ + && theseShouldNotIndent_________________ + > butThisOneShould_________________________________________ + ); + + var someVariable = + CallMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) + && CallMethod() == someValue; + + var someValue = + someLongThing___________________________.someLongThing_____________ ?? someOtherThing; + + if ( + one - two == three + || one + two == three + || one * two == three + || one / two == three + || one % two == three + || one != three + || one < two + || one > two + || one <= two + || one >= two + || one is null + || one as Something == null + || one - two > three + || someLongThing - someOtherLongThing__________________________________ + > anotherLongThing + ) { } + + if ( + CallSomeMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) == 0 + ) { } + + if ( + someValue + && CallSomeMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) == 0 + ) { } + + if ( + CallSomeMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) == 0 + && someValue + ) { } + + if ( + CallMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) + && CallMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) + ) { } + + if ( + CallMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) || CallMethod(shortValue, "shortValue") + ) { } + + if ( + CallMethod( + someParameter_____________________________________, + someParameter_____________________________________ + ) + || CallMethod(shortValue, "shortValue") + || CallMethod(shortValue1, "shortValue1") + ) { } + + if ( + CallSomeMethod(someParameter) + == someLongerValue_______________________________________________________________ + ) { } + + return someValue != someOtherValue + && someLongValue_____________________ == someOtherLongValue_____________________; + + var someValue = + CallSomething( + someLongValue__________________________________________, + someLongValue__________________________________________ + ) == someOtherValue; + + var coalesceIsSpecial = + CallSomething( + someLongValue__________________________________________, + someLongValue__________________________________________ + ) ?? someOtherValue; + + var notIdealSee355 = + variable + .Replace(someParameter_______________________, '.') + .Replace(someParameter_______________________, '.') + "."; + + UglyButConsistentWithPrettier( + someValue + == someLongThing__________________________________________________________________ + || someOtherValue + == someOtherLongThing________________________________________________, + secondParameter + ); + + var x = one >>> two; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.actual.test new file mode 100644 index 000000000..f37140e1b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.actual.test @@ -0,0 +1,148 @@ +// csharpier-ignore +public class Unformatted { } + +// csharpier-ignore - also ignored +public class Unformatted { } + +// csharpier-ignore-not ignored +public class Unformatted { } + +public class ClassName +{ + // csharpier-ignore + private string unformatted; + + void BasicSingleIgnores() + { + // csharpier-ignore + var unformatted = true; + // csharpier-ignore + var trimsTrailingHere = true; + + if (true) + { + // csharpier-ignore + var unformatted = true; + } + } + + void RangeWithNodeAfter() + { + var formatMe = true; + // csharpier-ignore-start + var trimsTrailing1 = true; + var trimsTrailing2 = true; + // csharpier-ignore-start + var unformatted1 = true; + var unformatted2 = true; + // csharpier-ignore-end + var formatMe = true; + } + + void MultipleStatements() + { + // csharpier-ignore-start + var packet = new List(); + packet.Add(0x0f); packet.Add(0x00); + packet.Add(0x0f); packet.Add(0x00); + // csharpier-ignore-end + } + + void RangeToEndMethod() + { + var formatMe = true; + // csharpier-ignore-start + var unformatted1 = true; + var unformatted2 = true; + // csharpier-ignore-end + } + + void RangeWithoutEnd() + { + var formatMe = true; + // csharpier-ignore-start + var unformatted = true; + var unformatted = true; + } +} + +public class ClassName2 +{ + // csharpier-ignore-start + private string unformatted1; + // csharpier-ignore-end + + // csharpier-ignore-start - also ignored + private string unformatted1; + // csharpier-ignore-end - also ignored + + // csharpier-ignore-start-not ignored + private string unformatted1; + + // csharpier-ignore-end-not ignored + + private string formatMe; + // csharpier-ignore-start + private string noNewLine; + // csharpier-ignore-end + + // csharpier-ignore-start + private string keepNewLine; + // csharpier-ignore-end + + public void Method() + { + // csharpier-ignore-start + string unformatted1; + // csharpier-ignore-end + + string formatMe; + // csharpier-ignore-start + string noNewLine; + // csharpier-ignore-end + + // csharpier-ignore-start + string keepNewLine; + // csharpier-ignore-end + } + + public void KeepLines1() + { + // csharpier-ignore-start + var unformattedWithLine1; + + var unformattedWithLine2; + // csharpier-ignore-end + } + + public void KeepLines2() + { + // csharpier-ignore-start + string unformattedWithLine1; + + string unformattedWithLine2; + // csharpier-ignore-end + + string anotherValue; + } +} + +public class KeepLines1 +{ + // csharpier-ignore-start + private string first; + + private string second; + // csharpier-ignore-end +} + +public class KeepLines2 +{ + // csharpier-ignore-start + private string first; + + private string second; + // csharpier-ignore-end + + private string third; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.actual.test new file mode 100644 index 000000000..681e8f917 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.actual.test @@ -0,0 +1,8 @@ +namespace Namespace +{ + // csharpier-ignore-start + public class Unformatted { } + // csharpier-ignore-end + + public class FormatMe { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.actual.test new file mode 100644 index 000000000..0f4ce0536 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.actual.test @@ -0,0 +1,20 @@ +public +// csharpier-ignore +class ClassName +{ + private void MethodName( + // csharpier-ignore + string one + ) + { + var x + // csharpier-ignore + = someRandomValue; + + this.CallMethod( + // csharpier-ignore + true, + false + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.actual.test new file mode 100644 index 000000000..8ca05435c --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.actual.test @@ -0,0 +1,19 @@ +using System; + +// csharpier-ignore-start +string unformatted1; +// csharpier-ignore-end + +string formatMe; +// csharpier-ignore-start + string noNewLine; +// csharpier-ignore-end + +// csharpier-ignore-start +string keepNewLine; +// csharpier-ignore-end + + +// csharpier-ignore-start +string removeNewLine; +// csharpier-ignore-end diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.actual.test new file mode 100644 index 000000000..84981502b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.actual.test @@ -0,0 +1,45 @@ +class ClassName +{ + private short x = (short)0; + + void MethodName() + { + var someValue = (SomeType)someObject.CallMethod(); + var someValue = (SomeType)(someObject.CallMethod()); + + var someValue = (SomeType) + someObject + .CallMethod____________________________() + .CallMethod____________________________(); + + var someValue = (SomeType)( + someObject + .CallMethod____________________________() + .CallMethod____________________________() + ); + + var someObject = (SomeType____________________) + arrayIndexerDoesNotBreak[typeof(SomeType____________________)]; + + return (T)CallMethod( + someArgument_______________________________, + someArgument_______________________________ + ); + + return (SomeGenericType) + CallMethod( + someArgument_______________________________, + someArgument_______________________________ + ); + + return (SomeGenericType)( + CallMethod( + someArgument_______________________________, + someArgument_______________________________ + ) + ); + + var someValue____________________________ = + (SomeType)someIdentifier____________________________; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.actual.test new file mode 100644 index 000000000..639df3cc7 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.actual.test @@ -0,0 +1,21 @@ +class ClassName +{ + void MethodName() + { + checked + { + checked(++i); + + checked(printsLikeInvocations + whenItsFlat); + + checked( + printsLikeInvocations + whenItBreaks______________________________________________ + ); + + checked( + printsLikeInvocations + + whenItLongBreaks_______________________________________________ + ); + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.actual.test new file mode 100644 index 000000000..2980e6eae --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.actual.test @@ -0,0 +1,61 @@ +public class EmptyClass { } + +public static abstract class MoreModifiers { } + +class NoModifiers { } + +public class WithInterface : IInterface { } + +public class WithReallyLongNameInterface + : IReallyLongNameLetsMakeThisBreak___________________________ { } + +public class ThisIsSomeLongNameAndItShouldFormatWell1 + : AnotherLongClassName, + AndYetAnotherLongClassName, + AndStillOneMore { } + +public class SimpleGeneric + where T : new() { } + +public class LongTypeConstraints + where T : SomeLongNameThatJustKeepsGoing, + AndThenAnotherOneThatIsEvenLonger____________________ { } + +public class LongerClassNameWithLotsOfGenerics< + TLongName, + TAnotherLongName, + TThirdLongName__________________ +> { } + +public class LongerClassNameWithLotsOfGenerics< + TLongName, + TAnotherLongName, + TThirdLongName__________________ +> : SomeBaseClass { } + +public class SimpleGeneric : BaseClass + where T : new() { } + +public class ThisIsSomeLongNameAndItShouldFormatWell2 + : AnotherLongClassName, + AnotherClassName + where T : new(), AnotherTypeConstraint + where T2 : new() + where T3 : new() { } + +public class IdentityDbContext + : IdentityDbContext< + TUser, + TRole, + TKey, + IdentityUserClaim, + IdentityUserRole, + IdentityUserLogin, + IdentityRoleClaim, + IdentityUserToken + > + where TUser : IdentityUser + where TRole : IdentityRole + where TKey : IEquatable { } + +file class FileScopedType { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.actual.test new file mode 100644 index 000000000..eeb9fe9e2 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.actual.test @@ -0,0 +1,3 @@ +public class ClassName { } + +public class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.actual.test new file mode 100644 index 000000000..7b2c65197 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.actual.test @@ -0,0 +1,59 @@ +public class EmptyClass { } + +public static abstract class MoreModifiers { } + +class NoModifiers { } + +public class WithInterface : IInterface { } + +public class WithReallyLongNameInterface + : IReallyLongNameLetsMakeThisBreak___________________________ { } + +public class ThisIsSomeLongNameAndItShouldFormatWell1 + : AnotherLongClassName, + AndYetAnotherLongClassName, + AndStillOneMore { } + +public class SimpleGeneric + where T : new() { } + +public class LongTypeConstraints + where T : SomeLongNameThatJustKeepsGoing, + AndThenAnotherOneThatIsEvenLonger____________________ { } + +public class LongerClassNameWithLotsOfGenerics< + TLongName, + TAnotherLongName, + TThirdLongName__________________ +> { } + +public class LongerClassNameWithLotsOfGenerics< + TLongName, + TAnotherLongName, + TThirdLongName__________________ +> : SomeBaseClass { } + +public class SimpleGeneric : BaseClass + where T : new() { } + +public class ThisIsSomeLongNameAndItShouldFormatWell2 + : AnotherLongClassName, + AnotherClassName + where T : new(), AnotherTypeConstraint + where T2 : new() + where T3 : new() { } + +public class IdentityDbContext + : IdentityDbContext< + TUser, + TRole, + TKey, + IdentityUserClaim, + IdentityUserRole, + IdentityUserLogin, + IdentityRoleClaim, + IdentityUserToken + > + where TUser : IdentityUser + where TRole : IdentityRole + where TKey : IEquatable { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.actual.test new file mode 100644 index 000000000..15aad2036 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.actual.test @@ -0,0 +1,7 @@ +public class ClassName +{ + public void MethodName() + { + var x = 1; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.actual.test new file mode 100644 index 000000000..c62296825 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.actual.test @@ -0,0 +1,4 @@ +public class ClassName +{ + public string Value = SomeValue ?? ""; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.actual.test new file mode 100644 index 000000000..6d4a9f52f --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.actual.test @@ -0,0 +1,105 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// NewLineAfterThis +// +// -------------------------------------------------------------------------------------------------------------------- + +// public class +public class ClassName { } + +// other class +class ClassName2 { } + +// leading +public // trailing +static // trailing +class // trailing +ClassName2 { } + +// this +public +// is +static +// valid +// wtf +class +// yeah +ClassName3 // more trailing +{ + // yeah + private + // no + readonly string Tester = "lajsdf"; +} + +/// single line doc comment +class ClassName { } + +class ClassName +{ + // indents +} + +namespace NameSpace +{ + class ClassName + { + // indents + } +} + +public class ClassName +{ + // method + public void MethodName() { } + + // leading modifer + public // trailing modifier + static // more trailing + // leading return type + void // more trailing + MethodName2() { } + + public static void MethodName3() { } + + void //other trailing + MethodName4() { } + + void TrailingCommentTest() // shouldn't space before the next brace + { + return; + } + + void TrailingCommentWithParameters( + string oasdflkjasdfljkaksjdfasjdkfjslakdf, + string ljasdfjklaskldfkalsfjkasdf + ) // shouldn't space before the next brace + { + return; + } + + void MethodName() + { + // indents + } + + IReadOnlyList ICommand.Arguments => Arguments; + + /// + IReadOnlyList ICommand.Arguments => Arguments; + + // regular comment does not cause breaking + IReadOnlyList ICommand.Arguments => Arguments; +} + +class ClassName +{ + void MethodName() + { + var x = 1; + + // keep line before this + } + + // keep line before this +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.actual.test new file mode 100644 index 000000000..dd998f309 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.actual.test @@ -0,0 +1,51 @@ +public class ClassName +{ + /// singleLine documentation + /// second line + private string field; + + public void Method() + { + /* this should keep the * aligned + * multiline + */ + var variable = true; + } + + /// no tabs here + /// Tabs here + /// + public class ClassName { } + + /* this works fine + * because indentation does not change + */ + public class ClassName2 { } + + /* this doesn't fail +by trying to move it left 4 spaces */ + public class ClassName2 { } + + /* + public string String; + */ +} + +public interface Interface +{ + /// + /// tab here before < + void Method(); + + /* this should ditch the tabs + that were in from of here + */ + void Method(); +} + +/* +public class CommentedCodeShouldKeepFormatting +{ + void MethodName() { } +} +*/ diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.actual.test new file mode 100644 index 000000000..bc69eb785 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.actual.test @@ -0,0 +1,6 @@ +using System.Diagnostics.CodeAnalysis; + +[assembly: ForceLineAbove] +[assembly: ButNotHere] + +[assembly: ButKeepThisOne] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.actual.test new file mode 100644 index 000000000..c953e00d0 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.actual.test @@ -0,0 +1,10 @@ +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; + +#if KEEP_LINE_ABOVE +namespace System.Web.Http.Internal +#else +namespace System.Web.WebPages +#endif +{ } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.actual.test new file mode 100644 index 000000000..44b256a5d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.actual.test @@ -0,0 +1,12 @@ +#if DONT_ADD_EXTRA_LINES +using System.Net.Http; +#else +using System.Web.Routing; +#endif + +#if DONT_ADD_EXTRA_LINES +namespace System.Web.Http.Routing.Constraints +#else +namespace System.Web.Mvc.Routing.Constraints +#endif +{ } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.actual.test new file mode 100644 index 000000000..38bc81136 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.actual.test @@ -0,0 +1,6 @@ +#if NO_DOUBLE_LINE_WITH_FILE_SCOPED +using System; + +#endif + +namespace Namespace; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.actual.test new file mode 100644 index 000000000..7bd9084ee --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.actual.test @@ -0,0 +1,6 @@ +using System.Runtime.CompilerServices; +#if NO_EXTRA_LINES_WITH_ATTRIBUTE +using System.Runtime.CompilerServices; +#endif + +[assembly: Attribute] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.actual.test new file mode 100644 index 000000000..801cd0117 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.actual.test @@ -0,0 +1,6 @@ +using System.Runtime.CompilerServices; + +#if KEEP_LINE_ABOVE +[assembly: Attribute] +#endif +[assembly: Attribute] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.actual.test new file mode 100644 index 000000000..062cb4e59 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.actual.test @@ -0,0 +1,5 @@ +using System; + +[assembly: SomeAttribute] + +namespace Namespace { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.actual.test new file mode 100644 index 000000000..4b301ff38 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.actual.test @@ -0,0 +1,8 @@ +using System; + +#if DEBUG +[assembly: SomeAttribute] + +#endif + +namespace Namespace { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.actual.test new file mode 100644 index 000000000..3dd16a025 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.actual.test @@ -0,0 +1,7 @@ +public class ClassName +{ + public void MethodName() + { + SomeObject?.MethodCall(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.actual.test new file mode 100644 index 000000000..fe3bdcd9c --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.actual.test @@ -0,0 +1,143 @@ +public class ClassName +{ + public string Value = true ? "yes" : "no"; + + public string Value = someLongCondition______________________ + ? "someLongValue" + : "someOtherLongValue"; + + public bool CloseParenIndents = someCondition + ? this.SomeMethodCallThatIsLonger____________________( + someLongValue, + someLongValue, + someLongValue + ) + : this.SomeMethodCallThatIsLonger____________________( + someLongValue, + someLongValue, + someLongValue + ); + + void Method() + { + var nestedConditions = someCondition + ? someOtherCondition______________ + ? someValue_______________________ + : someOtherValue___________________ + : someThirdCondition______________ + ? someThirdValue_________________ + : someOtherThirdValue_______________________; + + var value = + someLongValue__________________________________ + && someOtherValue__________________________________ + ? trueValue + : falseValue; + + CallMethod( + someValue, + someCondition + ? trueValue________________________________ + : falseValue_______________________________, + someCondition_____________________________________ + && someOtherCondition__________________________________ + ? trueValue________________________________ + : falseValue_______________________________, + someCondition_____________________________________ + && someOtherCondition__________________________________ + ); + + var fileContents = File.ReadAllText( + file, + // leading here should break parameters and GetEncoding should still group + encoding + ? File.GetEncoding________________________________(1252) + : encoding_____________________, + cancellationToken + ); + + var fileContents = File.ReadAllText( + file, + // leading here should break parameters + encoding ? GetEncoding(1252) : encoding, + cancellationToken + ); + + return someLongCondition___________________________ + ? trueValue________________________________ + : falseValue________________________________; + + return + someLongCondition____________________________________ + && someOtherLongCondition____________________________________ + ? trueValue________________________________ + : falseValue_______________________________; + + return + someLongCondition____________________________________ + is SomeLongType___________________________ + ? trueValue________________________________ + : falseValue_______________________________; + + return ( + someLongCondition____________________________________ + && someOtherLongCondition____________________________________ + ) + ? trueValue________________________________ + : falseValue_______________________________; + + return + someLongCondition____________________________________ + == someThingElse______________________ + && someOtherLongCondition____________________________________ + ? trueValue________________________________ + : falseValue_______________________________; + + return CallSomeMethod( + someLongCondition____________________________________, + someOtherLongCondition____________________________________ + ) + ? trueValue________________________________ + : falseValue_______________________________; + + return firstCondition + ? firstValue + : secondCondition + ? secondValue + : thirdCondition + ? thirdValue + : fourthValue; + + return firstCondition + ? secondCondition + ? firstValue + : secondValue + : thirdCondition + ? thirdValue + : fourthValue; + + return a ? b : c; + + return a + ? b + : c + ? d + : e; + + var invocationIndent = someCondition + ? SomeObject + .CallLongMethod__________________________________________() + .CallLongMethod__________________________________________() + : SomeObject + .CallLongMethod__________________________________________() + .CallLongMethod__________________________________________(); + + CallMethod( + someCondition + ? SomeValue + : SomeObject + .CallMethod__________________________________() + .CallMethod__________________________________() + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.actual.test new file mode 100644 index 000000000..a854d09d3 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.actual.test @@ -0,0 +1,143 @@ +public class ClassName +{ + public string Value = true ? "yes" : "no"; + + public string Value = someLongCondition______________________ + ? "someLongValue" + : "someOtherLongValue"; + + public bool CloseParenIndents = someCondition + ? this.SomeMethodCallThatIsLonger____________________( + someLongValue, + someLongValue, + someLongValue + ) + : this.SomeMethodCallThatIsLonger____________________( + someLongValue, + someLongValue, + someLongValue + ); + + void Method() + { + var nestedConditions = someCondition + ? someOtherCondition______________ + ? someValue_______________________ + : someOtherValue___________________ + : someThirdCondition______________ + ? someThirdValue_________________ + : someOtherThirdValue_______________________; + + var value = + someLongValue__________________________________ + && someOtherValue__________________________________ + ? trueValue + : falseValue; + + CallMethod( + someValue, + someCondition + ? trueValue________________________________ + : falseValue_______________________________, + someCondition_____________________________________ + && someOtherCondition__________________________________ + ? trueValue________________________________ + : falseValue_______________________________, + someCondition_____________________________________ + && someOtherCondition__________________________________ + ); + + var fileContents = File.ReadAllText( + file, + // leading here should break parameters and GetEncoding should still group + encoding + ? File.GetEncoding________________________________(1252) + : encoding_____________________, + cancellationToken + ); + + var fileContents = File.ReadAllText( + file, + // leading here should break parameters + encoding ? GetEncoding(1252) : encoding, + cancellationToken + ); + + return someLongCondition___________________________ + ? trueValue________________________________ + : falseValue________________________________; + + return + someLongCondition____________________________________ + && someOtherLongCondition____________________________________ + ? trueValue________________________________ + : falseValue_______________________________; + + return + someLongCondition____________________________________ + is SomeLongType___________________________ + ? trueValue________________________________ + : falseValue_______________________________; + + return ( + someLongCondition____________________________________ + && someOtherLongCondition____________________________________ + ) + ? trueValue________________________________ + : falseValue_______________________________; + + return + someLongCondition____________________________________ + == someThingElse______________________ + && someOtherLongCondition____________________________________ + ? trueValue________________________________ + : falseValue_______________________________; + + return CallSomeMethod( + someLongCondition____________________________________, + someOtherLongCondition____________________________________ + ) + ? trueValue________________________________ + : falseValue_______________________________; + + return firstCondition + ? firstValue + : secondCondition + ? secondValue + : thirdCondition + ? thirdValue + : fourthValue; + + return firstCondition + ? secondCondition + ? firstValue + : secondValue + : thirdCondition + ? thirdValue + : fourthValue; + + return a ? b : c; + + return a + ? b + : c + ? d + : e; + + var invocationIndent = someCondition + ? SomeObject + .CallLongMethod__________________________________________() + .CallLongMethod__________________________________________() + : SomeObject + .CallLongMethod__________________________________________() + .CallLongMethod__________________________________________(); + + CallMethod( + someCondition + ? SomeValue + : SomeObject + .CallMethod__________________________________() + .CallMethod__________________________________() + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.actual.test new file mode 100644 index 000000000..b1b5e91c4 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.actual.test @@ -0,0 +1,130 @@ +public class BasicClass +{ + public BasicClass() { } + + [Obsolete] + public BasicClass(string one) { } + + public ClassName() => this.Value = 1; + + public BasicClass(int two, string exactly100___________________________________________________) + { + return; + } + + public BasicClass( + int two, + string justOver100___________________________________________________ + ) + { + return; + } +} + +public class Initializers : BasicClass +{ + public Initializers() + : this(true) { } + + public Initializers(string value) + : base(value) { } + + public Initializers( + string longParameter_______________________________________________________________________________ + ) + : base( + longParameter_______________________________________________________________________________ + ) { } + + public Initializers( + string longParameter_______________________________________________________________________________ + ) + : base( + longParameter_______________________________________________________________________________ + ) + { + WithBody(); + } + + public Initializers( + string longParameter____________________________________________________________ + ) + : base(false) { } + + public Initializers( + string longParameter____________________________________________________________ + ) + : base(false) + { + WithBody(); + } + + public LongMethodName___________________________________________________________________________() + : base(false) { } + + public WithParameters(string parameter) + : base( + longParameter____________________________________________________________________________ + ) { } + + // this may change, see #372 + public WithParameters(string parameter) + : base( + longParameter____________________________________________________________________________ + ) + { + WithBody(); + } + + public LongMethodName___________________________________________________________________________() + : base( + longParameter____________________________________________________________________________ + ) { } + + public Initializers(string value) /*Comment*/ + : base(value) { } + + public LongMethodName___________________________________________________________() + /*Comment*/: base(false) { } + + public LongInitializerBreaksAtEdgeCase() + : this(someParameter, someOtherParameter___________________________________________________) + { + WithBody(); + } + + public LongParametersWithEmptyBody(string parameter, bool anotherParameter_________________) { } + + public LongParametersWithEmptyBody(string parameter, bool anotherParameter__________________) + { } + + public LongInitializerWithEmptyBody() + : base(parameter, anotherParameter___________________) { } + + public LongInitializerWithEmptyBody() + : base(parameter, anotherParameter__________________) { } + + public LongInitializerWithEmptyBody() + : base(parameter______________, anotherParameter___________________________________________) + { } +} + +public class Exactly100 +{ + public Exactly100() + : this(someParameter, someOtherParameter___________________________________________________) + { + WithBody(); + } + + public Exactly100(int longParameter____________________________________________________________) + { + return; + } + + // leading comments don't affect this + public Exactly100(int longParameter____________________________________________________________) + { + return; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.actual.test new file mode 100644 index 000000000..361866a89 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.actual.test @@ -0,0 +1,23 @@ +class Test +{ + public static implicit operator Test(string s) + { + return new Test(); + } + + public static implicit operator Test( + OtherPerson someReallyLongNameThatWillMakeThisBreak_________________ + ) + { + return new Test(); + } + + public static implicit operator Test(Person p) => + new Test(p.First + " " + p.Last); + + public static implicit operator Test(int x) => new Test(x); + + public static implicit operator Test( + bool reallyLongNameThatWillMakeThisBreak________________ + ) => new Test(x); +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.actual.test new file mode 100644 index 000000000..b3549ca37 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.actual.test @@ -0,0 +1,7 @@ +public class ClassName +{ + public void MethodName() + { + this.CallMethod(out var result); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.actual.test new file mode 100644 index 000000000..0b6b98b04 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + return default(T); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.actual.test new file mode 100644 index 000000000..87948bd2f --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + delegate void Delegate(); + + delegate void Delegate<[System.Obsolete()] out T>() + where T : struct; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.actual.test new file mode 100644 index 000000000..77d9f69c7 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.actual.test @@ -0,0 +1,5 @@ +class ClassName +{ + [SomeAttribute] + ~ClassName() { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.actual.test new file mode 100644 index 000000000..a2368476e --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.actual.test @@ -0,0 +1,99 @@ +#error Error message +#warning Warning new line test + +#pragma warning disable 414, 3021 +#pragma warning restore 3021 +#pragma checksum "file.txt" "{00000000-0000-0000-0000-000000000000}" "2453" +#define foo // Comment in directive +#if foo +#elif bar +#else +#endif +#undef foo +#line 6 + +class ClassName { } + +public class ClassName +{ + public bool SomeProperty => +#if !DEBUG + someValue + && // trailing comment with endif should work properly +#endif + someOtherValue; + + void MethodWithOnlyDisabled() + { +#if DEBUG + Console.WriteLine("Rosyln does not parse this because DEBUG is not defined"); +#endif + } + + void MethodWithDisabledAfterAnotherStatement() + { + var x = 1; +#if DEBUG + Console.WriteLine("Rosyln does not parse this because DEBUG is not defined"); +#endif + } +} + +namespace Namespace +{ +#pragma + using System.Linq; + +#pragma + class ExtraLineChecker { } +#pragma + class ExtraLineChecker2 + { +#pragma + void MethodName() { } + } +} + +public class ClassName +{ + public void MethodName() + { +#if !IF_STATEMENT_HERE_SHOULD_NOT_BREAK_INVOCATION_AFTER_ENDIF + if (true) + { + return; + } +#endif + SomeObject.CallMethod().CallOtherMethod(shouldNotBreak); + +#if IF_STATEMENT_HERE_SHOULD_NOT_BREAK_INVOCATION_AFTER_ENDIF + if (true) + { + return; + } +#endif + SomeObject.CallMethod().CallOtherMethod(shouldNotBreak); + } +} + +#if DIRECTIVES_AROUND_MODIFIERS_BREAK_CORRECTLY +public +#else +internal +#endif +static class ConditionallyPublic { } + +class EdgeCases +{ + void MethodWithNestedIfsDoesNotGetExtraLineBreak() + { +#if DEBUG + var x = 1; +#if NO_EXTRA_BREAK_ABOVE_ME + x = 2; +#endif +#endif + } +} + +// trivia at end of file should not get extra space in front of it diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.actual.test new file mode 100644 index 000000000..d2af6e393 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.actual.test @@ -0,0 +1,75 @@ +public class ClassName +{ +#if NET6_0_OR_GREATER + public void Method1() { } +#endif + + public void RemoveLineAbove() { } + +#if NET6_0_OR_GREATER + public void Method2() { } +#endif + + public void AddLineAbove() { } + +#if NET6_0_OR_GREATER + public void RemoveLineAbove() { } +#endif + + public void Method3() { } + +#if NET6_0_OR_GREATER + public void AddLineAbove() { } +#endif + + public void Method4() { } + +#if NET6_0_OR_GREATER + public void RemoveLineBelow() { } +#endif +} + +public class ClassName +{ +#if NET6_0_OR_GREATER + public void Method() { } +#endif + + public int AddLineAbove { get; set; } +} + +public class ClassName +{ +#if NET6_0_OR_GREATER + public void Method() { } +#endif + + /// Summary + public void AddLineAboveSummary() { } + +#if NET6_0_OR_GREATER + public void Method() { } +#endif + + // Comment + public void AddLineAboveComment() { } + +#if NET6_0_OR_GREATER + public void Method() { } +#endif + + // Comment + public void NoNewLineAbove() { } +} + +public class ClassName +{ +#if NET6_0_OR_GREATER + public void Method() { } +#endif + + public enum LineAbove + { + Member, + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.actual.test new file mode 100644 index 000000000..378678c5a --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.actual.test @@ -0,0 +1,19 @@ +#if NO_EXTRA_LINES +extern alias Foo1; +#else +extern alias Foo2; +#endif + +#if NO_EXTRA_LINES +using System.Net.Http; +#else +using System.Web.Routing; +#endif + +using System.Web.Http; + +#if KEEP_LINE_ABOVE +using System.Web.Http; +#endif + +namespace Namespace { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.actual.test new file mode 100644 index 000000000..e9827484c --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.actual.test @@ -0,0 +1,15 @@ +namespace FileScoped; + +#if NO_EXTRA_LINES +extern alias Foo1; +#else +extern alias Foo2; +#endif + +#if NO_EXTRA_LINES +using System.Net.Http; +#else +using System.Web.Routing; +#endif + +class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.actual.test new file mode 100644 index 000000000..dd120ac01 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.actual.test @@ -0,0 +1,16 @@ +namespace Namespace +{ +#if NO_EXTRA_LINES + extern alias Foo1; +#else + extern alias Foo2; +#endif + +#if NO_EXTRA_LINES + using System.Net.Http; +#else + using System.Web.Routing; +#endif + + class ClassName { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.actual.test new file mode 100644 index 000000000..91d23c91c --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.actual.test @@ -0,0 +1,42 @@ +public class ClassName +{ + #region Region + public int LongUglyMethod() => 42; + #endregion +} + +public class ClassName +{ + #region Region + public int LongUglyMethod() => 42; + + #endregion +} + +#region class +public class ClassName +{ + #region method + public void Method() + { + #region content + #endregion + } + #endregion +} +#endregion + +public class ClassName +{ + #region Region + private int x; // trailing comment here shouldn't give extra indent to the endregion after it + #endregion + + private int y; + + string RegionsIndentAndNewLineProperly = + #region one + @"using System;" + #endregion one + ; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.actual.test new file mode 100644 index 000000000..381879aae --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.actual.test @@ -0,0 +1,22 @@ +class ClassName +{ + void MethodName() + { + do + { + return; + } while (true); + + do x++; + while (x < 10); + + do + { + return; + } while ( + initialDepth - 1 < reader.Depth - (JsonTokenUtils.IsEndToken(reader.TokenType) ? 1 : 0) + && writeChildren + && reader.Read() + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.actual.test new file mode 100644 index 000000000..2ee16b9b2 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.actual.test @@ -0,0 +1,5 @@ +public class ClassName +{ + public string Value = Something[0]; + public string Value2 = Something["one"]; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.actual.test new file mode 100644 index 000000000..2e6b58049 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + var first = customers?[0]; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.actual.test new file mode 100644 index 000000000..843096388 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.actual.test @@ -0,0 +1,35 @@ +public class ClassName +{ + public void MethodName() + { + if (true) + { + DoIf(); + } + else + { + DoElse(); + } + + if (true) + { + DoIf(); + } + else if (false) + { + DoElse(); + } + + if (true) + { + DoIf(); + } + else if ( + jklasdfklalsdkfjlkasdflkaslkjfjsdkf + || kljadsfklaskldflkjasdfklaskjdfjklasdfjlkasdfjlkasdf + ) + { + DoElse(); + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.actual.test new file mode 100644 index 000000000..2cf8f57fd --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.actual.test @@ -0,0 +1,26 @@ +namespace Namespace +{ + public class RemovesLineBefore { } + + public class RemovesDoubledLines { } + + public class RemoveTrailingLine { } +} + +public class ClassName +{ + public int RemoveLineBefore; + + public int RemoveDoubleLines; + + public void MethodName() + { + var removeLineBefore = 1; + + var removeDoubleLines = 2; + + var removeTrailingLine = 3; + } + + public int RemoveTrailingLine; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.actual.test new file mode 100644 index 000000000..8729cc5fb --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.actual.test @@ -0,0 +1,21 @@ +public enum SubCode +{ + First, + + // force line + BasicComment, + + /* force line */ + MultiLineComment, + + /// force line + XmlComment, + + /// SingleLine + ExistingLine, + + DoNotKeepLine, + + [ForceLine] + ForceLine +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.actual.test new file mode 100644 index 000000000..82a392f7b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.actual.test @@ -0,0 +1,13 @@ +enum AnEnum +{ + One, + Two, + Three +} + +public enum E +{ + A, + B = A, + C = 2 + A +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.actual.test new file mode 100644 index 000000000..7a31f1c64 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.actual.test @@ -0,0 +1,13 @@ +class ClassName +{ + public readonly event Event E; + public event Action E1 + { + add { value = value; } + remove + { + E1 += Handler; + E -= Handler; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.actual.test new file mode 100644 index 000000000..b358fb8bf --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.actual.test @@ -0,0 +1,4 @@ +class ClassName +{ + public event EventHandler MyEvent = delegate { }; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.actual.test new file mode 100644 index 000000000..2684b1930 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.actual.test @@ -0,0 +1,15 @@ +// leading +extern alias Foo; // trailing + +// leading with line +extern // extern trailing +// alias leading +alias // alias trailing +Foo; + +extern alias Foo; + +namespace Namespace +{ + extern alias Bar; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.actual.test new file mode 100644 index 000000000..b1dd0df5d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.actual.test @@ -0,0 +1,116 @@ +public class ClassName +{ + private static const string SomeName = "1"; + public SomeClass SomeName; + + private string SomeFieldWithSadsfasdfasdfasdfuperLongNameYeahMan = + "kljasdfkljasdklfkjlasdfkjaskdlfasasdfasdfasdfasdfdfksdf"; + + private static readonly Regex FrontEndResourceRelativePathRegex = new Regex( + @".*?/Themes/.*?/.*?/(.*)", + RegexOptions.Compiled + | RegexOptions.CultureInvariant + | RegexOptions.IgnoreCase + | RegexOptions.MakeThisBreak + ); + + private SomeObject SomeLongerName = new SomeObject( + "lkjasdflkjasdfkljaskldjf", + "klasldkfaksdfasdfkjasdklf" + ) + { + Property1 = 1, + Property2 = 2 + }; + + private LotsOfParametersToCauseBreaking ShortFieldName = new LotsOfParametersToCauseBreaking( + "someValue", + "someOtherValue", + "anotherValue", + "yetAnotherValue" + ); + + private SomeReallyLongObjectName SomeReallyLongFieldName_____________ = + new SomeReallyLongObjectName("someValue", "someOtherValue"); + + private SomeReallyLongObjectName LongFieldNameAndLongParameters = new SomeReallyLongObjectName( + "someValue___________________", + "someOtherValue_____________________________________" + ); + + public ClassName Value = new ClassName + { + Property1 = true, + Property2 = false, + Property3 = false, + Property4 = false, + Property5 = false + }; + + // leading comments + private static const string SomeName = "1"; + + public SomeClass SomeName; // trailing comments + + public System.Text.StringBuilder NamespacedField; + + public Dictionary Property = + new Dictionary(); + + public Dictionary Property = + new Dictionary(); + + public static Dictionary< + SomeOtherLongTypeName_______________, + SomeOtherLongTypeName_______________ + > PropertiesByType = + new Dictionary(); + + public static Dictionary< + SomeOtherLongTypeName_______________________________, + SomeOtherLongTypeName_______________________________ + > PropertiesByType = + new Dictionary< + SomeOtherLongTypeName_______________________________, + SomeOtherLongTypeName_______________________________ + >(); + + private static readonly Func s_isVisualBasicCommentTrivia = ( + syntaxTrivia + ) => syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia); + + private Func SomeFieldFunc = (someValue) => true; + + private Func SomeFieldFunc = (someValue) => + SometimesBreaksThisWay(someValue); + + private Func SomeFieldFunc = (someValue) => + OrWhenLongerBreaksThisWay________(someValue); + + private Func SomeFieldFuncWithALongName_________ = + (someValue) => SomeOtherLongerMethod(someValue); + + private Func< + SomeLongObjectIn__________________________________, + bool + > SomeFieldFuncWithALongName = (someValue) => SometimesBreaksThisWay(someValue); + + private Func< + SomeLongObjectIn__________________________________, + bool + > SomeFieldFuncWithALongName = (someValue) => + SometimesBreaksThisWay(someValue, SomeOtherLongValue); + + private Func< + SomeLongObjectIn__________________________________, + bool + > SomeFieldFuncWithALongName = (someValue_____________________________) => + SometimesBreaksThisWay(someValue, SomeOtherLongValue); + + private Type OmittedTypes = typeof(OmittedTypes<,>); +} + +struct S +{ + fixed int field[10]; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.actual.test new file mode 100644 index 0000000000000000000000000000000000000000..7c1fc69a144cfd21063353d171846339424b3eb6 GIT binary patch literal 130 zcmezWuYjSHA&DV}A(J7QK>>(!7!nzZflz_L8P4_tisdq-GVn5RF;s&|1)w|#qUtVV j$OoE}0u=WJsxD#30P<59V7fIJG=VbJKwJwp1404-XUG-$ literal 0 HcmV?d00001 diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.actual.test new file mode 100644 index 000000000..ff8462d1f --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.actual.test @@ -0,0 +1,10 @@ +public class ClassName +{ + public void MethodName() { } +} + +public enum MeetingLocation +{ + Café, + Restaurant +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.actual.test new file mode 100644 index 000000000..0e622b6b7 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.actual.test @@ -0,0 +1,10 @@ +public class ClassName +{ + public void MethodName() { } +} + +public enum MeetingLocation +{ + Café, + Restaurant +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.actual.test new file mode 100644 index 000000000..ab4b151ca --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.actual.test @@ -0,0 +1,7 @@ +namespace Namespace; + +extern alias Foo; + +using System; + +class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.actual.test new file mode 100644 index 000000000..954bac0d4 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.actual.test @@ -0,0 +1,45 @@ +class ClassName +{ + void MethodName() + { + fixed (int* p = stackalloc int[100]) + { + *intref = 1; + } + + fixed ( + int* someLongNameThatWillMakeThisBreakYeahKeepGoing_____________________ = + stackalloc int[100] + ) + { + *intref = 1; + } + + fixed (int* exactly100_______________________________________________ = stackalloc int[100]) + { + return; + } + + // leading comment doesn't break differently + fixed (int* exactly100_______________________________________________ = stackalloc int[100]) + { + return; + } + + fixed ( + int* justOver100_______________________________________________ = stackalloc int[100] + ) + { + return; + } + + fixed (char* pSrcBegin = text) + fixed (char* pDstBegin = _bufChars) + { + char* pSrc = pSrcBegin; + } + + fixed (int* pIndices = &indices[0]) + InternalGetReference(&elemref, indices.Length, pIndices); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.actual.test new file mode 100644 index 000000000..cf5c86ce1 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.actual.test @@ -0,0 +1,123 @@ +public class ClassName +{ + public void MethodName() + { + foreach (var x in y) + { + x = 1; + } + + foreach ( + var x in this.SomeMethodCall() + .SomeChainedCall() + .AnotherChainedCall__________________________() + ) + { + break; + } + + foreach ( + var x // trailing + in y + ) + { + return; + } + + foreach (var exactly100 in Something_______________________________________________________) + { + return; + } + + // leading comment doesn't break differently + foreach (var exactly100 in Something_______________________________________________________) + { + return; + } + + // leading comment doesn't break differently + await foreach (var exactly100 in Something_________________________________________________) + { + return; + } + + foreach ( + var justOver100 in Something_______________________________________________________ + ) + { + return; + } + + // leading await + await + // leading using + foreach (var y in Something()) + { + return; + } + + foreach (var x in y) + CallSomething(x); + + foreach (var someLongerNameThatMakesThis in BreakAndLongName____________________) + CallSomething(x); + + foreach ( + var someLongerNameThatMakesThis in BreakInAnotherWay_______________________________________ + ) + CallSomething(x); + + foreach (var x in y) + switch (x) + { + case 1: + return; + } + + foreach (var (x, y) in thing) + { + this.DoOtherThing(); + } + + foreach ( + ( + (int l2, int l3), + (int longName________________________, string[] anotherLongName___________) + ) in ( + from l2 in Enumerable.Range(1, 7) + from l3 in Enumerable.Range(1, 7) + select (l2, l3) + ) + .AsParallel() + .Select(l => (l, res: GenerateTable(l.l2, l.l3, cutOff))) + .OrderBy(v => v.res.Total) + ) + { + return; + } + + foreach (var x in y) + { + continue; + } + + foreach (var x in y) + { + KeepNewLine(); + + continue; + } + + foreach (var x in y) + { + break; + } + + foreach (var x in y) + { + KeepNewLine(); + + break; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.actual.test new file mode 100644 index 000000000..17e093e4b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.actual.test @@ -0,0 +1,10 @@ +class ClassName +{ + void MethodName() + { + foreach (var (x, y) in thing) + { + this.DoOtherThing(); + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.actual.test new file mode 100644 index 000000000..ca1319ec8 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.actual.test @@ -0,0 +1,104 @@ +class ClassName +{ + void MethodName() + { + for (var x = 0; x < 100; x++) + { + break; + } + + var y = 0; + for (y = 0; y < 100; y++) + { + break; + } + + for (; ; ) + { + break; + } + + for (var x = 1; ; ) + { + break; + } + + for (var x = 1; x < 0; ) + { + break; + } + + for (var x = 1; ; x++) + { + break; + } + + for (var x = 0; x < 100; x++) + break; + + for (var someLongerValue = 0; someLongerValue____________________ < 1; someLongerValue++) + Call(SomeLongerValue); + + for ( + var someLongerValue__________ = 0; + someLongerValue__________ < 1; + someLongerValue__________++ + ) + Call(someLongerValue__________); + + for (int i = 0, j = 0; i < length; i++, j++) + { + break; + } + + for ( + var shorterName = 0; + someLongName____________ + < someOtherLongName__________________________________________________; + someLongishName_________________________++ + ) + { + break; + } + + for ( + var someShortName = 0, anotherShortName = 1; + someRandomCondition; + someShortName++, anotherShortName++ + ) + { + break; + } + + for ( + var someLongerName_________________________ = 0, + anotherLongerName________________________________ = 1; + someRandomCondition; + someLongerName_________________________++, + anotherLongerName________________________________++ + ) + { + break; + } + + for (y = 0; y < exactly100____________________________________________________________; y++) + { + break; + } + + // leading comment doesn't break differently + for (y = 0; y < exactly100____________________________________________________________; y++) + { + break; + } + + for ( + y = 0; + y < justOver100____________________________________________________________; + y++ + ) + { + break; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.actual.test new file mode 100644 index 000000000..83ac44eda --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.actual.test @@ -0,0 +1,26 @@ +class ClassName +{ + public unsafe void RegisterCallbacks( + delegate* unmanaged< + IntPtr, + IntPtr, + NativeMethods.REQUEST_NOTIFICATION_STATUS> requestCallback, + delegate* unmanaged shutdownCallback, + delegate* unmanaged disconnectCallback, + delegate* unmanaged< + IntPtr, + int, + int, + NativeMethods.REQUEST_NOTIFICATION_STATUS> asyncCallback, + delegate* unmanaged requestsDrainedHandler, + IntPtr pvRequestContext + ) + { + return; + } + + public static extern unsafe int InvokeCallbackFuncPtr_Inline_NoGCTransition( + delegate* unmanaged[Cdecl] cb, + int* n + ); +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.actual.test new file mode 100644 index 000000000..047e21e54 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.actual.test @@ -0,0 +1,10 @@ +GlobalStatement(); + +WithNewLine(); +WithNoNewLine(); + +// comment +WithComment(); + +#error Error +WithDirective(); diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.actual.test new file mode 100644 index 000000000..eb66b7ab2 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.actual.test @@ -0,0 +1,82 @@ +public class ClassName +{ + public void MethodName() + { + if (true) + { + return; + } + + if (true == false) { } + + if (true && false) { } + + if (true) + DoSomething(); + else if (false) + DoSomething(); + else + DoSomething; + + if (true) + while (true) + foreach (var x in y) + CallMethod(x); + + if (someLongCondition != someOtherCondition) + DoSomeLongMethodCall_________________________(); + else if (someLongCondition == someOtherCondition) + DoSomeLongMethodCall_________________________(); + else + DoSomeLongMethodCall________________________________________(); + + if ( + longStatementName + && longerStatementName + && evenLongerStatementName + && superLongStatementName + ) + { + return; + } + + if ( + longStatementName + && longerStatementName + && evenLongerStatementName + && superLongStatementName + ) + return; + + if (!true) { } + + if (true != false) { } + + if (true || false) { } + + if (true && (true || false)) { } + + if (exactly100 || moreTextToMakeItWork_____________________________________________________) + { + return; + } + + // leading comment doesn't break differently + if (exactly100 || moreTextToMakeItWork_____________________________________________________) + { + return; + } + + if ( + justOver100 || moreTextToMakeItWork_____________________________________________________ + ) + { + return; + } + + if (true) + { + // indent + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.actual.test new file mode 100644 index 000000000..8ca35c9c9 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.actual.test @@ -0,0 +1,36 @@ +class ClassName +{ + int[] array = new[] { 1, 2 }; + + int[,] array = new[,] + { + { 1, 2 }, + { 3, 4 } + }; + + private string[] SomeArray = new[] + { + "SomeValue_____________________", + "SomeValue_____________________", + }; + + public HashSet TheArrayShouldNotBreak = new HashSet( + new[] { ".dll", "exe", ".winmd" }, + StringComparer.OrdinalIgnoreCase + ); + + void MethodName() + { + var implicitArrayShouldBreak = new[] + { + "someLongValue", + "anotherLongValue", + "yetAnotherLongValue" + }; + + return TheArrayInHereShouldAlsoNotBreak( + SomeLongThing__________, + new[] { one, two, three, found } + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.actual.test new file mode 100644 index 000000000..3cd5c8fa2 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.actual.test @@ -0,0 +1,10 @@ +class ClassName +{ + Dictionary dictionary = new Dictionary { [1] = "one", [2] = "two" }; + + Dictionary dictionary = new Dictionary + { + [1] = "one", + [2] = "two_______________________" + }; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.actual.test new file mode 100644 index 000000000..661ed7023 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + Span a = stackalloc[] { 1, 2, 3 }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.actual.test new file mode 100644 index 000000000..e860afa0a --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.actual.test @@ -0,0 +1,4 @@ +abstract class ClassName +{ + abstract int this[int index] { get; set; } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.actual.test new file mode 100644 index 000000000..fd4cd4e0d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.actual.test @@ -0,0 +1,242 @@ +class ClassName +{ + int[] array = { 1, 2 }; + + int[] array = + { + "someLongValue_____________________________________", + "someLongValue_____________________________________" + }; + + int[] array = new int[] + { + "someLongValue_____________________________________", + "someLongValue_____________________________________" + }; + + public IList Value = new List { "one", "two" }; + + Dictionary dictionary = new Dictionary + { + { 1, "one_________" }, + { 2, "two_________________" } + }; + + Dictionary dictionary = new Dictionary + { + // should break braces correctly + { 1, "one" }, + { 2, "two" }, + { + 3, + "ifThisIsReallyLongItShouldntInsertAnExtraLineAboveIt_________________________________" + } + }; + + private int[,] arrayInitializerWithoutSize = + { + // leading comment should not interfere with the next line breaking + { + longValue______________________________, + longValue______________________________, + longValue______________________________ + }, + { + longValue______________________________, + longValue______________________________, + longValue______________________________ + } + }; + + void MethodName() + { + var x = new SomeClass + { + Property1 = true + // should indent + }; + + var x = new OneProperty { One = true }; + var x = new TwoProperties { One = true, Two = true }; + var x = new ThreeProperties + { + One = true, + Two = true, + Three = true + }; + + var objectInitializerExpression = new SomeObject() + { + ShouldNotBreak = { SomeProperty = SomeValue }, + ShouldBreak = + { + SomeOtherProperty = SomeLongValue_______________________________________ + }, + SomeList = new List() + { + new() { SomeProperty = SomeLongValue_____________ }, +# pragma this should not affect the breaking of the next line + new() { SomeProperty = SomeLongValue_____________ }, + new() + { + SomeProperty = SomeOtherValue, + AnotherProperty = SomeThirdValue_______________________ + } + } + }; + + var someObject = new SomeObject + { + SomeProperty = + { + someOtherValue__________________________________________________________________ + } + }; + + var collectionInitializerExpressions = new SomeObject + { + ThisIsACollection = { one, two }, + ThisIsAlsoACollection = + { + longerValueThatMakesItBreak______________________, + longerValueThatMakesItBreak______________________ + }, + }; + + var emptyInitializer = new SomeObject[] { }; + + var emptyInitializer = new Thing { One = 1 }; + + var nestedInitializer = new Thing + { + One = 1, + Two = new Thing { One = 1 } + }; + + var nestedInitializer = new List() + { + new Thing() { One = 1 }, + new Thing() { One = 1 } + }; + + var nestedInitializer = new Thing + { + One = 1, + Two = new() { One = 1 } + }; + + var nestedInitializer = new List() + { + new() { One = 1 }, + new() { One = 1 } + }; + + var noBreak = new List { new Thing { One = 1 } }; + var yesBreak = new List + { + new Thing { One = 1, Two = 2 } + }; + var yesBreak = new List + { + new Thing { One = 1 }, + Two = 2 + }; + + var listInitializer = new List { 1, 2, 3 }; + var dictionaryInitializer = new Dictionary + { + { 1, "" }, + { 2, "a" }, + { 3, "b" } + }; + int[,,] cube = + { + { + { 111, 112 }, + { 121, 122 } + }, + { + { 211, 212 }, + { 221, 222 } + } + }; + int[][] jagged = + { + { 111 }, + { 121, 122 } + }; + + var conditionalsAndInvocations = new List + { + this.CallSomeMethod________________________________________() + .CallSomeMethod________________________________________() + ? one + : two, + SomeOtherMethod(), + SomethingElse + .CallSomeMethod________________________________________() + .CallSomeMethod________________________________________() + ? one + : two, + SomeOtherMethod(), + this.CallSomeMethod________________________________________() + .CallSomeMethod________________________________________(), + someLongCondition___________________________________ + && someLongCondition___________________________________ + ? one + : two + }; + + var someObject = new SomeObject + { + SomeArray = new SomeOtherObject[] + { + new SomeOtherObject { SomeProperty = 1 }, + new SomeOtherObject() + } + .CallMethod() + .CallMethod() + }; + + var result = SomeType + .CallMethod() + .CallOtherMethod(someParameter, new SomeObjectType().SomeProperty.SomeOtherProperty); + + var someObject = new SomeObject + { + SomeArray = new SomeOtherObject + { + new SomeOtherObject { SomeProperty = 1 }, + new SomeOtherObject() + } + .CallMethod() + .CallMethod() + }; + + var someObject = new SomeObject + { + SomeArray = new SomeOtherObject[] + { + new SomeOtherObject { SomeProperty = 1 }, + new SomeOtherObject() + } + }; + + var someObject = new SomeObject + { + SomeArray = new SomeOtherObject[] + { + new SomeOtherObject_________________________________(), + new SomeOtherObject_________________________________() + } + .CallMethod() + .CallMethod() + }; + } + + private SomeObject someObject = + new(someLongParameter___________________) + { + SomeProperty = someLongValue____________________________ + }; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.actual.test new file mode 100644 index 000000000..cabfbf13c --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.actual.test @@ -0,0 +1,14 @@ +public interface BasicInterface +{ + string Property { get; set; } +} + +public interface BasicInterface : BaseInterface { } + +public interface BasicInterface +{ + void SomeMethod(); + static abstract void SomeOtherMethod(); +} + +interface CoContra { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.actual.test new file mode 100644 index 000000000..010431fa9 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.actual.test @@ -0,0 +1,28 @@ +public class ClassName +{ + public string Test = $"test"; + + public string LeadingCommentWithInterpolatedString = + $"one" + + + // comment stays on this line + $"two"; + + public string TwoValues = $"{SomeValue}{SomeOtherValue}"; + + public string ForceFlatInString = + $"{SomeValue}{CallSomeLongMethodWithBiParameters(jlkasdfkljasdflkaskdf, jkasdflkjasdfsdkaljfasdkjf)}"; + + public string Test2 = CallSomeLongMethodWithBiParameters( + $"some super long interpolated string with some substitions like {jkasdflkjasdfsdkaljfasdkjf}", + $"another long interpolated string with some substitions like {jlkasdfkljasdflkaskdf}" + ); + + void AlignmentAndFormat() + { + var s1 = $"x {1, -2:d}"; + var s2 = $"x {1, -2}"; + var s3 = $"x {1:d}"; + var trailingComment = $"{someValue /* Comment shouldn't cause new line */}"; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.actual.test new file mode 100644 index 000000000..a1ababd92 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.actual.test @@ -0,0 +1,242 @@ +class ClassName +{ + void MethodName() + { + this.DoSomething().DoSomething(); + + this.DoSomething___________________() + .DoSomething___________________() + .DoSomething___________________(); + + this.DoSomething___________________() + ?.DoSomething___________________() + ?.DoSomething___________________(); + + this.DoSomething___________________()! + .DoSomething___________________()! + .DoSomething___________________(); + + base.DoSomething___________________() + .DoSomething___________________() + .DoSomething___________________(); + + AnIdentifier + .DoSomething___________________() + .DoSomething___________________() + .DoSomething___________________(); + + this.Method( + someParameter__________________________________, + someParameter__________________________________ + ); + + this.SomeMethod( + SomeOtherMethod(parameter__________________________________________________) + ); + + var superLongName____________________________________ = + someOtherName.CallSomeMethod________________(); + + var superLongName_______________ = someOtherName____________ + .CallSomeMethod______________() + .CallSomeMethod______________(); + + var someValue = someOtherValue.Where(o => someLongCondition).Where(o => someLongCondition); + + var someValue = someOtherValue + .Where(o => someLongCondition__________________________) + .Where(o => someLongCondition__________________________); + + var someValue = someOtherValue! + .Where(o => someLongCondition__________________________) + .Where(o => someLongCondition__________________________); + + var someValue = someOtherValue!.Thing! + .Where(o => someLongCondition__________________________) + .Where(o => someLongCondition__________________________); + + var someValue = someOtherValue.Thing + .Where(o => someLongCondition__________________________) + .Where(o => someLongCondition__________________________); + + var someValue = someOtherValue + .Where(o => someLongCondition__________________________) + .Where(o => someLongCondition__________________________) + .Where(o => someLongCondition__________________________); + + roleNames + .ToList() + .Where(o => someLongCondition) + .Where(o => someLongCondition) + .Where(o => someLongCondition); + + this.SomeMethod( + SomeOtherMethod(parameter__________________________________________________) + ); + + roleNames + .ToList() + .ForEach( + role => + this.SomeProperty.Setup(o => longThing_______________________________________) + ); + + roleNames.Value + .Where(o => o.SomeProperty____________________________________) + .Select(o => o.SomethingElse); + + return someCondition + ? CallMethod( + someLongParameter____________________________, + someLongParameter____________________________ + ) + : Something.CallMethod( + someLongParameter____________________________, + someLongParameter____________________________ + ); + + someValue.CallMethod( + someLongParameter____________________________, + someLongParameter____________________________ + ); + + someValue!.CallMethod( + someLongParameter____________________________, + someLongParameter____________________________ + ); + + CallSomeMethod( + someParameter____________________________________, + someParameter____________________________________ + )!; + + var someVariable = someObject.Property.CallMethod( + someValue => someValue.SomeProperty == someOtherValue___________________________________ + ); + + CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ); + + CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ); + + // comment shouldn't do weird stuff + CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ); + + this.CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ); + + string.CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ); + + o.CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ) + .CallMethod( + firstParameter____________________________, + secondParameter___________________________ + ); + + CallMethod( + one__________________________________, + two__________________________________ + ) + .CallMethod( + one__________________________________, + two__________________________________ + ); + + SomeObject + ?.CallMethod(parameter_______________________________________________________________) + .ToArray(); + + SomeObject + .CallMethod(parameter_______________________________________________________________) + .ToArray(); + + // comment shouldn't do weird stuff + SomeObject.CallMethod(); + + CallMethod(lambdaWithBlock => + { + return; + }) + .CallMethod() + .CallMethod(); + + someObject.CallMethod(lambdaWithBlock => + { + return; + }); + + o.CallMethod(parameter_____________, parameter_____________) + .CallMethod(parameter_____________, parameter_____________); + + this.CallMethod() + .CallMethod__________________(one_____________________, two_____________________); + + var someValue = CallMethod__________________(longParameter________________________________)! + .CallMethod__________________(); + + var someValue = CallMethod__________________(longParameter________________________________) + .CallMethod__________________(); + + var someValue = CallMethod__________________( + longParameter_______________________________________ + )! + .CallMethod__________________(); + + var someValue = CallMethod__________________( + longParameter_______________________________________ + ) + .CallMethod__________________(); + + someThing_______________________.Property + .CallMethod__________________() + .CallMethod__________________(); + + someThing_______________________?.Property + .CallMethod__________________() + .CallMethod__________________(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.actual.test new file mode 100644 index 000000000..63613303b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + var x = null is object; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.actual.test new file mode 100644 index 000000000..c59da45bc --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.actual.test @@ -0,0 +1,242 @@ +class ClassName +{ + void MethodName() + { + if (expr is Type v) + { + return; + } + + if (expr is not null) + { + return; + } + + if (expr is < 'A' or > 'Z') + { + return; + } + + Debug.Assert(result is Exception or IPAddress[] or IPHostEntry); + + if (expr is string { Length: 5 } s) + { + return; + } + + if (expr is { Length: 5 }) + { + return; + } + + if ( + expr is + { + SomeProperty: "someValue________________", + SomeOtherProperty: "someOtherValue______________" + } + ) + { + return; + } + + var useLine = + node.OperatorToken.Kind() + is SyntaxKind.BarBarToken + or SyntaxKind.BarToken + or SyntaxKind.AmpersandAmpersandToken + or SyntaxKind.AmpersandToken + or SyntaxKind.PlusToken; + + if ( + someRandomValue___________________ is SomeRandomType someRandomType + && someRandomType.IsEnum + ) + { + return; + } + + if (x is Y { NoExtraSpaceAfterThisNextBrace: true } && newGroup) + { + return; + } + + if (expr is { } noExtraSpaceBeforeOpenBrace) + { + return; + } + + if ( + someValue_________________________ is SomeType_________________ someType + && someType.SomeProperty + ) { } + + var value = someOtherValue is { Property: true }; + + var value = + someOtherValue + is SomeType___________________ + { + SomeProperty: SomeOtherType_____________________________________________ + } + or SomeThirdType___________; + + var value = + someOtherValue + is SomeType___________________ + { + SomeProperty: SomeOtherType_____________________________________________, + AnotherProperty: SomeType + } + or SomeThirdType___________; + + var value = + someOtherValue + is SomeType___________________ { SomeProperty: SomeType or SomeOtherType }; + + var value = + someOtherValue + is SomeType___________________ + { + SomeProperty: SomeLongType_______________ + or SomeOtherLongType___________________ + }; + + var value = + someOtherValue + is SomeType___________________ + or SomeOtherType___________________ + or SomeThirdType___________ + && someLongValue_________________; + + if (someOtherValue is (SomeType or SomeOtherType)) + { + return; + } + + if (someOtherValue is not (SomeType or SomeOtherType)) + { + return; + } + + if ( + someOtherValue_____________ + is (SomeLongType_____________ or SomeOtherLongType_____________) + ) + { + return; + } + + if ( + someOtherValue_____________ + is not (SomeLongType_____________ or SomeOtherLongType_____________) + ) + { + return; + } + + if ( + someOtherValue_____________ + is ( + SomeLongType_____________________________________ + or SomeLongType_____________________________________ + ) + ) + { + return; + } + + if ( + node is SomeType_______________ + { + SomeProperty: SomeOtherType_____________________________ + } + ) + { + return; + } + + if ( + node is PrefixUnaryExpressionSyntax + { + Operand: ParenthesizedExpressionSyntax + { + Expression: IsPatternExpressionSyntax or IsPatternExpressionSyntax + }, + } + ) + { + return; + } + + if ( + node is PrefixUnaryExpressionSyntax + { + Operand: + { + Expression: IsPatternExpressionSyntax or IsPatternExpressionSyntax______________ + }, + } + ) + { + return; + } + + if ( + !( + node is PrefixUnaryExpressionSyntax + { + Operand: ParenthesizedExpressionSyntax or IsPatternExpressionSyntax + } + ) + ) + { + return; + } + + if ( + someLongName____________________________________________________ is + { } anotherLongName______________________ + ) + { + return; + } + + if ( + someLongVariableName____________ + is SomeLongTypeName______________________________ someOtherLongVariableName_____________ + ) + { + return; + } + + if ( + someArray[index] + is SomeLongTypeName______________________________ someOtherLongVariableName_____________ + ) + { + return; + } + + if ( + someLongName_____________ + is SomeObjectType + or SomeOtherObjectType + or YetAnotherObjectType + ) + { + return; + } + + if ( + someCondition + && someLongName_____________ + is { Kind: SomeObjectType, Value: "___________________________________" } + ) { } + + if (expr is { Property.Length: 5 }) + { + return; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.actual.test new file mode 100644 index 000000000..6ecaaf582 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.actual.test @@ -0,0 +1,8 @@ +class ClassName +{ + void MethodName() + { + label: + goto label; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.actual.test new file mode 100644 index 000000000..91dd93d0d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.actual.test @@ -0,0 +1,21 @@ +var someValue = someArray is [1, 2, 3]; + +var someValue = + triviaToMove + is [ + .., + { RawKind: (int)SyntaxKind.SingleLineCommentTrivia }, + { RawKind: (int)SyntaxKind.SingleLineCommentTrivia }, + { RawKind: (int)SyntaxKind.EndOfLineTrivia } + ]; + +var someValue = someString is [var firstCharacter, .. var rest]; + +var someValue = + someLongerStringString + is [ + var firstCharacter____________, + var secondCharacter__________, + var thirdCharacter, + .. var rest + ]; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.actual.test new file mode 100644 index 000000000..2b35caa60 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.actual.test @@ -0,0 +1,9 @@ +public class ClassName +{ + public void MethodName() + { + bool x; + + bool y = true; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.actual.test new file mode 100644 index 000000000..d22b305f5 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.actual.test @@ -0,0 +1,20 @@ +public class ClassName +{ + public void MethodName() + { + void LocalFunction() + { + return; + } + + void LocalFunctionWithParameters( + string one, + string two, + string three, + string four_______________ + ) + { + return; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.actual.test new file mode 100644 index 000000000..3d7fb2ec2 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.actual.test @@ -0,0 +1,13 @@ +class ClassName +{ + void MethodName() + { + lock (sync) + process(); + + lock (sync) + { + process(); + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.actual.test new file mode 100644 index 000000000..c476d9e4b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + TypedReference tr = __makeref(c); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.actual.test new file mode 100644 index 000000000..db5255506 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.actual.test @@ -0,0 +1,17 @@ +class ClassName +{ + void MethodName() + { + this.SomeProperty____________________________________________ + .SomeProperty____________________________________________ + .SomeProperty____________________________________________; + + this.SomeProperty____________________________________________! + .SomeProperty____________________________________________! + .SomeProperty____________________________________________; + + this.SomeProperty____________________________________________ + ?.SomeProperty____________________________________________ + ?.SomeProperty____________________________________________; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.actual.test new file mode 100644 index 000000000..0fdcbbb01 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.actual.test @@ -0,0 +1,160 @@ +public class ClassRules +{ + public void NeverLineBeforeFirstMember() { } + + public void AlwaysLineBetweenMethods() { } + + public void EvenWithLambdaBody() => ""; + + private enum AlwaysLineBeforeEnum + { + One, + Two + } + + private enum NoDoubleLines + { + One, + Two + } + + private class AlwaysLineBeforeClass { } + + private class NoDoubleLines { } + + private interface IAlwaysLineBeforeInterface { } + + private interface INoDoubleLines { } + + public ClassRules() { } + + public ClassRules() { } + + public ~ClassName() { } + + public ~ClassName() { } + + public static implicit operator ClassRules(string s) + { + return new Test(); + } + + public static implicit operator ClassRules(int i) + { + return new Test(); + } + + public record SomeRecord1(string property); + + public record SomeRecord2(string property); + + public struct SomeStruct1 { } + + public struct SomeStruct2 { } + + static ClassRules operator +(ClassRules a, ClassRules b) + { + return a.Add(b); + } + + static ClassRules operator -(ClassRules a, ClassRules b) + { + return a.Subtract(b); + } + + private string FieldsCanBeGroupedBecauseLinesWillBeKept; + private string ButLinesAreNotForcedHere; + + // comments force a line + private string FieldWithComment; + + /* comments force a line */ + private string FieldWithComment; + + /// comments force a line /// + private string FieldWithComment; + + [AttributesForceALine] + private string FieldWithAttribute; + + private string PropertiesCanBeGrouped { get; set; } + private string BecauseTheyDontForceLines { get; set; } + + // comments force a line + private string PropertyWithComment; + + [AttributesForceALine] + private string PropertyWithAttribute; + + delegate void DelegatesAreLikeFields(); + delegate void AndCanBeGrouped(); + + // comments force a line + delegate void DelegateWithComment(); + + [AttributesForceALine] + delegate void DelegateWithAttribute(); + + public void AlwaysLineBetweenMethods() { } + + private string FieldAfterMethodGetsLine; + +#if EDGE_CASE_SHOULD_KEEP_LINE_ABOVE_METHOD + private string Field; +#else + private string Field; +#endif + + public void SomeMethod() { } + +#pragma warning disable 0618 + public void KeepLineAboveAndBelow() { } +#pragma warning restore 0618 + + public void SomeMethod() { } +} + +public class LineBeforeClass { } + +public interface InterfaceRulesAreLikeClassesButMethodsFollowTheFieldRulesAbove +{ + void NeverLineHere(); + + void ExistingLineHereIsKept(); + void ButNoLineIsAdded(); + + // comments do force a line + void MethodWithComment(); +} + +abstract class AbstractClass +{ + abstract void NoLineHere() { } + + abstract void KeepTheLineHere(); + abstract void DoNotForceTheLineHere(); + + void ButForceLineForRealMethod() { } +} + +public class ClassName +{ + private string someField1; + +#if KEEP_LINE_ABOVE + private string someField2; +#endif + + private string someField2; +} + +public class ClassName +{ + #region RegionWithSpaceBeforeAndAfterMethod + + void SomeMethod() { } + + #endregion + + void SomeMethod() { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.actual.test new file mode 100644 index 000000000..d19b435f7 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.actual.test @@ -0,0 +1,124 @@ +public class ClassName +{ + public void MethodName() { } + + public void LongMethodNameKeepsEmptyBraces__________________________________________________________() { } + + public void LongMethodNameKeepsEmptyBraces__________________________________________________________() + { + // comment + } + + public void LongMethodNameForceLineBreak( + string firstParameter___________, + string secondParameter___________, + string thirdParameter___________ + ) + { + return; + } + + public void LongMethodNameForceLineBreaks___________________________( + string one, + string two, + string three + ) { } + + public void ReallyLongMethodNameWithoutAnyParametersShouldNewLineBrace_______() + { + return; + } + + public void MethodName( + // leading + string one, // trailing + string two, + string three + ) + { + var x = 0; + } + + public void MethodName(string one, string two) { } + + public void MethodName() + { + MethodName(); + MethodName(); + } + + private Doc MethodWithParameters__________________( + SomeClass one, + SomeClass two, + SomeClass three + ) => CallSomethingElseWithALongNameThatForcesABreak_________(one, two, three); + + private Doc ShortMethod() => Method(); + + private Doc ShortishMethod(SomeClass one) => + CallSomeOtherLongMethodSoThatItBreaks____________________(one); + + private Doc MethodWithParameters_______________________( + SomeClass one, + SomeClass two, + SomeClass three + ) => CallSomething(one, two, three); + + private void MethodWithEmptyBlockShouldNotGetExtraSpace() + { + { + return; + } + } + + public void MethodName() + { + var keepNextExtraLine = 1; + + { + return; + } + } +} + +class ExplicitInterfaceSpecifier : IDisposable +{ + void IDisposable.Dispose() { } +} + +namespace SomeNamespace +{ + public class ClassName + { + public void Exactly100(IApplicationBuilder app, IWebHostEnvironment env____________________) + { + return; + } + + // leading comments don't affect modifiers + public void Exactly100(IApplicationBuilder app, IWebHostEnvironment env____________________) + { + return; + } + + // leading comments don't affect void + void Exactly100(IApplicationBuilder app, IWebHostEnvironment env___________________________) + { + return; + } + + // leading comments don't affect type + IList Exactly100(IApplicationBuilder app, IWebHostEnvironmet env___________________) + { + return; + } + + public void JustOver100( + IApplicationBuilder app, + IWebHostEnvironment env____________________ + ) + { + return; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.actual.test new file mode 100644 index 000000000..4ce15dbbc --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.actual.test @@ -0,0 +1,20 @@ +namespace EmptyNamespace { } + +// leading +namespace Namespace { } // trailing + +// leading with line +namespace // trailing keyword +// leading identifier +Namespace // trailing identifier +// leading semi start +{ // trailing semi start + // leading semi end +} // trailing semi end + +namespace NamespaceWithUsingAndClass +{ + using System; + + public class BasicClass { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.actual.test new file mode 100644 index 000000000..128fdb15b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.actual.test @@ -0,0 +1,4 @@ +public class BasicClass +{ + private Guid? NullableGuidField; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.actual.test new file mode 100644 index 000000000..fa5a1509d --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.actual.test @@ -0,0 +1,43 @@ +public class ClassName +{ + public ClassName Basic = new ClassName(); + + public ClassName WithInitializer = new ClassName { Property = true }; + + public ClassName WithMediumInitializer = new ClassName + { + Property_____________________________ = true + }; + + public ClassName WithBigInitializer = new ClassName + { + Property1 = true, + Property2 = false, + Property3 = false, + Property4 = false, + Property5 = false + }; + + public ClassName TrailingComma = new ClassName_______________________ + { + Property1 = true, + Property2 = true, + }; + + public ClassName WithConstructorAndInitializer = new ClassName(false) + { + Property1 = true, + Property2 = false, + }; + + public ClassName WithComplexConstructor = new ClassName( + "parameter1", + new ClassName("parameter1", "parameter2") { Property1 = true } + ) + { + Property1 = true + }; + + public SomeGenericObject WithGenericLongEnoughToBreak = + new SomeGenericObject("someRandomValue"); +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.actual.test new file mode 100644 index 000000000..f8111650a --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.actual.test @@ -0,0 +1,162 @@ +// these are here so we can see how they change over time, see https://github.com/belav/csharpier/issues/272 +// try to clean these up if you are modifying formatting that affects them. +class ClassName +{ + public readonly StackObjectPool< + Dictionary + > KeyedItemInfoDictionaryPool_____; + + internal StackObjectPool< + Dictionary + > KeyedItemInfoDictionaryPool { get; } = + new StackObjectPool>( + maxPreservedItems: 10, + () => new Dictionary() + ); + + RenderFragment customNotAuthorized = state => + builder => builder.AddContent(0, $"Go away, {state.User.Identity.Name}"); + + public List<( + ClaimsPrincipal user, + object resource, + IEnumerable requirements + )> AuthorizeCalls { get; } = + new List<( + ClaimsPrincipal user, + object resource, + IEnumerable requirements + )>(); + + private static readonly Action _displayingNotFound = + LoggerMessage.Define( + LogLevel.Debug, + new EventId(1, "DisplayingNotFound"), + $"Displaying {nameof(NotFound)} because path '{{Path}}' with base URI '{{BaseUri}}' does not match any component route" + ); + + private static readonly Action< + ILogger, + Type, + string, + string, + Exception + > _navigatingToComponent = LoggerMessage.Define( + LogLevel.Debug, + new EventId(2, "NavigatingToComponent"), + "Navigating to component {ComponentType} in response to path '{Path}' with base URI '{BaseUri}'" + ); + + public void MethodName() + { + builder_________________.OpenComponent< + SecondCascadingParameterConsumerComponent + >(0); + } + + public static IRemoteAuthenticationBuilder< + RemoteAuthenticationState, + RemoteUserAccount + > AddAccountClaimsPrincipalFactory< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] + TAccountClaimsPrincipalFactory + >(this IRemoteAuthenticationBuilder builder) + where TAccountClaimsPrincipalFactory : AccountClaimsPrincipalFactory => + builder.AddAccountClaimsPrincipalFactory< + RemoteAuthenticationState, + RemoteUserAccount, + TAccountClaimsPrincipalFactory + >(); + + private static readonly Action ActionNotImplemented = + new Action(_ => + { + throw new NotImplementedException(); + }); + + public void MapFrom(Func mappingFunction) + { + if (true) + { + PropertyMapActions.Add(pm => + { + Expression> expr = + (src, dest, destMember, ctxt) => mappingFunction(src, dest, destMember); + + pm.CustomMapFunction = expr; + }); + } + } + + public void Condition( + Func, bool> condition + ) => + PathMapActions.Add(pm => + { + Expression< + Func + > expr = (src, dest, srcMember, destMember, ctxt) => + condition( + new ConditionParameters( + src, + dest, + srcMember, + destMember, + ctxt + ) + ); + pm.Condition = expr; + }); + + public override Type SourceType + { + get => + _sourceType ??= + CustomMapExpression?.ReturnType + ?? CustomMapFunction?.ReturnType + ?? ( + _sourceMembers.Length > 0 + ? _sourceMembers[_sourceMembers.Length - 1].GetMemberType() + : Parameter.ParameterType + ); + protected set => _sourceType = value; + } + + public static Expression IfNullElse( + this Expression expression, + Expression then, + Expression @else + ) => + expression.Type.IsValueType + ? ( + expression.Type.IsNullableType() + ? Condition(Property(expression, "HasValue"), ToType(@else, then.Type), then) + : @else + ) + : Condition(ReferenceEqual(expression, Null), then, ToType(@else, then.Type)); + + private bool VisitChildForCompare(Pair tuple, ref int result) + { + int r; + return 0 + != ( + result = + (null == tuple.Item1) + ? -1 + : (null == tuple.Item2) + ? +1 + : 0 + != (r = comparer.Compare(tuple.Item1.LocalName, tuple.Item2.LocalName)) + ? r + : 0 + != ( + r = comparer.Compare( + tuple.Item1.NamespaceURI, + tuple.Item2.NamespaceURI + ) + ) + ? r + : 0 + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.actual.test new file mode 100644 index 000000000..91a186b8b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.actual.test @@ -0,0 +1,21 @@ +class ClassName +{ + static Complex operator +(Complex a, Complex b) + { + return a.Add(b); + } + + static Complex operator -( + Complex someOverlyLongNameToForceBreak, + Complex someOverlyLongNameToForceBreak2 + ) + { + return a.Add(b); + } + + static Complex operator checked -(Complex value); + + static BigInteger IUnaryNegationOperators.operator checked -( + BigInteger value + ) => -value; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.actual.test new file mode 100644 index 000000000..a1248d1b5 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.actual.test @@ -0,0 +1,16 @@ +class ClassName +{ + void MethodName() + { + var x = + query + && ( + currentChar == '=' + || currentChar == '<' + || currentChar == '!' + || currentChar == '>' + || currentChar == '|' + || currentChar == '&' + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.actual.test new file mode 100644 index 000000000..a69ea08d7 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.actual.test @@ -0,0 +1,91 @@ +public class ClassName +{ + public static readonly EventCallback Empty = new EventCallback(null, (Action)(() => { })); + public static readonly EventCallback Empty = new EventCallback( + null, + (Action)(() => { }) + ); + private static readonly Action _callbackCompleted = () => { }; + + public void MethodName() + { + this.Where(() => true); + this.Where([Attribute] () => true); + this.Where(async () => true); + this.Where([Attribute] async () => true); + this.Where(static () => true); + this.Where(async static () => true); + this.SomeMethod( + (longParameter__________________, longParameter_________________) => + longParameter________________ + ); + + this.SomeMethod( + ( + longerParameter_________________________, + longerParameter_________________________, + longerParameter_________________________ + ) => evenLongerParameter + ); + + this.SomeMethod( + [Attribute] + ( + longerParameter_________________________, + longerParameter_________________________, + longerParameter_________________________ + ) => evenLongerParameter + ); + + CallMethod(() => + { + CallOtherMethod(); + }); + + CallMethod( + () => CallOtherMethod___________________________________________________________() + ); + + var task = Task.Factory.StartNew(async () => + { + return await new WebClient().DownloadStringTaskAsync____________________( + "http://example.com" + ); + }); + + Action find = () => + EntryPointDiscoverer.FindStaticEntryMethod(typeof(IEnumerable<>).Assembly); + + var @delegate = (Action)((s) => { }); + + var reusedCommand = new Command("reused") { Handler = CommandHandler.Create(() => { }) }; + + var component = new EventComponent + { + OnArbitraryDelegateEvent = (Action)((x, y) => { }), + }; + + Parallel.For(0, OuterLoopCount, () => schedulers, _parallelAction, (s) => { }); + + var reusedCommand = new Command("reused") + { + Handler = CommandHandler.Create(() => + { + doSomething(); + }) + }; + + CallSomeMethod( + () => + CallAnotherMethodWithParameters( + someParameter, + someParameter___________________________________ + ) > someValue, + anotherParameter + ); + + var returnType = object (bool o) => o ? 1 : "two"; + var returnTypeWithAsync = async object (bool o) => o ? 1 : "two"; + var returnTypeWithAttribute = [Attribute] object (bool o) => o ? 1 : "two"; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.actual.test new file mode 100644 index 000000000..25037d0ea --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.actual.test @@ -0,0 +1,12 @@ +class ClassName +{ + void MethodName() + { + var (one, two, three) = CallMethod(); + var ( + oneoneoneoneoneoneoneoneoneone, + oneoneoneoneoneoneoneoneoneone, + oneoneoneoneoneoneoneoneoneone + ) = CallMethod(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.actual.test new file mode 100644 index 000000000..293b6228a --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + i++; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.actual.test new file mode 100644 index 000000000..f8762d518 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + ++i; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.actual.test new file mode 100644 index 000000000..1f60bc0b5 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.actual.test @@ -0,0 +1,52 @@ +public class ClassName +{ +#if BASIC_IF + public string ShortPropertyName; +#elif BASIC_ELIF + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if !NOT_IF + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if EQUALS_TRUE == true + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if true == TRUE_EQUALS + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if NOT_EQUALS_TRUE != true + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if true != TRUE_NOT_EQUALS + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if LEFT_AND && RIGHT_AND + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif + +#if (LEFT_PAREN && RIGHT_PAREN) + public string ShortPropertyName; +#else + public string ShortPropertyName; +#endif +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.actual.test new file mode 100644 index 000000000..94ceef2cf --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.actual.test @@ -0,0 +1,17 @@ +class ClassName1 +{ + public void MethodName1() { } + +#if DEBUG + public void MethodName2() { } +#endif +} + +#if DEBUG + +class ClassName2 +{ + public void MethodName() { } +} + +#endif diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.actual.test new file mode 100644 index 000000000..98d7e5ce5 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.actual.test @@ -0,0 +1,105 @@ +public class ClassName +{ + public string Property { get; set; } + public string Interface.Property { get; set; } + + string ShortModifiers { get; private set; } + + string PropertyWithModifiersThatIsLongEnoughToBreak + { + protected internal get; + internal protected set; + } + + private string backingValue; + public string PropertyWithBackingValue + { + get { return backingValue; } + set { backingValue = value; } + } + + public string First { get; set; } = "First"; // trailing initializer comment + + public string LambdaAccessors + { + get => this.Property; + set => this.Property = value; + } + + public string LambdaBod => this.Property; + + public string LongNameForcesALineBreakSoWeCanTestEvenLonger____________________ => + this.Property; + + public string Property + { + get { return this.Property; } + } + + public string GetMultiLines + { + set { value = value; } + get + { + var x = "test"; + return x; + } + } + + public string Property + { + [Obsolete] + get; + [Obsolete] + set; + } + + public virtual ICollection SomeLongNameThatForcesALineBreak______________________ { get; set; } = + new HashSet(); + + public Dictionary Properties_________________ { get; set; } = + new Dictionary(); + + public IReadOnlyCollection> SomeName => true; + + public IReadOnlyCollection< + Action + > SomeRandomLongName___________________ => someRandomResult_________________; + + public IReadOnlyCollection< + Action, + SomethingElse + > SomeRandomLongName___________________ => someRandomResult_________________; + + public virtual LongerPropertyConfiguration LongerPropertyConfiguration { get; set; } + + public List<( + ClaimsPrincipal user, + object resource, + IEnumerable requirements + )> AuthorizeCalls { get; } = + new List<( + ClaimsPrincipal user, + object resource, + IEnumerable requirements + )>(); + + public int[] ArrayWithoutSizesDoesntBreak { get; set; } + + public int[] ArrayWithInitializer { get; set; } = { 1, 2, 3, 4, 5 }; + + public Guid[] BreakingArray1 { get; set; } = + { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() }; + + public Guid[] BreakingArray2 { get; set; } = + { + Guid.NewGuid(), + Guid.NewGuid(), + Guid.NewGuid(), + Guid.NewGuid(), + Guid.NewGuid(), + Guid.NewGuid(), + Guid.NewGuid(), + Guid.NewGuid() + }; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.actual.test new file mode 100644 index 000000000..3fdf9819e --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.actual.test @@ -0,0 +1,102 @@ +class ClassName +{ + void MethodName() + { + var query1 = from c in customers select c; + query1 = from c in customers select c into d select d; + query1 = + from c in customers + join c1 in customers_____________________________ + on c1.GetHashCode() equals c.GetHashCode() + into e + select c into d + select d; + + var query2 = from Customer c in customers select c; + + var selectBreak = + from Customer c in customers + select new + { + One = c.One, + Two = c.Two, + Three = C.Three + }; + + var whereQuery = from c in customers where c.Value == "true" select d; + + var orderByQuery = + from c in customers + where c.Value == "true" + orderby c.FirstProperty, c.SecondProperty descending + select d; + + var complexWhere = + from c in customers + where + c.Value == "true" + && someLongValueThatForcesABreak_________________________ != someOtherValue + select d; + + var selectIntoQuery = from c in customers select c into d select d; + + var longJoin = + from c in customers + join c1 in customers_____________________________ + on c1.GetHashCode() equals c.GetHashCode() + into e + select c into d + select d; + + var joinWitType = + from c in customers + join Customers c1 in customers_____________________________ + on c1.GetHashCode() equals c.GetHashCode() + into e + select c into d + select d; + + var complexQuery = + from c in customers + let d = c + where d != null + join c1 in customers1 on c1 equals c + join c1 in customers__________________________________ + on c1.GetHashCode() equals c.GetHashCode() + into e + group c by c.Country into g + orderby g.Count() ascending + orderby g.Key descending + select new + { + Country________________________ = g.Key, + CustCount____________________________ = g.Count() + }; + + var complexQuerySupportsNewLines = + from c in customers + + let d = c + + where d != null + + join c1 in customers1 on c1 equals c + + group c by c.Country into g + + orderby g.Count() ascending + + select new { Country = g.Key, CustCount = g.Count() }; + + var asyncQuery = await + from c in customers + from u in users + from res in HandleAsync(c, u) + select res; + + return from i in Enumerable.Range(0, 10) + let i2 = i * i + where i2 < 100 + select new { Square = i2, Root = i }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.actual.test new file mode 100644 index 000000000..99f5bfd76 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.actual.test @@ -0,0 +1,14 @@ +var complexQuerySupportsNewLines = + from c in customers + + let d = c + + where d != null + + join c1 in customers1 on c1 equals c + + group c by c.Country into g + + orderby g.Count() ascending + + select new { Country = g.Key, CustCount = g.Count() }; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.actual.test new file mode 100644 index 000000000..4323a49d0 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.actual.test @@ -0,0 +1,14 @@ +class ClassName +{ + void Ranges() + { + var thirdItem = list[2]; + var lastItem = list[^1]; + var multiDimensional = list[3, ^2]; + var slice1 = list[2..^3]; + var slice2 = list[..^3]; + var slice3 = list[2..]; + var slice4 = list[..]; + var multiDimensional = list[1..2, ..]; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.actual.test new file mode 100644 index 000000000..51b706e48 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.actual.test @@ -0,0 +1,53 @@ +record DailyTemperature(double HighTemp, double LowTemp) +{ + public double Mean => (HighTemp + LowTemp) / 2.0; +} + +record MostlyWeeklyTemperature( + double monday, + double monday, + double thursday, + double friday, + double sunday +) +{ + public double Mean => (monday + monday + thursday + friday + sunday) / 5.0; +} + +record PC(string x) : PrimaryConstructor(x) { } + +public record RecordWithProperty +{ + public string Property { get; set; } +} + +record RecordWithoutBody(string property); + +record LongerRecordNameWhatHappens_________________________________________(string x) + : R4(x) { } + +record GenericRecord(T Result); + +public record LotsOfParametersWithBase( + string longNameParameter, + string areTheyCalledParametersWithRecords, + string theyLookLikeParameters +) : BaseRecord(longNameParameter); + +public record LotsOfParametersWithBaseWithLots( + string longNameParameter, + string areTheyCalledParametersWithRecords, + string theyLookLikeParameters +) + : BaseRecord( + longNameParameter, + areTheyCalledParametersWithRecords, + theyLookLikeParameters, + "someExtraValueToMakeThisReallyLong" + ); + +public record SomeRecord : SomeBaseRecord { } + +public record struct StructRecord; + +public record class ClassRecord; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.actual.test new file mode 100644 index 000000000..64a311e72 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + ref readonly var r1 = ref MethodName(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.actual.test new file mode 100644 index 000000000..b3647ec40 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + ref Vector3 MethodName() + { + break; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.actual.test new file mode 100644 index 000000000..2342b9aa6 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.actual.test @@ -0,0 +1,25 @@ +class ClassName +{ + void EmptyReturn() + { + return; + } + + bool ReturnBinaryExpression() + { + return someOther || otherValue; + } + + bool ReturnLongBinaryExpression() + { + return someValueThatIsLongAndForcesALineBreak + || otherValueThatIsLongAndForcesALineBreak_____________________; + } + + string LongMethodCallWithParameter() + { + return CallSomeLongMethodThatIndentsInsideOfItAndSeeWhatHappens( + "SomeLongerValue________________________________" + ); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.actual.test new file mode 100644 index 000000000..445751f47 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.actual.test @@ -0,0 +1,25 @@ +public class ClassName +{ + public void MethodName() + { + this.Where(o => true); + + this.WhereAsync(async o => true); + + this.WhereAsync(static o => true); + + this.Where___________________( + longName__________________ => someOtherLongName__________________ + ); + + this.Where___________________( + superLongName________________________________ => + someOtherLongName_______________________________ + ); + + this.Where___________________(superLongName________________________________ => + { + return someOtherLongName__________________; + }); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.actual.test new file mode 100644 index 000000000..a0bcba979 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.actual.test @@ -0,0 +1,10 @@ +class ClassName +{ + void MethodName() + { + Span a = stackalloc int[3]; + Span a = stackalloc int[3] { 1, 2, 3 }; + Span a = stackalloc int[] { 1, 2, 3 }; + Span a = stackalloc[] { 1, 2, 3 }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.actual.test new file mode 100644 index 000000000..4fbb6276b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.actual.test @@ -0,0 +1,165 @@ +[assembly: System.Copyright( + @"(C)"" +2009" +)] + +class ClassName +{ + private string bothLineEndingsPersist = @"\r\n \n"; + private string interpolatedVersion = @$"\r\n \n"; + + private string emptyLines = + @"one + +two + + +three +"; + + private string interpolatedEmptyLines = + @$"one + +two + + +three +"; + + public void VerbatimNewlineInInterpolated() + { + return @$"{CallMethod(o => @" + IndentedAfterNewLine")}"; + } + + private string stayOnLine1 = + @"one +two +"; + + private string stayOnLine2 = + $@"one +two +"; + + private string stayOnLine3 = + @"one +two +three +four"; + + private string stayOnLine4 = + @$"one +two +three +four"; + + private void MethodName() + { + CallSomeLongMethod( + @"one +two +three +four +five +" + ); + + CallSomeLongMethod( + $@"one +two +three +four +five +" + ); + + CallSomeLongMethod( + @"one +two +three +four", + five + ); + + CallSomeLongMethod( + $@"one +two +three +four", + five + ); + + var multiLineRaw = """ + This is a long message. + It has several lines. + Some are indented + more than others. + Some should start at the first column. + Some have "quoted text" in them. + """; + + var multiLineRawInterpolated = $""" + This is a long message. + It has several lines. + Some are indented + more than others. + Some should start at the first column. + Some have "quoted text" in them. + """; + + var shortRaw = """Short Raw String"""; + var shortRawInterpolated = $"""Short Raw String"""; + var longRaw = + """Long Raw String """; + var longRawInterpolated = + $"""Long Raw String """; + + CallSomeLongMethod( + """ +one +two +three +four +five +""" + ); + + CallSomeLongMethod( + """ +one +two +three +four +""", + five + ); + + CallSomeLongMethod( + one, + """ +two +three +four +""", + five + ); + + var expressionsInInterpolatedVerbatimStringDontBreak = + $@"{CallMethod_____________________________().CallMethod_____________________________().CallMethod_____________________________()}"; + + var butKeepExistingBreaks = + $@" { + // some comment + CallMethod() + } "; + + var butKeepExistingBreaks = + $" { + // some comment + CallMethod() + } "; + + ReadOnlySpan utf8StringLiteral = "hello"u8; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.actual.test new file mode 100644 index 000000000..afc2499d6 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.actual.test @@ -0,0 +1,3 @@ +struct BasicStruct { } + +public readonly struct ReadonlyStruct { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.actual.test new file mode 100644 index 000000000..764e53018 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.actual.test @@ -0,0 +1,92 @@ +class ClassName +{ + void MethodName() + { + return 1 switch + { + 1 => 100, + 2 => 200, + 3 when false => 300, + + _ => throw new global::System.Exception() + }; + + return (GetState(), action, hasKey) switch + { + // Comment + (DoorState.Closed, Action.Open, _) => DoorState.Opened, + (DoorState.Opened, Action.Close, _) => DoorState.Closed, + + // ExtraLineBeforeThis + (DoorState.Closed, Action.Lock, true) => DoorState.Locked, + (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, + (var state, _, _) => state, + (_, _, _) + => DoorState.LongStateShouldNotGetExtraLine________________________________________ + }; + + return someValue switch + { + SomeSimpleObject => DoSomething(), + { IsParameter: true } => 1, + // this comment shouldn't affect the next line + { IsParameter: false } => 0, + SomeLongObject someLongObject + => CallSomeMethodWith____________________________(someLongObject), + YetAnotherObject + => CallSomeMethod( + someValue, + andOtherParameters, + thatMakeThisLongEnoughToBreak___________________ + ), + VeryLongObject_______________________________________________________________ + when count > 0 + => CallSomeMethod(someValue), + OneMore + => "someStrings" + + "moreStrings" + + "andMoreStrings_________________________________________", + SomeOtherObject + or AnotherObject + or OrEvenSomeOtherObject_________________ + => CallSomeMethod(someValue), + SomeOtherObject { SomeProperty: SomeOtherProject } + or AnotherObject + => CallSomeMethod(someValue), + AnotherObject + or SomeOtherObject { SomeProperty: SomeOtherProject } + => CallSomeMethod(someValue), + SomeOtherObject { Property: true } => CallSomeMethod(someValue), + SomeOtherObject { SomeProperty: YetAnotherObject { Property: true } } + => CallSomeMethod(someValue), + { } otherSyntax => CallSomeMethod(otherSyntax), + { SomeProperty: true } + => "Just because this is long, don't break the pattern ", + _ => CallSomeMethod(someValue) + }; + + return someValue switch + { + { IsParameter: true, } => noExtraLineAfterThis, + { IsParameter: someLongValue____________________________________________, } + => someOtherValue + }; + + return (original, updated) switch + { + ( + FieldSymbol + { + ContainingType: { IsTupleType: true }, + TupleElementIndex: var oi + } originalField, + FieldSymbol + { + ContainingType: { IsTupleType: true }, + TupleElementIndex: var ui + } updatedField + ) + => originalField.Type.Equals(updatedField.Type) + }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.actual.test new file mode 100644 index 000000000..fbd2f8561 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.actual.test @@ -0,0 +1,92 @@ +class ClassName +{ + void MethodName() + { + return 1 switch + { + 1 => 100, + 2 => 200, + 3 when false => 300, + + _ => throw new global::System.Exception() + }; + + return (GetState(), action, hasKey) switch + { + // Comment + (DoorState.Closed, Action.Open, _) => DoorState.Opened, + (DoorState.Opened, Action.Close, _) => DoorState.Closed, + + // ExtraLineBeforeThis + (DoorState.Closed, Action.Lock, true) => DoorState.Locked, + (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, + (var state, _, _) => state, + (_, _, _) + => DoorState.LongStateShouldNotGetExtraLine________________________________________ + }; + + return someValue switch + { + SomeSimpleObject => DoSomething(), + { IsParameter: true } => 1, + // this comment shouldn't affect the next line + { IsParameter: false } => 0, + SomeLongObject someLongObject + => CallSomeMethodWith____________________________(someLongObject), + YetAnotherObject + => CallSomeMethod( + someValue, + andOtherParameters, + thatMakeThisLongEnoughToBreak___________________ + ), + VeryLongObject_______________________________________________________________ + when count > 0 + => CallSomeMethod(someValue), + OneMore + => "someStrings" + + "moreStrings" + + "andMoreStrings_________________________________________", + SomeOtherObject + or AnotherObject + or OrEvenSomeOtherObject_________________ + => CallSomeMethod(someValue), + SomeOtherObject { SomeProperty: SomeOtherProject } + or AnotherObject + => CallSomeMethod(someValue), + AnotherObject + or SomeOtherObject { SomeProperty: SomeOtherProject } + => CallSomeMethod(someValue), + SomeOtherObject { Property: true } => CallSomeMethod(someValue), + SomeOtherObject { SomeProperty: YetAnotherObject { Property: true } } + => CallSomeMethod(someValue), + { } otherSyntax => CallSomeMethod(otherSyntax), + { SomeProperty: true } + => "Just because this is long, don't break the pattern ", + _ => CallSomeMethod(someValue) + }; + + return someValue switch + { + { IsParameter: true, } => noExtraLineAfterThis, + { IsParameter: someLongValue____________________________________________, } + => someOtherValue + }; + + return (original, updated) switch + { + ( + FieldSymbol + { + ContainingType: { IsTupleType: true }, + TupleElementIndex: var oi + } originalField, + FieldSymbol + { + ContainingType: { IsTupleType: true }, + TupleElementIndex: var ui + } updatedField + ) + => originalField.Type.Equals(updatedField.Type) + }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.actual.test new file mode 100644 index 000000000..019cbcc11 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.actual.test @@ -0,0 +1,116 @@ +public class ClassName +{ + public void MethodName() + { + switch (0) + { + case 0: + case 1: + { + break; + } + + case 1 + 1: + { + return; + } + + case 4: + var x = 1; + break; + + default: + { + return; + } + } + + switch (0) + { + case 1: + case 2: + + default: + break; + } + + switch (0) + { + case 1: + { + goto case 2; + } + case 2: + { + goto default; + } + default: + { + return; + } + } + + switch (0) { } + + switch (arg) + { + case "A" when b > 50: + case "B" when B < 50: + + case "C______________________________________________________________________" + when C == 50: + return; + case "D______________________________________________________________________" + when D == 50: + case "E______________________________________________________________________" + when E == 50: + { + return; + } + default: + { + break; + } + } + + switch (emptyBlockInCaseShouldntGetExtraSpace) + { + case 1: + { + { + return 1; + } + } + } + + switch ( + someLongValue + + someOtherLongValue_________________________________________________________ + ) + { + default: + return; + } + + switch (patternMatching) + { + case SomeLongRecursivePattern + { + SomeProperty: " ", + SomeOtherProperty: { SomeProperty: One or Two } + }: + return 1; + case SomeShortRecursivePattern { SomeProperty: "" }: + return 2; + default: + break; + } + + switch (positionalPattern1, positionalPattern2) + { + case (SomeValue, _) when !isEquality: + case (_, SomeValue) when !isEquality: + return; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.actual.test new file mode 100644 index 000000000..6c76db3d5 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + var result = nullableResult ?? throw new NullReferenceException(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.actual.test new file mode 100644 index 000000000..75da62d53 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + throw new Exception(); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.actual.test new file mode 100644 index 000000000..e103d1cd1 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.actual.test @@ -0,0 +1,59 @@ +class ClassName +{ + void MethodName() + { + try + { + throw null; + } + catch (Exception) + { + throw; + } + catch (ArgumentException ex) + { + throw; + } + finally + { + return; + } + + try { } + catch { } + + try { } + finally { } + + try + { + throw null; + } + catch (Exception e) when (myFilter(e)) + { + throw; + } + + try + { + throw new Exception(); + } + catch (Exception exception) + when (exception.Message.Contains("someLongValueThatMakesThisLineTooLong")) + { + return; + } + + try + { + throw new Exception(); + } + catch (Exception exception) + when (exception.Message.Contains("someLongValueThatMakesThisLineTooLong") + && someLongCondition == someOtherLongValue + ) + { + return; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.actual.test new file mode 100644 index 000000000..b6f1318b7 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.actual.test @@ -0,0 +1,53 @@ +class ClassName +{ + void MethodName() + { + (int, int) t1; + var res = t1 == (1, 2); + } + + List<(string x, string y)> TupleWithIdentifier() + { + return new() { (href: "one", title: "two") }; + } + + public async Task TupleAssignment() + { + var (noteTexts, matcher) = await ( + GetAndAnalyzeNoteTexts(), + _wordInfoCollectionManager.BuildWordMatcher() + ); + + var (a, b) = await (c(), d()); + } + + public async Task<( + ILookup someLookup, + ILookup reverseLookup, + ILookup thirdLookup + )> CreateLookups() + { + // do something + } + + public async ( + ILookup someLookup, + ILookup reverseLookup, + ILookup thirdLookup + ) CreateLookups() + { + // do something + } + + public void TuplesAsInput( + ( + int myInt, + string myString, + ClassName myClassNameInstance, + Dictionary wordList + ) inputArgs + ) + { + // do something + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.actual.test new file mode 100644 index 000000000..bc1f37e65 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.actual.test @@ -0,0 +1,4 @@ +typeof(AnExceptionallyLongAndElaborateClassNameToMakeAnExampleRegardingOpenGenerics<,>).MakeGenericType( + typeof(string), + typeof(int) +); diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.actual.test new file mode 100644 index 000000000..6d2533a9e --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.actual.test @@ -0,0 +1,7 @@ +class ClassName +{ + void MethodName() + { + var t = typeof(int); + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.actual.test new file mode 100644 index 000000000..cbc19f140 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.actual.test @@ -0,0 +1,89 @@ +delegate void Delegate() + where T : struct; + +class ClassName + where T : class +{ + void MethodName() + where T : class + { + void LocalFunction() + where T : class + { + return; + } + } + + public static ReturnType MethodName() + where T : class + where U : class + { + return; + } + + public static ReturnType MethodName() + where T : class + where U : class { } + + public static ReturnType MethodName(string parameter) + where T : class + where U : class + { + return; + } + + public static ReturnType MethodName( + string longParameter_______________________, + string longParameter_______________________ + ) + where T : class + { + return; + } + + public static ReturnType MethodName( + string longParameter_______________________, + string longParameter_______________________ + ) + where T : class { } + + public static ReturnType MethodName( + string longParameter_______________________, + string longParameter_______________________ + ) + where T : class + where U : class + { + return; + } + + public static ReturnType MethodName( + string longParameter_______________________, + string longParameter_______________________ + ) + where T : class + where U : class { } +} + +interface InterfaceName + where T : class { } + +struct Struct + where T : class { } + +class ClassName + where N : new() + where C : class + where T : IComparable + where TT : IList + where L : class, new() +{ + private string x; +} + +class ClassName + where N : new() + where C : class + where T : IComparable + where TT : IList + where L : class, new() { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.actual.test new file mode 100644 index 000000000..e126d7dcd --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.actual.test @@ -0,0 +1,4 @@ +class ClassName +{ + int x = -1; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.actual.test new file mode 100644 index 000000000..49eb8c2bc --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.actual.test @@ -0,0 +1,4 @@ +class ClassName +{ + int x = +1; +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.actual.test new file mode 100644 index 000000000..7576541b0 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.actual.test @@ -0,0 +1,10 @@ +class ClassName +{ + void MethodName() + { + unsafe + { + int* p = null; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.actual.test new file mode 100644 index 000000000..9f53a36e9 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.actual.test @@ -0,0 +1,28 @@ +// leading +using First; // trailing + +// leading with space +using // another trailing +Second; + +using +// static leading +static // static trailing +Third; + +using M = System.Math; + +using static System.Math; + +global using System; + +using First; +using Second; + +namespace Namespace +{ + using Third; + using One.Two.Three; + + public class ClassName { } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.actual.test new file mode 100644 index 000000000..87bc214ab --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.actual.test @@ -0,0 +1,70 @@ +class ClassName +{ + void MethodName() + { + using (var x = BeginScope()) + { + return; + } + + await using (var x = BeginScope()) + { + return; + } + + using (var x = BeginScope()) + using (var y = BeginScope()) + { + return; + } + + using (BeginScope()) + { + return; + } + + using (BeginScope()) + return; + + using ( + BeginScope() + .LongerMethod_________________________() + .MakeThisThingChain______________________() + ) + { + return; + } + + using (var x = SomeMethodCallThatHitsExactly100__________________________________________()) + { + return; + } + + // leading comment doesn't break differently + using (var x = SomeMethodCallThatHitsExactly100__________________________________________()) + { + return; + } + + // leading comment doesn't break differently + await using (var x = SomeMethodCallThatHitsExactly100____________________________________()) + { + return; + } + + using ( + var x = SomeMethodCallThatHitsJustOver100__________________________________________() + ) + { + return; + } + + // leading await + await + // leading using + using (var y = Something()) + { + return; + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.actual.test new file mode 100644 index 000000000..60fa1ac67 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.actual.test @@ -0,0 +1,184 @@ +class ClassName +{ + void MethodName() + { + int x = 0, + y = 1, + z = 12; + + string one = "one", + two = "two"; + + // leading comment + var leading = 0; + + var trailing = 0; // trailing comment + + // leading comment + bool leading2; + + bool trailing2; // trailing comment + + var trailingMulti = 1; /* ensure no extra line after this */ + var trailingMultiAfter = 2; + + var captureUnmatchedValuesParameters______________________________ = + new List(); + + Func s_isVisualBasicCommentTrivia = (syntaxTrivia) => + syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia); + + Func s_isVisualBasicCommentTrivia = ( + syntaxTrivia_________________________________ + ) => syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia); + + Action find = () => + EntryPointDiscoverer.FindStaticEntryMethod(typeof(IEnumerable<>).Assembly); + + Action find = () => + EntryPointDiscoverer.FindStaticEntryMethod( + typeof(IEnumerable<>).Assembly_________________________________________ + ); + + var arrayCreationExpression1 = new byte[100]; + var arrayCreationExpression2 = new byte[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + ]; + var arrayCreationExpression3 = new byte[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 + ]; + var shortOne______ = new byte[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 + ]; + var muchLongerOne_________________ = new byte[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + DefaultValueColumnWidth + ]; + var muchLongerOne_________________ = new byte[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + + SqlParameterCollectionExtensions.DefaultValueColumnWidth + ]; + + var elementAccessExpression1 = anArray[100]; + var elementAccessExpression2 = anArray[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + ]; + var elementAccessExpression3 = anArray[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 + ]; + var shortOne______ = anArray_[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 + ]; + var shortOne______ = anArray[ + DefaultValueColumnWidth_________ + DefaultValueColumnWidth_______ + ]; + var shortOne______ = anArray[ + SqlParameterCollectionExtensions.DefaultValueColumnWidth + + SqlParameterCollectionExtensions.DefaultValueColumnWidth + ]; + + var someLongValue_________________ = memberAccessExpression[ + elementAccessExpression + ].theMember______________________________; + + var someLongValue_________________ = memberAccessExpression[ + elementAccessExpression + ].theMember______________________________(); + + var someLongValue_________________ = memberAccessExpression( + elementAccessExpression + ).theMember______________________________; + + var someLongValue_________________ = memberAccessExpression(elementAccessExpression) + .theMember______________________________(); + + var someLongVariable_doesNotBreakArrayRank____________________________ = + (ArrayType[])CallMethod(); + + var conditionalIndentation = someBoolean + ? someLongValue____________________________________ + + someLongValue____________________________________ + : someLongValue____________________________________ + + someLongValue____________________________________; + + var longEnoughToMakeThisBreak = + something == somethingElse ? shortValue__________ : otherShortValue; + + var value = + someLongValue__________________________________ + && someOtherValue__________________________________ + ? trueValue + : falseValue; + + var value = someLongCondition______________________ + ? "someLongValue" + : "someOtherLongValue"; + + fixed ( + byte* someName_____________________ = + (someCondition > someOtherLongCondition_______________________) + ? new byte[someValue] + : null + ) { } + + var variableDeclarator = conditionalAccessExpression?.invocationExpression( + o => someLongValue___________________________________ + ); + + var variableDeclarator = (CastExpression) + invocationExpression.SomeMethod(someParameter______________________); + + var someValue = + (SomeLongGenericType)someLongValue___________________________; + + var variableDeclarator = ( + @"parenthesizedExpression +withLineEnding" + ); + + var value = coalesceAssignmentExpression ??= CallMethod( + parameter_____________________, + parameter_____________________ + ); + + var value = + coalesceAssignmentExpression = + coalesceAssignmentExpression ??= + CallMethod(parameter_____________________, parameter_____________________); + + var value = CallSomeMethod( + someParameter_____________________, + someParameter_____________________ + ) + ? someValue + : someOtherValue; + + var someValue = + await SomeObject.CallLongAsyncMethod____________________________________________( + someParameter_________________________, + someParameter_________________________ + ); + + var someValue = + SomeObject.CallLongMethod____________________________________________________( + someParameter_________________________, + someParameter_________________________ + ); + + var someValue = + SomeObject.CallLongMethod____________________________________________________() + ? someValue + : someOtherValue; + + var someValue = SomeObject + .CallLongMethod____________________________________________________() + .CallLongMethod____________________________________________________() + ? someValue + : someOtherValue; + + var someValue = + someLongCondition___________________________________ + && someOtheLongCondition___________________________________ + ? someValue + : someValue; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.actual.test new file mode 100644 index 000000000..6f979d467 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.actual.test @@ -0,0 +1,58 @@ +class ClassName +{ + void MethodName() + { + while (true) + { + return; + } + + while (true && false) + { + return; + } + + while ( + directoryInfo.Name != "Test" + && directoryInfo.Parent != null + && someLongCondition == "test" + ) + { + directoryInfo = directoryInfo.Parent; + } + + while (exactly100 || moreTextToMakeItWork__________________________________________________) + { + return; + } + + // leading comment doesn't break differently + while (exactly100 || moreTextToMakeItWork__________________________________________________) + { + return; + } + + while ( + justOver100 || moreTextToMakeItWork__________________________________________________ + ) + { + return; + } + + while (true) + return; + + while (someLongerStatement && someOtherLongerStatement________________) + return someLongerValue; + + while ( + someEvenLongerStatement && someOtherEvenLongerStatement________________________________ + ) + return someLongerValue; + + while (true) + { + // indent + } + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.actual.test new file mode 100644 index 000000000..bd87fa5c8 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.actual.test @@ -0,0 +1,14 @@ +class ClassName +{ + void MethodName() + { + someRecord = someRecord with { Property = "Value" }; + + someRecord = someRecord with + { + Property = "Value", + AnotherProperty = "Value", + YetAnother = "Value" + }; + } +} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.actual.test new file mode 100644 index 000000000..5ba360463 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.actual.test @@ -0,0 +1,8 @@ +class ClassName +{ + void MethodName() + { + yield return null; + yield break; + } +} From 85e1731e07b858cc321945b6546c820f0af5100b Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 11:18:11 -0500 Subject: [PATCH 03/21] Refactoring towards multiple formatters --- Src/CSharpier.Benchmarks/Program.cs | 2 +- Src/CSharpier.Cli/CommandLineFormatter.cs | 3 +- Src/CSharpier.Cli/FileReader.cs | 2 +- Src/CSharpier.Cli/FileToFormatInfo.cs | 2 +- .../Controllers/FormatController.cs | 4 +- .../FormattingTestsGenerator.cs | 2 +- .../FormattingTestsGenerator.sbntxt | 4 +- Src/CSharpier.Tests/CSharpier.Tests.csproj | 3 + Src/CSharpier.Tests/CodeFormatterTests.cs | 5 +- Src/CSharpier.Tests/DeepRecursionTests.cs | 4 +- .../FormattingTests/BaseTest.cs | 24 +- .../AddressOfExpressions.actual.test | 0 .../{CSharp => cs}/AddressOfExpressions.test | 0 .../AliasQualifiedNames.actual.test | 0 .../{CSharp => cs}/AliasQualifiedNames.test | 0 .../AnonymousMethodExpressions.actual.test | 0 .../AnonymousMethodExpressions.test | 0 ...ymousObjectCreationExpressions.actual.test | 0 .../AnonymousObjectCreationExpressions.test | 0 .../{CSharp => cs}/ArgumentLists.actual.test | 0 .../{CSharp => cs}/ArgumentLists.test | 0 .../ArrayCreationExpressions.actual.test | 0 .../ArrayCreationExpressions.test | 0 .../{CSharp => cs}/AsExpressions.actual.test | 0 .../{CSharp => cs}/AsExpressions.test | 0 .../AssignmentExpressions.actual.test | 0 .../{CSharp => cs}/AssignmentExpressions.test | 0 .../AttributeListNewLines.actual.test | 0 .../AttributeListNewLines.expected.test | 0 .../{CSharp => cs}/AttributeListNewLines.test | 0 .../{CSharp => cs}/AttributeLists.actual.test | 0 .../{CSharp => cs}/AttributeLists.test | 0 .../AutoDashGenerated.actual.test | 0 .../{CSharp => cs}/AutoDashGenerated.test | 0 .../{CSharp => cs}/AutoGenerated.actual.test | 0 .../{CSharp => cs}/AutoGenerated.test | 0 .../AwaitExpressions.actual.test | 0 .../{CSharp => cs}/AwaitExpressions.test | 0 .../BaseExpressions.actual.test | 0 .../{CSharp => cs}/BaseExpressions.test | 0 .../BinaryExpressions.actual.test | 0 .../{CSharp => cs}/BinaryExpressions.test | 0 .../CSharpierIgnore.actual.test | 0 .../CSharpierIgnore.expected.test | 0 .../{CSharp => cs}/CSharpierIgnore.test | 0 ...SharpierIgnore_CompilationUnit.actual.test | 0 ...arpierIgnore_CompilationUnit.expected.test | 0 .../CSharpierIgnore_CompilationUnit.test | 0 .../CSharpierIgnore_Dont.actual.test | 0 .../CSharpierIgnore_Dont.expected.test | 0 .../{CSharp => cs}/CSharpierIgnore_Dont.test | 0 .../CSharpierIgnore_TopLevel.actual.test | 0 .../CSharpierIgnore_TopLevel.expected.test | 0 .../CSharpierIgnore_TopLevel.test | 0 .../CastExpressions.actual.test | 0 .../{CSharp => cs}/CastExpressions.test | 0 .../CheckedStatements.actual.test | 0 .../{CSharp => cs}/CheckedStatements.test | 0 .../ClassDeclarations.actual.test | 0 .../{CSharp => cs}/ClassDeclarations.test | 0 .../ClassDeclarations_EdgeCase.actual.test | 0 .../ClassDeclarations_EdgeCase.expected.test | 0 .../ClassDeclarations_EdgeCase.test | 0 .../ClassDeclarations_Tabs.actual.test | 0 .../ClassDeclarations_Tabs.test | 0 .../CloseBraceRemovesLines.actual.test | 0 .../CloseBraceRemovesLines.expected.test | 0 .../CloseBraceRemovesLines.test | 0 .../CoalesceExpressions.actual.test | 0 .../{CSharp => cs}/CoalesceExpressions.test | 0 .../{CSharp => cs}/Comments.actual.test | 0 .../TestFiles/{CSharp => cs}/Comments.test | 0 .../Comments_EdgeCase.actual.test | 0 .../Comments_EdgeCase.expected.test | 0 .../{CSharp => cs}/Comments_EdgeCase.test | 0 .../CompilationUnitAttributes.actual.test | 0 .../CompilationUnitAttributes.expected.test | 0 .../CompilationUnitAttributes.test | 0 ...ilationUnitIfDirectiveEdgeCase.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase.test | 0 ...lationUnitIfDirectiveEdgeCase2.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase2.test | 0 ...lationUnitIfDirectiveEdgeCase3.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase3.test | 0 ...lationUnitIfDirectiveEdgeCase4.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase4.test | 0 ...lationUnitIfDirectiveEdgeCase5.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase5.test | 0 ...lationUnitIfDirectiveEdgeCase6.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase6.test | 0 ...lationUnitIfDirectiveEdgeCase7.actual.test | 0 .../CompilationUnitIfDirectiveEdgeCase7.test | 0 .../ConditionalAccessExpressions.actual.test | 0 .../ConditionalAccessExpressions.test | 0 .../ConditionalExpressions.actual.test | 0 .../ConditionalExpressions.test | 0 .../ConditionalExpressions_Tabs.actual.test | 0 .../ConditionalExpressions_Tabs.test | 0 .../ConstructorDeclarations.actual.test | 0 .../ConstructorDeclarations.test | 0 ...ConversionOperatorDeclarations.actual.test | 0 .../ConversionOperatorDeclarations.test | 0 .../DeclarationExpressions.actual.test | 0 .../DeclarationExpressions.test | 0 .../DefaultExpressions.actual.test | 0 .../{CSharp => cs}/DefaultExpressions.test | 0 .../DelegateDeclarations.actual.test | 0 .../{CSharp => cs}/DelegateDeclarations.test | 0 .../DestructorDeclarations.actual.test | 0 .../DestructorDeclarations.test | 0 .../{CSharp => cs}/Directives.actual.test | 0 .../TestFiles/{CSharp => cs}/Directives.test | 0 .../Directives_AddAndRemoveLines.actual.test | 0 ...Directives_AddAndRemoveLines.expected.test | 0 .../Directives_AddAndRemoveLines.test | 0 .../Directives_CompilationUnit.actual.test | 0 .../Directives_CompilationUnit.test | 0 ...Directives_FileScopedNamespace.actual.test | 0 .../Directives_FileScopedNamespace.test | 0 .../Directives_Namespace.actual.test | 0 .../{CSharp => cs}/Directives_Namespace.test | 0 .../Directives_Regions.actual.test | 0 .../{CSharp => cs}/Directives_Regions.test | 0 .../{CSharp => cs}/DoStatements.actual.test | 0 .../{CSharp => cs}/DoStatements.test | 0 .../ElementAccessExpressions.actual.test | 0 .../ElementAccessExpressions.test | 0 .../ElementBindingExpressions.actual.test | 0 .../ElementBindingExpressions.test | 0 .../{CSharp => cs}/ElseStatements.actual.test | 0 .../{CSharp => cs}/ElseStatements.test | 0 .../{CSharp => cs}/EmptyLines.actual.test | 0 .../{CSharp => cs}/EmptyLines.expected.test | 0 .../TestFiles/{CSharp => cs}/EmptyLines.test | 0 .../EnumDeclarationComments.actual.test | 0 .../EnumDeclarationComments.expected.test | 0 .../EnumDeclarationComments.test | 0 .../EnumDeclarations.actual.test | 0 .../{CSharp => cs}/EnumDeclarations.test | 0 .../EventDeclarations.actual.test | 0 .../{CSharp => cs}/EventDeclarations.test | 0 .../EventFieldDeclarations.actual.test | 0 .../EventFieldDeclarations.test | 0 .../ExternAliasDirectives.actual.test | 0 .../{CSharp => cs}/ExternAliasDirectives.test | 0 .../FieldDeclarations.actual.test | 0 .../{CSharp => cs}/FieldDeclarations.test | 0 .../FileEncoding_USC2LEBOM.actual.test | Bin .../FileEncoding_USC2LEBOM.test | Bin .../FileEncoding_UTF8.actual.test | 0 .../{CSharp => cs}/FileEncoding_UTF8.test | 0 .../FileEncoding_UTF8BOM.actual.test | 0 .../{CSharp => cs}/FileEncoding_UTF8BOM.test | 0 ...FileScopedNamespaceDeclaration.actual.test | 0 .../FileScopedNamespaceDeclaration.test | 0 .../FixedStatements.actual.test | 0 .../{CSharp => cs}/FixedStatements.test | 0 .../ForEachStatements.actual.test | 0 .../{CSharp => cs}/ForEachStatements.test | 0 .../ForEachVariableStatements.actual.test | 0 .../ForEachVariableStatements.test | 0 .../{CSharp => cs}/ForStatements.actual.test | 0 .../{CSharp => cs}/ForStatements.test | 0 .../FunctionPointerTypes.actual.test | 0 .../{CSharp => cs}/FunctionPointerTypes.test | 0 .../GlobalStatements.actual.test | 0 .../{CSharp => cs}/GlobalStatements.test | 0 .../{CSharp => cs}/IfStatements.actual.test | 0 .../{CSharp => cs}/IfStatements.test | 0 ...plicitArrayCreationExpressions.actual.test | 0 .../ImplicitArrayCreationExpressions.test | 0 .../ImplicitElementAccesses.actual.test | 0 .../ImplicitElementAccesses.test | 0 ...kAllocArrayCreationExpressions.actual.test | 0 ...citStackAllocArrayCreationExpressions.test | 0 .../IndexerDeclarations.actual.test | 0 .../{CSharp => cs}/IndexerDeclarations.test | 0 .../InitializerExpressions.actual.test | 0 .../InitializerExpressions.test | 0 .../InterfaceDeclarations.actual.test | 0 .../{CSharp => cs}/InterfaceDeclarations.test | 0 .../InterpolatedStringExpressions.actual.test | 0 .../InterpolatedStringExpressions.test | 0 .../InvocationExpressions.actual.test | 0 .../{CSharp => cs}/InvocationExpressions.test | 0 .../{CSharp => cs}/IsExpressions.actual.test | 0 .../{CSharp => cs}/IsExpressions.test | 0 .../IsPatternExpressions.actual.test | 0 .../{CSharp => cs}/IsPatternExpressions.test | 0 .../LabeledStatements.actual.test | 0 .../{CSharp => cs}/LabeledStatements.test | 0 .../{CSharp => cs}/ListPatterns.actual.test | 0 .../{CSharp => cs}/ListPatterns.test | 0 .../LocalDeclarationStatements.actual.test | 0 .../LocalDeclarationStatements.test | 0 .../LocalFunctionStatements.actual.test | 0 .../LocalFunctionStatements.test | 0 .../{CSharp => cs}/LockStatements.actual.test | 0 .../{CSharp => cs}/LockStatements.test | 0 .../MakeRefExpressions.actual.test | 0 .../{CSharp => cs}/MakeRefExpressions.test | 0 .../MemberAccessExpressions.actual.test | 0 .../MemberAccessExpressions.test | 0 .../{CSharp => cs}/MemberLines.actual.test | 0 .../{CSharp => cs}/MemberLines.expected.test | 0 .../TestFiles/{CSharp => cs}/MemberLines.test | 0 .../MethodDeclarations.actual.test | 0 .../{CSharp => cs}/MethodDeclarations.test | 0 .../NamespaceDeclarations.actual.test | 0 .../{CSharp => cs}/NamespaceDeclarations.test | 0 .../{CSharp => cs}/NullableTypes.actual.test | 0 .../{CSharp => cs}/NullableTypes.test | 0 .../ObjectCreationExpressions.actual.test | 0 .../ObjectCreationExpressions.test | 0 .../ObnoxiousEdgeCases.actual.test | 0 .../{CSharp => cs}/ObnoxiousEdgeCases.test | 0 .../OperatorDeclarations.actual.test | 0 .../{CSharp => cs}/OperatorDeclarations.test | 0 .../ParenthesizedExpressions.actual.test | 0 .../ParenthesizedExpressions.test | 0 ...ParenthesizedLambdaExpressions.actual.test | 0 .../ParenthesizedLambdaExpressions.test | 0 ...enthesizedVariableDesignations.actual.test | 0 .../ParenthesizedVariableDesignations.test | 0 .../PostIncrementExpressions.actual.test | 0 .../PostIncrementExpressions.test | 0 .../PreIncrementExpressions.actual.test | 0 .../PreIncrementExpressions.test | 0 .../PreprocessorSymbols.actual.test | 0 .../PreprocessorSymbols.expected.test | 0 .../{CSharp => cs}/PreprocessorSymbols.test | 0 ...eprocessorSymbols_KeepNewIines.actual.test | 0 .../PreprocessorSymbols_KeepNewIines.test | 0 .../PropertyDeclarations.actual.test | 0 .../{CSharp => cs}/PropertyDeclarations.test | 0 .../QueryExpressions.actual.test | 0 .../{CSharp => cs}/QueryExpressions.test | 0 .../QueryExpressions_RemoveSpaces.actual.test | 0 ...ueryExpressions_RemoveSpaces.expected.test | 0 .../QueryExpressions_RemoveSpaces.test | 0 .../RangeExpressions.actual.test | 0 .../{CSharp => cs}/RangeExpressions.test | 0 .../RecordDeclarations.actual.test | 0 .../{CSharp => cs}/RecordDeclarations.test | 0 .../{CSharp => cs}/RefExpressions.actual.test | 0 .../{CSharp => cs}/RefExpressions.test | 0 .../{CSharp => cs}/RefTypes.actual.test | 0 .../TestFiles/{CSharp => cs}/RefTypes.test | 0 .../ReturnStatements.actual.test | 0 .../{CSharp => cs}/ReturnStatements.test | 0 .../SimpleLambdaExpressions.actual.test | 0 .../SimpleLambdaExpressions.test | 0 ...kAllocArrayCreationExpressions.actual.test | 0 .../StackAllocArrayCreationExpressions.test | 0 .../{CSharp => cs}/StringLiterals.actual.test | 0 .../{CSharp => cs}/StringLiterals.test | 0 .../StructDeclarations.actual.test | 0 .../{CSharp => cs}/StructDeclarations.test | 0 .../SwitchExpressions.actual.test | 0 .../{CSharp => cs}/SwitchExpressions.test | 0 .../SwitchExpressions_Tabs.actual.test | 0 .../SwitchExpressions_Tabs.test | 0 .../SwitchStatements.actual.test | 0 .../{CSharp => cs}/SwitchStatements.test | 0 .../ThrowExpressions.actual.test | 0 .../{CSharp => cs}/ThrowExpressions.test | 0 .../ThrowStatements.actual.test | 0 .../{CSharp => cs}/ThrowStatements.test | 0 .../{CSharp => cs}/TryStatements.actual.test | 0 .../{CSharp => cs}/TryStatements.test | 0 .../TupleExpressions.actual.test | 0 .../{CSharp => cs}/TupleExpressions.test | 0 .../TypeArgumentLists.actual.test | 0 .../{CSharp => cs}/TypeArgumentLists.test | 0 .../TypeOfExpressions.actual.test | 0 .../{CSharp => cs}/TypeOfExpressions.test | 0 ...TypeParameterConstraintClauses.actual.test | 0 .../TypeParameterConstraintClauses.test | 0 .../UnaryMinusExpressions.actual.test | 0 .../{CSharp => cs}/UnaryMinusExpressions.test | 0 .../UnaryPlusExpressions.actual.test | 0 .../{CSharp => cs}/UnaryPlusExpressions.test | 0 .../UnsafeStatements.actual.test | 0 .../{CSharp => cs}/UnsafeStatements.test | 0 .../UsingDirectives.actual.test | 0 .../{CSharp => cs}/UsingDirectives.test | 0 .../UsingStatements.actual.test | 0 .../{CSharp => cs}/UsingStatements.test | 0 .../VariableDeclarations.actual.test | 0 .../{CSharp => cs}/VariableDeclarations.test | 0 .../WhileStatements.actual.test | 0 .../{CSharp => cs}/WhileStatements.test | 0 .../WithExpressions.actual.test | 0 .../{CSharp => cs}/WithExpressions.test | 0 .../YieldReturnStatements.actual.test | 0 .../{CSharp => cs}/YieldReturnStatements.test | 0 Src/CSharpier.Tests/LineEndingTests.cs | 20 +- Src/CSharpier.Tests/Samples/Samples.cs | 30 ++- Src/CSharpier/CSharpFormatter.cs | 182 +++++++++++++++ Src/CSharpier/CodeFormatter.cs | 210 +----------------- Src/CSharpier/CodeFormatterResult.cs | 16 ++ Src/CSharpier/IFormatter.cs | 10 + Src/CSharpier/PrinterOptions.cs | 20 ++ Src/CSharpier/SyntaxNodeComparer.cs | 2 +- Src/CSharpier/XmlFormatter.cs | 13 ++ 305 files changed, 309 insertions(+), 249 deletions(-) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AddressOfExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AddressOfExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AliasQualifiedNames.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AliasQualifiedNames.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AnonymousMethodExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AnonymousMethodExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AnonymousObjectCreationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AnonymousObjectCreationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ArgumentLists.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ArgumentLists.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ArrayCreationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ArrayCreationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AsExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AsExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AssignmentExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AssignmentExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AttributeListNewLines.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AttributeListNewLines.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AttributeListNewLines.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AttributeLists.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AttributeLists.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AutoDashGenerated.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AutoDashGenerated.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AutoGenerated.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AutoGenerated.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AwaitExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/AwaitExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/BaseExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/BaseExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/BinaryExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/BinaryExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_CompilationUnit.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_CompilationUnit.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_CompilationUnit.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_Dont.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_Dont.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_Dont.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_TopLevel.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_TopLevel.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CSharpierIgnore_TopLevel.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CastExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CastExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CheckedStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CheckedStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations_EdgeCase.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations_EdgeCase.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations_EdgeCase.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations_Tabs.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ClassDeclarations_Tabs.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CloseBraceRemovesLines.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CloseBraceRemovesLines.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CloseBraceRemovesLines.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CoalesceExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CoalesceExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Comments.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Comments.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Comments_EdgeCase.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Comments_EdgeCase.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Comments_EdgeCase.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitAttributes.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitAttributes.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitAttributes.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase2.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase2.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase3.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase3.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase4.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase4.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase5.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase5.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase6.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase6.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase7.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/CompilationUnitIfDirectiveEdgeCase7.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConditionalAccessExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConditionalAccessExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConditionalExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConditionalExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConditionalExpressions_Tabs.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConditionalExpressions_Tabs.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConstructorDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConstructorDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConversionOperatorDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ConversionOperatorDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DeclarationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DeclarationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DefaultExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DefaultExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DelegateDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DelegateDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DestructorDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DestructorDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_AddAndRemoveLines.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_AddAndRemoveLines.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_AddAndRemoveLines.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_CompilationUnit.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_CompilationUnit.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_FileScopedNamespace.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_FileScopedNamespace.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_Namespace.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_Namespace.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_Regions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/Directives_Regions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DoStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/DoStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ElementAccessExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ElementAccessExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ElementBindingExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ElementBindingExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ElseStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ElseStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EmptyLines.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EmptyLines.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EmptyLines.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EnumDeclarationComments.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EnumDeclarationComments.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EnumDeclarationComments.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EnumDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EnumDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EventDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EventDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EventFieldDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/EventFieldDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ExternAliasDirectives.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ExternAliasDirectives.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FieldDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FieldDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileEncoding_USC2LEBOM.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileEncoding_USC2LEBOM.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileEncoding_UTF8.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileEncoding_UTF8.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileEncoding_UTF8BOM.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileEncoding_UTF8BOM.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileScopedNamespaceDeclaration.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FileScopedNamespaceDeclaration.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FixedStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FixedStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ForEachStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ForEachStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ForEachVariableStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ForEachVariableStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ForStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ForStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FunctionPointerTypes.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/FunctionPointerTypes.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/GlobalStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/GlobalStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IfStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IfStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ImplicitArrayCreationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ImplicitArrayCreationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ImplicitElementAccesses.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ImplicitElementAccesses.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ImplicitStackAllocArrayCreationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ImplicitStackAllocArrayCreationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IndexerDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IndexerDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InitializerExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InitializerExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InterfaceDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InterfaceDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InterpolatedStringExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InterpolatedStringExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InvocationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/InvocationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IsExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IsExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IsPatternExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/IsPatternExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LabeledStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LabeledStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ListPatterns.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ListPatterns.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LocalDeclarationStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LocalDeclarationStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LocalFunctionStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LocalFunctionStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LockStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/LockStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MakeRefExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MakeRefExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MemberAccessExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MemberAccessExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MemberLines.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MemberLines.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MemberLines.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MethodDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/MethodDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/NamespaceDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/NamespaceDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/NullableTypes.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/NullableTypes.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ObjectCreationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ObjectCreationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ObnoxiousEdgeCases.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ObnoxiousEdgeCases.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/OperatorDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/OperatorDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ParenthesizedExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ParenthesizedExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ParenthesizedLambdaExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ParenthesizedLambdaExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ParenthesizedVariableDesignations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ParenthesizedVariableDesignations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PostIncrementExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PostIncrementExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreIncrementExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreIncrementExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreprocessorSymbols.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreprocessorSymbols.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreprocessorSymbols.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreprocessorSymbols_KeepNewIines.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PreprocessorSymbols_KeepNewIines.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PropertyDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/PropertyDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/QueryExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/QueryExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/QueryExpressions_RemoveSpaces.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/QueryExpressions_RemoveSpaces.expected.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/QueryExpressions_RemoveSpaces.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RangeExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RangeExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RecordDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RecordDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RefExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RefExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RefTypes.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/RefTypes.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ReturnStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ReturnStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SimpleLambdaExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SimpleLambdaExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/StackAllocArrayCreationExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/StackAllocArrayCreationExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/StringLiterals.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/StringLiterals.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/StructDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/StructDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SwitchExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SwitchExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SwitchExpressions_Tabs.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SwitchExpressions_Tabs.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SwitchStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/SwitchStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ThrowExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ThrowExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ThrowStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/ThrowStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TryStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TryStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TupleExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TupleExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TypeArgumentLists.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TypeArgumentLists.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TypeOfExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TypeOfExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TypeParameterConstraintClauses.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/TypeParameterConstraintClauses.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UnaryMinusExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UnaryMinusExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UnaryPlusExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UnaryPlusExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UnsafeStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UnsafeStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UsingDirectives.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UsingDirectives.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UsingStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/UsingStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/VariableDeclarations.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/VariableDeclarations.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/WhileStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/WhileStatements.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/WithExpressions.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/WithExpressions.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/YieldReturnStatements.actual.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{CSharp => cs}/YieldReturnStatements.test (100%) create mode 100644 Src/CSharpier/CSharpFormatter.cs create mode 100644 Src/CSharpier/CodeFormatterResult.cs create mode 100644 Src/CSharpier/IFormatter.cs create mode 100644 Src/CSharpier/XmlFormatter.cs diff --git a/Src/CSharpier.Benchmarks/Program.cs b/Src/CSharpier.Benchmarks/Program.cs index c8c1546a1..f1e4c8b60 100644 --- a/Src/CSharpier.Benchmarks/Program.cs +++ b/Src/CSharpier.Benchmarks/Program.cs @@ -11,7 +11,7 @@ public class Benchmarks [Benchmark] public void Default_CodeFormatter() { - CodeFormatter.Format(this.largeCode, new PrinterOptions()); + CSharpFormatter.FormatAsync(this.largeCode, new PrinterOptions()).GetAwaiter().GetResult(); } [Benchmark] diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index 6d6146d51..d141ffef7 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -354,7 +354,8 @@ CancellationToken cancellationToken try { - codeFormattingResult = await CodeFormatter.FormatAsync( + // TODO xml find correct formatter + codeFormattingResult = await CSharpFormatter.FormatAsync( fileToFormatInfo.FileContents, printerOptions, cancellationToken diff --git a/Src/CSharpier.Cli/FileReader.cs b/Src/CSharpier.Cli/FileReader.cs index ca2c59fe1..63f994964 100644 --- a/Src/CSharpier.Cli/FileReader.cs +++ b/Src/CSharpier.Cli/FileReader.cs @@ -12,7 +12,7 @@ static FileReader() Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); } - public static async Task ReadFile( + public static async Task ReadFileAsync( string filePath, IFileSystem fileSystem, CancellationToken cancellationToken diff --git a/Src/CSharpier.Cli/FileToFormatInfo.cs b/Src/CSharpier.Cli/FileToFormatInfo.cs index f1cb75cf8..195517b1c 100644 --- a/Src/CSharpier.Cli/FileToFormatInfo.cs +++ b/Src/CSharpier.Cli/FileToFormatInfo.cs @@ -20,7 +20,7 @@ CancellationToken cancellationToken { cancellationToken.ThrowIfCancellationRequested(); - var (encoding, fileContents, unableToDetectEncoding) = await FileReader.ReadFile( + var (encoding, fileContents, unableToDetectEncoding) = await FileReader.ReadFileAsync( path, fileSystem, cancellationToken diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 70f9412c0..e0903dbf0 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -41,9 +41,9 @@ ILogger logger } [HttpPost] - public FormatResult Post([FromBody] string content) + public async Task Post([FromBody] string content) { - var result = CodeFormatter.Format( + var result = await CSharpFormatter.FormatAsync( content, new PrinterOptions { diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs index 66523bcee..840a5fe27 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs @@ -24,7 +24,7 @@ protected override object GetModel(GeneratorExecutionContext context) new { Name = Path.GetFileNameWithoutExtension(o.Path), - Type = new FileInfo(o.Path).Directory!.Name, + FileExtension = new FileInfo(o.Path).Directory!.Name, UseTabs = Path.GetFileNameWithoutExtension(o.Path).EndsWith("_Tabs") } ); diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt index 3b66f17ad..78908ab97 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt @@ -8,9 +8,9 @@ namespace CSharpier.Tests.FormattingTests { {{- for test in Tests }} [Test] - public void {{ test.Name }}() + public Task {{ test.Name }}() { - this.RunTest("{{ test.Name }}", "{{ test.Type }}"{{ if test.UseTabs }}, true{{ end }}); + return this.RunTest("{{ test.Name }}", "{{ test.FileExtension }}"{{ if test.UseTabs }}, true{{ end }}); } {{- end }} } diff --git a/Src/CSharpier.Tests/CSharpier.Tests.csproj b/Src/CSharpier.Tests/CSharpier.Tests.csproj index cafce0e3e..85f2c9cdf 100644 --- a/Src/CSharpier.Tests/CSharpier.Tests.csproj +++ b/Src/CSharpier.Tests/CSharpier.Tests.csproj @@ -27,4 +27,7 @@ $([System.String]::Copy(%(Filename)).Replace('.expected', '.test')) + + + diff --git a/Src/CSharpier.Tests/CodeFormatterTests.cs b/Src/CSharpier.Tests/CodeFormatterTests.cs index b8af97f09..e517676ad 100644 --- a/Src/CSharpier.Tests/CodeFormatterTests.cs +++ b/Src/CSharpier.Tests/CodeFormatterTests.cs @@ -4,6 +4,7 @@ namespace CSharpier.Tests; +// TODO xml move these around [TestFixture] [Parallelizable(ParallelScope.All)] internal class CodeFormatterTests @@ -13,7 +14,7 @@ internal class CodeFormatterTests public void GetLineEndings_Should_Return_Easy_Cases(EndOfLine endOfLine, string expected) { var code = "tester\n"; - var result = CodeFormatter.GetLineEnding( + var result = PrinterOptions.GetLineEnding( code, new PrinterOptions { EndOfLine = endOfLine } ); @@ -27,7 +28,7 @@ public void GetLineEndings_Should_Return_Easy_Cases(EndOfLine endOfLine, string [TestCase("tester", "\n")] public void GetLineEndings_With_Auto_Should_Detect(string code, string expected) { - var result = CodeFormatter.GetLineEnding(code, new PrinterOptions()); + var result = PrinterOptions.GetLineEnding(code, new PrinterOptions()); result.Should().Be(expected); } diff --git a/Src/CSharpier.Tests/DeepRecursionTests.cs b/Src/CSharpier.Tests/DeepRecursionTests.cs index 0511a14c6..af29de2c6 100644 --- a/Src/CSharpier.Tests/DeepRecursionTests.cs +++ b/Src/CSharpier.Tests/DeepRecursionTests.cs @@ -7,10 +7,10 @@ namespace CSharpier.Tests; public class DeepRecursionTests { [Test] - public void Format_Should_Return_Error_For_Deep_Recursion() + public async Task Format_Should_Return_Error_For_Deep_Recursion() { var code = this.uglyLongConcatenatedString; - var result = CodeFormatter.Format(code, new PrinterOptions()); + var result = await CSharpFormatter.FormatAsync(code, new PrinterOptions()); result.FailureMessage.Should().Be("We can't handle this deep of recursion yet."); } diff --git a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs index be2430413..b2c319ad7 100644 --- a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs +++ b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs @@ -11,28 +11,32 @@ public class BaseTest { private readonly DirectoryInfo rootDirectory = DirectoryFinder.FindParent("CSharpier.Tests"); - protected void RunTest(string fileName, string type, bool useTabs = false) + protected async Task RunTest(string fileName, string fileExtension, bool useTabs = false) { var filePath = Path.Combine( this.rootDirectory.FullName, "FormattingTests", "TestFiles", - type, + fileExtension, fileName + ".test" ); - var fileReaderResult = FileReader - .ReadFile(filePath, new FileSystem(), CancellationToken.None) - .Result; + var fileReaderResult = await FileReader.ReadFileAsync( + filePath, + new FileSystem(), + CancellationToken.None + ); PreprocessorSymbols.Reset(); - var result = CodeFormatter.Format( + // TODO xml use proper formatter + var result = await CSharpFormatter.FormatAsync( fileReaderResult.FileContents, - new PrinterOptions { Width = PrinterOptions.WidthUsedByTests, UseTabs = useTabs } + new PrinterOptions { Width = PrinterOptions.WidthUsedByTests, UseTabs = useTabs }, + CancellationToken.None ); var actualFilePath = filePath.Replace(".test", ".actual.test"); - File.WriteAllText(actualFilePath, result.Code, fileReaderResult.Encoding); + await File.WriteAllTextAsync(actualFilePath, result.Code, fileReaderResult.Encoding); var filePathToChange = filePath; var expectedFilePath = actualFilePath.Replace(".actual.", ".expected."); @@ -41,7 +45,7 @@ protected void RunTest(string fileName, string type, bool useTabs = false) if (File.Exists(expectedFilePath)) { - expectedCode = File.ReadAllText(expectedFilePath, Encoding.UTF8); + expectedCode = await File.ReadAllTextAsync(expectedFilePath, Encoding.UTF8); filePathToChange = expectedFilePath; } @@ -60,7 +64,7 @@ protected void RunTest(string fileName, string type, bool useTabs = false) if (normalizedCode != expectedCode && !BuildServerDetector.Detected) { - DiffRunner.Launch(filePathToChange, actualFilePath); + await DiffRunner.LaunchAsync(filePathToChange, actualFilePath); } normalizedCode.Should().Be(expectedCode); diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AddressOfExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AliasQualifiedNames.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousMethodExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AnonymousObjectCreationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArgumentLists.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ArrayCreationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AsExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AssignmentExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeListNewLines.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AttributeLists.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoDashGenerated.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AutoGenerated.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/AwaitExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BaseExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/BinaryExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_CompilationUnit.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_Dont.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CSharpierIgnore_TopLevel.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CastExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CheckedStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_EdgeCase.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ClassDeclarations_Tabs.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CloseBraceRemovesLines.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CoalesceExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Comments_EdgeCase.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitAttributes.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase2.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase3.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase4.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase5.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase6.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/CompilationUnitIfDirectiveEdgeCase7.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalAccessExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConditionalExpressions_Tabs.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConstructorDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ConversionOperatorDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DeclarationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DefaultExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DelegateDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DestructorDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_AddAndRemoveLines.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_CompilationUnit.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_FileScopedNamespace.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Namespace.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/Directives_Regions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/DoStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementAccessExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElementBindingExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ElseStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EmptyLines.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarationComments.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EnumDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/EventFieldDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ExternAliasDirectives.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FieldDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_USC2LEBOM.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileEncoding_UTF8BOM.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FileScopedNamespaceDeclaration.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FixedStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForEachVariableStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ForStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/FunctionPointerTypes.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/GlobalStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IfStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitArrayCreationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitElementAccesses.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ImplicitStackAllocArrayCreationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IndexerDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InitializerExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterfaceDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InterpolatedStringExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/InvocationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/IsPatternExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LabeledStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ListPatterns.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalDeclarationStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LocalFunctionStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/LockStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MakeRefExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberAccessExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MemberLines.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/MethodDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NamespaceDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/NullableTypes.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObjectCreationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ObnoxiousEdgeCases.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/OperatorDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedLambdaExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ParenthesizedVariableDesignations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PostIncrementExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreIncrementExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PreprocessorSymbols_KeepNewIines.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/PropertyDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.expected.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.expected.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.expected.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.expected.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/QueryExpressions_RemoveSpaces.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RangeExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RecordDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/RefTypes.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ReturnStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SimpleLambdaExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StackAllocArrayCreationExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StringLiterals.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/StructDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchExpressions_Tabs.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/SwitchStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/ThrowStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TryStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TupleExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeArgumentLists.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeOfExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/TypeParameterConstraintClauses.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryMinusExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnaryPlusExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UnsafeStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingDirectives.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/UsingStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/VariableDeclarations.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WhileStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/WithExpressions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.actual.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.actual.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.actual.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/CSharp/YieldReturnStatements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.test diff --git a/Src/CSharpier.Tests/LineEndingTests.cs b/Src/CSharpier.Tests/LineEndingTests.cs index 26755bc15..adfce513d 100644 --- a/Src/CSharpier.Tests/LineEndingTests.cs +++ b/Src/CSharpier.Tests/LineEndingTests.cs @@ -8,7 +8,7 @@ namespace CSharpier.Tests; internal class LineEndingTests { [Test] - public void LineEndings_Should_Not_Affect_Printed_Output_With_Verbatim_String() + public async Task LineEndings_Should_Not_Affect_Printed_Output_With_Verbatim_String() { // this is a verbatim string that is just the right size to format differently if it has \n vs \r\n in it var code = @@ -24,14 +24,14 @@ public void LineEndings_Should_Not_Affect_Printed_Output_With_Verbatim_String() var codeWithCrLf = codeWithLf.Replace("\n", "\r\n"); var printerOptions = new PrinterOptions { EndOfLine = EndOfLine.Auto, Width = 80 }; - var lfResult = CodeFormatter.Format(codeWithLf, printerOptions); - var crLfResult = CodeFormatter.Format(codeWithCrLf, printerOptions); + var lfResult = await CSharpFormatter.FormatAsync(codeWithLf, printerOptions); + var crLfResult = await CSharpFormatter.FormatAsync(codeWithCrLf, printerOptions); lfResult.Code.Should().Be(crLfResult.Code.Replace("\r\n", "\n")); } [Test] - public void LineEndings_Should_Not_Affect_Printed_Output_With_Interpolated_String() + public async Task LineEndings_Should_Not_Affect_Printed_Output_With_Interpolated_String() { // this is a interpolated verbatim string that is just the right size to format differently if it has \n vs \r\n in it var code = @@ -47,15 +47,15 @@ public void LineEndings_Should_Not_Affect_Printed_Output_With_Interpolated_Strin var codeWithCrLf = codeWithLf.Replace("\n", "\r\n"); var printerOptions = new PrinterOptions { EndOfLine = EndOfLine.Auto, Width = 80 }; - var lfResult = CodeFormatter.Format(codeWithLf, printerOptions); - var crLfResult = CodeFormatter.Format(codeWithCrLf, printerOptions); + var lfResult = await CSharpFormatter.FormatAsync(codeWithLf, printerOptions); + var crLfResult = await CSharpFormatter.FormatAsync(codeWithCrLf, printerOptions); lfResult.Code.Should().Be(crLfResult.Code.Replace("\r\n", "\n")); } [TestCase("\r\n", EndOfLine.LF)] [TestCase("\n", EndOfLine.CRLF)] - public void LineEndings_In_Verbatim_String_Should_Respect_Options( + public async Task LineEndings_In_Verbatim_String_Should_Respect_Options( string newLine, EndOfLine endOfLine ) @@ -67,13 +67,13 @@ EndOfLine endOfLine }} "; var printerOptions = new PrinterOptions { EndOfLine = endOfLine }; - var result = CodeFormatter.Format(code, printerOptions); + var result = await CSharpFormatter.FormatAsync(code, printerOptions); result.Code.Should().NotContain($"one{newLine}two"); } [TestCase("\\r\\n", EndOfLine.LF)] [TestCase("\\n", EndOfLine.CRLF)] - public void Escaped_LineEndings_In_Verbatim_String_Should_Remain( + public async Task Escaped_LineEndings_In_Verbatim_String_Should_Remain( string escapedNewLine, EndOfLine endOfLine ) @@ -85,7 +85,7 @@ EndOfLine endOfLine }} "; var printerOptions = new PrinterOptions { EndOfLine = endOfLine }; - var result = CodeFormatter.Format(code, printerOptions); + var result = await CSharpFormatter.FormatAsync(code, printerOptions); result.Code.Should().Contain(escapedNewLine); } } diff --git a/Src/CSharpier.Tests/Samples/Samples.cs b/Src/CSharpier.Tests/Samples/Samples.cs index 992d838ff..3a425d5ec 100644 --- a/Src/CSharpier.Tests/Samples/Samples.cs +++ b/Src/CSharpier.Tests/Samples/Samples.cs @@ -9,31 +9,31 @@ namespace CSharpier.Tests.Samples; public class Samples { [Test] - public void Scratch() + public async Task Scratch() { - RunTest("Scratch"); + await RunTest("Scratch"); } [Test] - public void AllInOne() + public async Task AllInOne() { - RunTest("AllInOne"); + await RunTest("AllInOne"); } - public static void RunTest(string fileName) + public static async Task RunTest(string fileName) { var directory = DirectoryFinder.FindParent("CSharpier.Tests"); var file = Path.Combine(directory.FullName, $"Samples/{fileName}.cst"); if (!File.Exists(file)) { - File.WriteAllText(file, ""); + await File.WriteAllTextAsync(file, ""); } - var code = File.ReadAllText(file); - var result = CodeFormatter.Format( + var code = await File.ReadAllTextAsync(file); + var result = await CSharpFormatter.FormatAsync( code, - new PrinterOptions { IncludeDocTree = true, IncludeAST = true, } + new PrinterOptions { IncludeDocTree = true, IncludeAST = true } ); var syntaxNodeComparer = new SyntaxNodeComparer(code, result.Code, CancellationToken.None); @@ -41,7 +41,15 @@ public static void RunTest(string fileName) var compareResult = syntaxNodeComparer.CompareSource(); compareResult.Should().BeEmpty(); - File.WriteAllText(file.Replace(".cst", ".actual.cst"), result.Code, Encoding.UTF8); - File.WriteAllText(file.Replace(".cst", ".doctree.txt"), result.DocTree, Encoding.UTF8); + await File.WriteAllTextAsync( + file.Replace(".cst", ".actual.cst"), + result.Code, + Encoding.UTF8 + ); + await File.WriteAllTextAsync( + file.Replace(".cst", ".doctree.txt"), + result.DocTree, + Encoding.UTF8 + ); } } diff --git a/Src/CSharpier/CSharpFormatter.cs b/Src/CSharpier/CSharpFormatter.cs new file mode 100644 index 000000000..58571087d --- /dev/null +++ b/Src/CSharpier/CSharpFormatter.cs @@ -0,0 +1,182 @@ +namespace CSharpier; + +using System.Text; +using System.Text.Json; +using CSharpier.SyntaxPrinter; + +internal class CSharpFormatter : IFormatter +{ + internal static readonly LanguageVersion LanguageVersion = LanguageVersion.Preview; + + Task IFormatter.FormatAsync( + string code, + PrinterOptions printerOptions, + CancellationToken cancellationToken + ) + { + return FormatAsync(code, printerOptions, cancellationToken); + } + + internal static Task FormatAsync( + string code, + PrinterOptions printerOptions + ) => FormatAsync(code, printerOptions, CancellationToken.None); + + internal static Task FormatAsync( + string code, + PrinterOptions printerOptions, + CancellationToken cancellationToken + ) + { + // if a user supplied symbolSets, then we should start with the first one + var initialSymbolSet = printerOptions.PreprocessorSymbolSets is { Count: > 0 } + ? printerOptions.PreprocessorSymbolSets.First() + : Array.Empty(); + + return FormatAsync( + ParseText(code, initialSymbolSet, cancellationToken), + printerOptions, + cancellationToken + ); + } + + private static SyntaxTree ParseText( + string codeToFormat, + string[] preprocessorSymbols, + CancellationToken cancellationToken + ) + { + return CSharpSyntaxTree.ParseText( + codeToFormat, + new CSharpParseOptions( + LanguageVersion, + DocumentationMode.Diagnose, + preprocessorSymbols: preprocessorSymbols + ), + cancellationToken: cancellationToken + ); + } + + internal static async Task FormatAsync( + SyntaxTree syntaxTree, + PrinterOptions printerOptions, + CancellationToken cancellationToken + ) + { + var syntaxNode = await syntaxTree.GetRootAsync(cancellationToken); + if (syntaxNode is not CompilationUnitSyntax rootNode) + { + throw new Exception( + "Root was not CompilationUnitSyntax, it was " + syntaxNode.GetType() + ); + } + + if (GeneratedCodeUtilities.BeginsWithAutoGeneratedComment(rootNode)) + { + return new CodeFormatterResult { Code = syntaxTree.ToString() }; + } + + bool TryGetCompilationFailure(out CodeFormatterResult compilationResult) + { + var diagnostics = syntaxTree + .GetDiagnostics(cancellationToken) + .Where(o => o.Severity == DiagnosticSeverity.Error && o.Id != "CS1029") + .ToList(); + if (diagnostics.Any()) + { + compilationResult = new CodeFormatterResult + { + Code = syntaxTree.ToString(), + CompilationErrors = diagnostics, + AST = printerOptions.IncludeAST ? PrintAST(rootNode) : string.Empty + }; + + return true; + } + + compilationResult = CodeFormatterResult.Null; + return false; + } + + if (TryGetCompilationFailure(out var result)) + { + return result; + } + + try + { + if (printerOptions.PreprocessorSymbolSets is { Count: > 0 }) + { + PreprocessorSymbols.StopCollecting(); + PreprocessorSymbols.SetSymbolSets( + // we already formatted with the first set above + printerOptions.PreprocessorSymbolSets.Skip(1).ToList() + ); + } + else + { + PreprocessorSymbols.Reset(); + } + + var lineEnding = PrinterOptions.GetLineEnding(syntaxTree.ToString(), printerOptions); + var document = Node.Print(rootNode, new FormattingContext { LineEnding = lineEnding }); + var formattedCode = DocPrinter.DocPrinter.Print(document, printerOptions, lineEnding); + + PreprocessorSymbols.StopCollecting(); + foreach (var symbolSet in PreprocessorSymbols.GetSymbolSets()) + { + syntaxTree = ParseText(formattedCode, symbolSet, cancellationToken); + + if (TryGetCompilationFailure(out result)) + { + return result; + } + + document = Node.Print( + await syntaxTree.GetRootAsync(cancellationToken), + new FormattingContext() + ); + formattedCode = DocPrinter.DocPrinter.Print(document, printerOptions, lineEnding); + } + + return new CodeFormatterResult + { + Code = formattedCode, + DocTree = printerOptions.IncludeDocTree + ? DocSerializer.Serialize(document) + : string.Empty, + AST = printerOptions.IncludeAST ? PrintAST(rootNode) : string.Empty + }; + } + catch (InTooDeepException) + { + return new CodeFormatterResult + { + FailureMessage = "We can't handle this deep of recursion yet." + }; + } + } + + private static string PrintAST(CompilationUnitSyntax rootNode) + { + try + { + var stringBuilder = new StringBuilder(); + SyntaxNodeJsonWriter.WriteCompilationUnitSyntax(stringBuilder, rootNode); + // SyntaxNodeJsonWriter doesn't write things indented, so this cleans it up for us + return JsonSerializer.Serialize( + JsonSerializer.Deserialize(stringBuilder.ToString()), + new JsonSerializerOptions { WriteIndented = false } + ); + } + // in some cases with new unsupported c# language features + // SyntaxNodeJsonWriter will not produce valid json + catch (JsonException ex) + { + return JsonSerializer.Serialize( + new { exception = ex.ToString() }, + new JsonSerializerOptions { WriteIndented = false } + ); + } + } +} diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index 3cce690a9..e78802a60 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -6,9 +6,6 @@ namespace CSharpier; public static class CodeFormatter { - internal static readonly LanguageVersion LanguageVersion = LanguageVersion.Preview; - -#pragma warning disable RS0026 // I know these are breaking and I can't seem to get Unshipped/Shipped happy with me doing it public static CodeFormatterResult Format(string code, CodeFormatterOptions? options = null) { return FormatAsync(code, options).Result; @@ -22,7 +19,11 @@ public static Task FormatAsync( { options ??= new(); - return FormatAsync(code, new PrinterOptions { Width = options.Width }, cancellationToken); + return CSharpFormatter.FormatAsync( + code, + new PrinterOptions { Width = options.Width }, + cancellationToken + ); } public static CodeFormatterResult Format( @@ -41,209 +42,10 @@ public static Task FormatAsync( { options ??= new(); - return FormatAsync( + return CSharpFormatter.FormatAsync( syntaxTree, new PrinterOptions { Width = options.Width }, cancellationToken ); } -#pragma warning restore RS0026 - - internal static CodeFormatterResult Format(string code, PrinterOptions printerOptions) - { - return FormatAsync(code, printerOptions, CancellationToken.None).Result; - } - - internal static Task FormatAsync( - string code, - PrinterOptions printerOptions, - CancellationToken cancellationToken - ) - { - // if a user supplied symbolSets, then we should start with the first one - var initialSymbolSet = printerOptions.PreprocessorSymbolSets is { Count: > 0 } - ? printerOptions.PreprocessorSymbolSets.First() - : Array.Empty(); - - return FormatAsync( - ParseText(code, initialSymbolSet, cancellationToken), - printerOptions, - cancellationToken - ); - } - - private static async Task FormatAsync( - SyntaxTree syntaxTree, - PrinterOptions printerOptions, - CancellationToken cancellationToken - ) - { - var syntaxNode = await syntaxTree.GetRootAsync(cancellationToken); - if (syntaxNode is not CompilationUnitSyntax rootNode) - { - throw new Exception( - "Root was not CompilationUnitSyntax, it was " + syntaxNode.GetType() - ); - } - - if (GeneratedCodeUtilities.BeginsWithAutoGeneratedComment(rootNode)) - { - return new CodeFormatterResult { Code = syntaxTree.ToString() }; - } - - bool TryGetCompilationFailure(out CodeFormatterResult compilationResult) - { - var diagnostics = syntaxTree - .GetDiagnostics(cancellationToken) - .Where(o => o.Severity == DiagnosticSeverity.Error && o.Id != "CS1029") - .ToList(); - if (diagnostics.Any()) - { - compilationResult = new CodeFormatterResult - { - Code = syntaxTree.ToString(), - CompilationErrors = diagnostics, - AST = printerOptions.IncludeAST ? PrintAST(rootNode) : string.Empty - }; - - return true; - } - - compilationResult = CodeFormatterResult.Null; - return false; - } - - if (TryGetCompilationFailure(out var result)) - { - return result; - } - - try - { - if (printerOptions.PreprocessorSymbolSets is { Count: > 0 }) - { - PreprocessorSymbols.StopCollecting(); - PreprocessorSymbols.SetSymbolSets( - // we already formatted with the first set above - printerOptions.PreprocessorSymbolSets.Skip(1).ToList() - ); - } - else - { - PreprocessorSymbols.Reset(); - } - - var lineEnding = GetLineEnding(syntaxTree.ToString(), printerOptions); - var document = Node.Print(rootNode, new FormattingContext { LineEnding = lineEnding }); - var formattedCode = DocPrinter.DocPrinter.Print(document, printerOptions, lineEnding); - - PreprocessorSymbols.StopCollecting(); - foreach (var symbolSet in PreprocessorSymbols.GetSymbolSets()) - { - syntaxTree = ParseText(formattedCode, symbolSet, cancellationToken); - - if (TryGetCompilationFailure(out result)) - { - return result; - } - - document = Node.Print( - await syntaxTree.GetRootAsync(cancellationToken), - new FormattingContext() - ); - formattedCode = DocPrinter.DocPrinter.Print(document, printerOptions, lineEnding); - } - - return new CodeFormatterResult - { - Code = formattedCode, - DocTree = printerOptions.IncludeDocTree - ? DocSerializer.Serialize(document) - : string.Empty, - AST = printerOptions.IncludeAST ? PrintAST(rootNode) : string.Empty - }; - } - catch (InTooDeepException) - { - return new CodeFormatterResult - { - FailureMessage = "We can't handle this deep of recursion yet." - }; - } - } - - private static SyntaxTree ParseText( - string codeToFormat, - string[] preprocessorSymbols, - CancellationToken cancellationToken - ) - { - return CSharpSyntaxTree.ParseText( - codeToFormat, - new CSharpParseOptions( - LanguageVersion, - DocumentationMode.Diagnose, - preprocessorSymbols: preprocessorSymbols - ), - cancellationToken: cancellationToken - ); - } - - internal static string GetLineEnding(string code, PrinterOptions printerOptions) - { - if (printerOptions.EndOfLine != EndOfLine.Auto) - { - return printerOptions.EndOfLine == EndOfLine.CRLF ? "\r\n" : "\n"; - } - - var lineIndex = code.IndexOf('\n'); - if (lineIndex <= 0) - { - return "\n"; - } - if (code[lineIndex - 1] == '\r') - { - return "\r\n"; - } - - return "\n"; - } - - private static string PrintAST(CompilationUnitSyntax rootNode) - { - try - { - var stringBuilder = new StringBuilder(); - SyntaxNodeJsonWriter.WriteCompilationUnitSyntax(stringBuilder, rootNode); - // SyntaxNodeJsonWriter doesn't write things indented, so this cleans it up for us - return JsonSerializer.Serialize( - JsonSerializer.Deserialize(stringBuilder.ToString()), - new JsonSerializerOptions { WriteIndented = false } - ); - } - // in some cases with new unsupported c# language features - // SyntaxNodeJsonWriter will not produce valid json - catch (JsonException ex) - { - return JsonSerializer.Serialize( - new { exception = ex.ToString() }, - new JsonSerializerOptions { WriteIndented = false } - ); - } - } -} - -public class CodeFormatterResult -{ - internal CodeFormatterResult() { } - - public string Code { get; internal init; } = string.Empty; - internal string DocTree { get; init; } = string.Empty; - internal string AST { get; init; } = string.Empty; - public IEnumerable CompilationErrors { get; internal init; } = - Enumerable.Empty(); - - internal string FailureMessage { get; init; } = string.Empty; - - internal static readonly CodeFormatterResult Null = new(); } diff --git a/Src/CSharpier/CodeFormatterResult.cs b/Src/CSharpier/CodeFormatterResult.cs new file mode 100644 index 000000000..66eaa6749 --- /dev/null +++ b/Src/CSharpier/CodeFormatterResult.cs @@ -0,0 +1,16 @@ +namespace CSharpier; + +public class CodeFormatterResult +{ + internal CodeFormatterResult() { } + + public string Code { get; internal init; } = string.Empty; + internal string DocTree { get; init; } = string.Empty; + internal string AST { get; init; } = string.Empty; + public IEnumerable CompilationErrors { get; internal init; } = + Enumerable.Empty(); + + internal string FailureMessage { get; init; } = string.Empty; + + internal static readonly CodeFormatterResult Null = new(); +} \ No newline at end of file diff --git a/Src/CSharpier/IFormatter.cs b/Src/CSharpier/IFormatter.cs new file mode 100644 index 000000000..96f8bb59c --- /dev/null +++ b/Src/CSharpier/IFormatter.cs @@ -0,0 +1,10 @@ +namespace CSharpier; + +internal interface IFormatter +{ + Task FormatAsync( + string code, + PrinterOptions printerOptions, + CancellationToken cancellationToken + ); +} \ No newline at end of file diff --git a/Src/CSharpier/PrinterOptions.cs b/Src/CSharpier/PrinterOptions.cs index 921672c14..2e4d67959 100644 --- a/Src/CSharpier/PrinterOptions.cs +++ b/Src/CSharpier/PrinterOptions.cs @@ -12,6 +12,26 @@ internal class PrinterOptions public List? PreprocessorSymbolSets { get; init; } public const int WidthUsedByTests = 100; + + internal static string GetLineEnding(string code, PrinterOptions printerOptions) + { + if (printerOptions.EndOfLine != EndOfLine.Auto) + { + return printerOptions.EndOfLine == EndOfLine.CRLF ? "\r\n" : "\n"; + } + + var lineIndex = code.IndexOf('\n'); + if (lineIndex <= 0) + { + return "\n"; + } + if (code[lineIndex - 1] == '\r') + { + return "\r\n"; + } + + return "\n"; + } } internal enum EndOfLine diff --git a/Src/CSharpier/SyntaxNodeComparer.cs b/Src/CSharpier/SyntaxNodeComparer.cs index b22c38890..405a2eafa 100644 --- a/Src/CSharpier/SyntaxNodeComparer.cs +++ b/Src/CSharpier/SyntaxNodeComparer.cs @@ -20,7 +20,7 @@ CancellationToken cancellationToken this.OriginalSourceCode = originalSourceCode; this.NewSourceCode = newSourceCode; - var cSharpParseOptions = new CSharpParseOptions(CodeFormatter.LanguageVersion); + var cSharpParseOptions = new CSharpParseOptions(CSharpFormatter.LanguageVersion); this.OriginalSyntaxTree = CSharpSyntaxTree.ParseText( this.OriginalSourceCode, cSharpParseOptions, diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs new file mode 100644 index 000000000..f40076234 --- /dev/null +++ b/Src/CSharpier/XmlFormatter.cs @@ -0,0 +1,13 @@ +namespace CSharpier; + +internal class XmlFormatter : IFormatter +{ + public Task FormatAsync( + string code, + PrinterOptions printerOptions, + CancellationToken cancellationToken + ) + { + throw new NotImplementedException(); + } +} From c617fe4465bbc611d46421a9fcfc4443476e63d9 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 11:21:04 -0500 Subject: [PATCH 04/21] Updating ignore --- .gitignore | 2 +- .../cs/AddressOfExpressions.actual.test | 9 - .../cs/AliasQualifiedNames.actual.test | 7 - .../cs/AnonymousMethodExpressions.actual.test | 34 - ...ymousObjectCreationExpressions.actual.test | 18 - .../TestFiles/cs/ArgumentLists.actual.test | 9 - .../cs/ArrayCreationExpressions.actual.test | 22 - .../TestFiles/cs/AsExpressions.actual.test | 7 - .../cs/AssignmentExpressions.actual.test | 86 -- .../cs/AttributeListNewLines.actual.test | 12 - .../TestFiles/cs/AttributeLists.actual.test | 114 -- .../cs/AutoDashGenerated.actual.test | 26 - .../TestFiles/cs/AutoGenerated.actual.test | 4 - .../TestFiles/cs/AwaitExpressions.actual.test | 7 - .../TestFiles/cs/BaseExpressions.actual.test | 7 - .../cs/BinaryExpressions.actual.test | 219 --- .../TestFiles/cs/CSharpierIgnore.actual.test | 148 -- ...SharpierIgnore_CompilationUnit.actual.test | 8 - .../cs/CSharpierIgnore_Dont.actual.test | 20 - .../cs/CSharpierIgnore_TopLevel.actual.test | 19 - .../TestFiles/cs/CastExpressions.actual.test | 45 - .../cs/CheckedStatements.actual.test | 21 - .../cs/ClassDeclarations.actual.test | 61 - .../cs/ClassDeclarations_EdgeCase.actual.test | 3 - .../cs/ClassDeclarations_Tabs.actual.test | 59 - .../cs/CloseBraceRemovesLines.actual.test | 7 - .../cs/CoalesceExpressions.actual.test | 4 - .../TestFiles/cs/Comments.actual.test | 105 -- .../cs/Comments_EdgeCase.actual.test | 51 - .../cs/CompilationUnitAttributes.actual.test | 6 - ...ilationUnitIfDirectiveEdgeCase.actual.test | 10 - ...lationUnitIfDirectiveEdgeCase2.actual.test | 12 - ...lationUnitIfDirectiveEdgeCase3.actual.test | 6 - ...lationUnitIfDirectiveEdgeCase4.actual.test | 6 - ...lationUnitIfDirectiveEdgeCase5.actual.test | 6 - ...lationUnitIfDirectiveEdgeCase6.actual.test | 5 - ...lationUnitIfDirectiveEdgeCase7.actual.test | 8 - .../ConditionalAccessExpressions.actual.test | 7 - .../cs/ConditionalExpressions.actual.test | 143 -- .../ConditionalExpressions_Tabs.actual.test | 143 -- .../cs/ConstructorDeclarations.actual.test | 130 -- ...ConversionOperatorDeclarations.actual.test | 23 - .../cs/DeclarationExpressions.actual.test | 7 - .../cs/DefaultExpressions.actual.test | 7 - .../cs/DelegateDeclarations.actual.test | 7 - .../cs/DestructorDeclarations.actual.test | 5 - .../TestFiles/cs/Directives.actual.test | 99 -- .../Directives_AddAndRemoveLines.actual.test | 75 - .../cs/Directives_CompilationUnit.actual.test | 19 - ...Directives_FileScopedNamespace.actual.test | 15 - .../cs/Directives_Namespace.actual.test | 16 - .../cs/Directives_Regions.actual.test | 42 - .../TestFiles/cs/DoStatements.actual.test | 22 - .../cs/ElementAccessExpressions.actual.test | 5 - .../cs/ElementBindingExpressions.actual.test | 7 - .../TestFiles/cs/ElseStatements.actual.test | 35 - .../TestFiles/cs/EmptyLines.actual.test | 26 - .../cs/EnumDeclarationComments.actual.test | 21 - .../TestFiles/cs/EnumDeclarations.actual.test | 13 - .../cs/EventDeclarations.actual.test | 13 - .../cs/EventFieldDeclarations.actual.test | 4 - .../cs/ExternAliasDirectives.actual.test | 15 - .../cs/FieldDeclarations.actual.test | 116 -- .../cs/FileEncoding_USC2LEBOM.actual.test | Bin 130 -> 0 bytes .../cs/FileEncoding_UTF8.actual.test | 10 - .../cs/FileEncoding_UTF8BOM.actual.test | 10 - ...FileScopedNamespaceDeclaration.actual.test | 7 - .../TestFiles/cs/FixedStatements.actual.test | 45 - .../cs/ForEachStatements.actual.test | 123 -- .../cs/ForEachVariableStatements.actual.test | 10 - .../TestFiles/cs/ForStatements.actual.test | 104 -- .../cs/FunctionPointerTypes.actual.test | 26 - .../TestFiles/cs/GlobalStatements.actual.test | 10 - .../TestFiles/cs/IfStatements.actual.test | 82 -- ...plicitArrayCreationExpressions.actual.test | 36 - .../cs/ImplicitElementAccesses.actual.test | 10 - ...kAllocArrayCreationExpressions.actual.test | 7 - .../cs/IndexerDeclarations.actual.test | 4 - .../cs/InitializerExpressions.actual.test | 242 ---- .../cs/InterfaceDeclarations.actual.test | 14 - .../InterpolatedStringExpressions.actual.test | 28 - .../cs/InvocationExpressions.actual.test | 242 ---- .../TestFiles/cs/IsExpressions.actual.test | 7 - .../cs/IsPatternExpressions.actual.test | 242 ---- .../cs/LabeledStatements.actual.test | 8 - .../TestFiles/cs/ListPatterns.actual.test | 21 - .../cs/LocalDeclarationStatements.actual.test | 9 - .../cs/LocalFunctionStatements.actual.test | 20 - .../TestFiles/cs/LockStatements.actual.test | 13 - .../cs/MakeRefExpressions.actual.test | 7 - .../cs/MemberAccessExpressions.actual.test | 17 - .../TestFiles/cs/MemberLines.actual.test | 160 --- .../cs/MethodDeclarations.actual.test | 124 -- .../cs/NamespaceDeclarations.actual.test | 20 - .../TestFiles/cs/NullableTypes.actual.test | 4 - .../cs/ObjectCreationExpressions.actual.test | 43 - .../cs/ObnoxiousEdgeCases.actual.test | 162 --- .../cs/OperatorDeclarations.actual.test | 21 - .../cs/ParenthesizedExpressions.actual.test | 16 - ...ParenthesizedLambdaExpressions.actual.test | 91 -- ...enthesizedVariableDesignations.actual.test | 12 - .../cs/PostIncrementExpressions.actual.test | 7 - .../cs/PreIncrementExpressions.actual.test | 7 - .../cs/PreprocessorSymbols.actual.test | 52 - ...eprocessorSymbols_KeepNewIines.actual.test | 17 - .../cs/PropertyDeclarations.actual.test | 105 -- .../TestFiles/cs/QueryExpressions.actual.test | 102 -- .../QueryExpressions_RemoveSpaces.actual.test | 14 - .../TestFiles/cs/RangeExpressions.actual.test | 14 - .../cs/RecordDeclarations.actual.test | 53 - .../TestFiles/cs/RefExpressions.actual.test | 7 - .../TestFiles/cs/RefTypes.actual.test | 7 - .../TestFiles/cs/ReturnStatements.actual.test | 25 - .../cs/SimpleLambdaExpressions.actual.test | 25 - ...kAllocArrayCreationExpressions.actual.test | 10 - .../TestFiles/cs/StringLiterals.actual.test | 165 --- .../cs/StructDeclarations.actual.test | 3 - .../cs/SwitchExpressions.actual.test | 92 -- .../cs/SwitchExpressions_Tabs.actual.test | 92 -- .../TestFiles/cs/SwitchStatements.actual.test | 116 -- .../TestFiles/cs/ThrowExpressions.actual.test | 7 - .../TestFiles/cs/ThrowStatements.actual.test | 7 - .../TestFiles/cs/TryStatements.actual.test | 59 - .../TestFiles/cs/TupleExpressions.actual.test | 53 - .../cs/TypeArgumentLists.actual.test | 4 - .../cs/TypeOfExpressions.actual.test | 7 - ...TypeParameterConstraintClauses.actual.test | 89 -- .../cs/UnaryMinusExpressions.actual.test | 4 - .../cs/UnaryPlusExpressions.actual.test | 4 - .../TestFiles/cs/UnsafeStatements.actual.test | 10 - .../TestFiles/cs/UsingDirectives.actual.test | 28 - .../TestFiles/cs/UsingStatements.actual.test | 70 - .../cs/VariableDeclarations.actual.test | 184 --- .../TestFiles/cs/WhileStatements.actual.test | 58 - .../TestFiles/cs/WithExpressions.actual.test | 14 - .../cs/YieldReturnStatements.actual.test | 8 - .../Samples/AllInOne.actual.cst | 1202 +++++++++++++++++ .../Samples/Scratch.actual.cst | 1 + 138 files changed, 1204 insertions(+), 5733 deletions(-) delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.actual.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.actual.test create mode 100644 Src/CSharpier.Tests/Samples/AllInOne.actual.cst create mode 100644 Src/CSharpier.Tests/Samples/Scratch.actual.cst diff --git a/.gitignore b/.gitignore index bcb2d1292..83a3ae95e 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,7 @@ build publish *.doctree.txt -*.actual.cst +*.actual.test *.vsix /.husky/pre-commit diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.actual.test deleted file mode 100644 index 9bb2f2aaf..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AddressOfExpressions.actual.test +++ /dev/null @@ -1,9 +0,0 @@ -class ClassName -{ - void MethodName() - { - Point point; - Point* p = &point; - p->x = 10; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.actual.test deleted file mode 100644 index 4dd06229f..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AliasQualifiedNames.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - global::System.String s = "a"; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.actual.test deleted file mode 100644 index 86e2f7a4d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousMethodExpressions.actual.test +++ /dev/null @@ -1,34 +0,0 @@ -class ClassName -{ - void MethodName() - { - Func f1 = delegate(bool a) - { - return !a; - }; - - Func f2 = static delegate(bool a) - { - return !a; - }; - - Func f3 = async delegate(bool a) - { - return await !a; - }; - - Func f4 = async static delegate(bool a) - { - return await !a; - }; - - Func f5 = delegate( - string longName, - string longerName, - string longestName________________________________________ - ) - { - return !a; - }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.actual.test deleted file mode 100644 index 7cfb349d5..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AnonymousObjectCreationExpressions.actual.test +++ /dev/null @@ -1,18 +0,0 @@ -public class ClassName -{ - public dynamic ShortValue = new { Property = true }; - - public dynamic LongValue = new - { - One = "One", - Two = "Two", - ThreeThreeThree = "ThreeThreeThree" - }; - - public dynamic Value = new { NoName }; - - public void Method() - { - var x = new { }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.actual.test deleted file mode 100644 index 9ac5f6f5d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArgumentLists.actual.test +++ /dev/null @@ -1,9 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - this.Method(true); - - this.NamedArguments(b: true, c: "false"); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.actual.test deleted file mode 100644 index 8612227c8..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ArrayCreationExpressions.actual.test +++ /dev/null @@ -1,22 +0,0 @@ -class ClassName -{ - float[] arrayWithInitializer = new float[5] { 0f, 1.1f }; - - int[] array = new int[5]; - - var anArray = new int[5, 10]; - - var aLongArray_________________________________________________________________________ = - new int[5, 10]; - - var anArrayWithLongRanks = new byte[ - someReallyLongThing__________________________, - someReallyLongThing__________________________ - ]; - - private static readonly char[] initializerIndents = new char[] - { - Path.DirectorySeparatorChar, - Path.AltDirectorySeparatorChar - }; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.actual.test deleted file mode 100644 index 292606a15..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AsExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - var x = null as object ?? null; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.actual.test deleted file mode 100644 index 562ba833f..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AssignmentExpressions.actual.test +++ /dev/null @@ -1,86 +0,0 @@ -class ClassName -{ - void MethodName() - { - var x = 0; - x = 15; - - // leading on statement - var x = 0; - - // leading on expression - x = 15; - - x = 25; // trailing!!!! - - assignmentInstructionalText = - editAssignmentViewModel.InstructionalTextxxxxxxxxxx ?? string.Empty; - - value = - someLongValue__________________________________ - && someOtherValue__________________________________ - ? trueValue - : falseValue; - - value = someLongCondition________________________________ - ? "someLongValue" - : "someOtherLongValue"; - - var nonChainFormatting = anotherVariable1 = - "someValue____________________________________________"; - - nonChainFormatting = anotherVariable1 = - "someValue____________________________________________"; - - var chainFormatting = - anotherVariable1 = - anotherVariable2 = - "someValue____________________________________________"; - - chainFormatting = - anotherVariable1 = - anotherVariable2 = - "someValue____________________________________________"; - - var nonChainFormatting = anotherVariable1 = CallMethod( - parameter________________________________, - parameter________________________________ - ); - - nonChainFormatting = anotherVariable1 = CallMethod( - parameter________________________________, - parameter________________________________ - ); - - var chainFormatting = - anotherVariable1 = - anotherVariable2 = - CallMethod( - parameter________________________________, - parameter________________________________ - ); - - chainFormatting = - anotherVariable1 = - anotherVariable2 = - CallMethod( - parameter________________________________, - parameter________________________________ - ); - } - - public SomeExpressionBodyMethod() => - nonChainFormatting = anotherVariable1 = ( - someCondition________________________________ - || someOtherCondition___________________________ - ); - - public SomeExpressionBodyMethod() => - chainFormatting = - anotherVariable1 = - anotherVariable2 = - ( - someCondition________________________________ - || someOtherCondition___________________________ - ); -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.actual.test deleted file mode 100644 index efd8c9dbe..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeListNewLines.actual.test +++ /dev/null @@ -1,12 +0,0 @@ -namespace Namespace -{ - [Obsolete] - class ClassOne { } - - [Obsolete] - [NoNewLine] - // do stuff - class ClassTwo { } - - class ClassThree { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.actual.test deleted file mode 100644 index 815492798..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AttributeLists.actual.test +++ /dev/null @@ -1,114 +0,0 @@ -[assembly: System.Copyright("(C) 2009")] -[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] - -[Obsolete] -class ClassName -{ - [Obsolete] - private string Field; - - [Obsolete] - public string Property - { - [Obsolete] - get; - [Obsolete] - set; - } - - [Obsolete, NonSerialized] - void MethodName([In] string value) { } - - [ - Obsolete, - System.NonSerialized, - NonSerialized, - CLSCompliant(true || false & true), - AnotherRandomAttribute - ] - private volatile int f2; - - [DllImport("kernel32", SetLastError = true)] - static extern bool NameEquals(string name, SecurityAttribute sa); - - [Obsolete("Error", error: true)] - void NameColon() { } - - [return: Obsolete] - [method: Obsolete] - void Targets() { } - - // leading - [Obsolete] // trailing - class ClassOne { } - - // leading with new line - [Obsolete] // more trailing - // leading before class - class ClassTwo { } - - [LongAttributeWithParametersBreaking( - "someValue_____________", - "someValue_____________", - "someValue_____________" - )] - void LongAttribute() { } - - public void MethodName([FromBody] SomeParameter parameter) - { - return; - } - - public void MethodName( - int someParameter, - [ShortAttributeName] AnotherObject anotherObject, - [VeryLongAttributeName(SomeFlag.SomeValue, SomeOtherFlag.SomeOtherLongValue)] - string tabbedBreakParameter, - bool anotherParameter - ) - { - return; - } - - public void MethodWithAttributesOnTypeParameters<[SomeShort] T, K>() { } - - public void MethodWithAttributesOnTypeParameters< - [SomeLongAttribute__________________________] T, - K - >() { } - - public void MethodWithAttributesOnTypeParameters< - [SomeLongAttribute__________________________] - TSomeMuchLongerName___________________________________, - K - >() { } - - public void MethodWithAttributesOnTypeParameters< - [SomeAttributeWithParameters( - longParameter_____________________________, - longParameter_____________________________ - )] - TSomeMuchLongerName___________________________________, - K - >() { } -} - -[ - LongAttributeWithParametersBreaking( - "someValue_____________", - "someValue_____________", - "someValue_____________" - ), - AnotherAttribute -] -public class ClassName { } - -[GenericAttribute()] -public class ClassName { } - -[Generic< - LongName______________________, - LongName______________________, - LongName______________________ ->] -public class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.actual.test deleted file mode 100644 index ecce5c838..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoDashGenerated.actual.test +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Insite.WIS.Epicor.Epicor10CashGrpService { - using System.Runtime.Serialization; - using System; - - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name="IceTableset", Namespace="http://schemas.datacontract.org/2004/07/Ice")] - [System.SerializableAttribute()] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.BOUpdErrorTableset))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.CashGrpListTableset))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.UpdExtCashGrpTableset))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(Insite.WIS.Epicor.Epicor10CashGrpService.CashGrpTableset))] - public partial class IceTableset : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { - } -} \ No newline at end of file diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.actual.test deleted file mode 100644 index 2f7e5ec5a..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AutoGenerated.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -// -using System; -using System.Reflection; -[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.actual.test deleted file mode 100644 index 783dfafbe..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/AwaitExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - async void MethodName() - { - await System.Threading.Tasks.Task.Delay(0); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.actual.test deleted file mode 100644 index 656c20bf4..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BaseExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - return base.MethodName(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.actual.test deleted file mode 100644 index f398085ba..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/BinaryExpressions.actual.test +++ /dev/null @@ -1,219 +0,0 @@ -class TestClass -{ - public string SomeProperty => - "someLongStringValue__________________________" - + "someOtherLongStringValue_______________________________"; - - void TestMethod() - { - var someVar = "a string" + thatIsJust(shortEnough) + "to not wrap"; - - var someLongVariableName = - "a long string with just concatenation" - + "will break this way" - + "because of reasons such as the fact it is too long"; - - var someLongVariableName = - "a really loooooooooooooooong string" - + someMethodCall("with long args") - + "really long string"; - - var samePrecedenceAligns = - one_________________________________ - + two_______________________________ - - three_____________________________ - + four______________________________; - - var coalesceIsSpecial = - someValue_________________________ - ?? someOtherValue_______________________ - ?? someOtherValue_______________________; - - coalesceIsSpecial ??= - someValue_________________________ - ?? someOtherValue_______________________ - ?? someOtherValue_______________________; - - CallSomeLongMethodWithStringConcatenationThatShouldNotBreak( - csharpDirectory + ".generated.cs", - output.ToString() - ); - - var commentsDontBreakBinary = - // shouldn't break next line - true || false; - - var commentsDontBreakBinary = - // shouldn't break next line - // shouldn't break next line - true || false; - - var directivesDontBreakBinary = -#pragma - true || false; - - var conditionalIndentation = someBoolean - ? someLongValue____________________________________ - + someLongValue____________________________________ - : someLongValue____________________________________ - + someLongValue____________________________________; - - var someValue = - value1__________________ == value2_________________ - != (value3_______________________ == value4___________________); - - if ( - one == two - || someValue_______________ - == thisWillIndent_______________________________________________________________ - ) { } - - while ( - one == two - || someValue_______________ - == thisWillIndent_______________________________________________________________ - ) { } - - switch ( - one == two - || someValue_______________ - == thisWillIndent_______________________________________________________________ - ) { } - - do - { - CallSomething(); - } while ( - one == two - || someValue_______________ - == thisWillIndent_______________________________________________________________ - ); - - CallMethod( - "shouldIndentToMakeItClearWhereParametersAre" - + "someLongString_________________________________", - "SecondParameter" - ); - - var y = someList.Where( - o => - someLongValue_______________________ - && theseShouldNotIndent_________________ - && theseShouldNotIndent_________________ - > butThisOneShould_________________________________________ - ); - - var someVariable = - CallMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) - && CallMethod() == someValue; - - var someValue = - someLongThing___________________________.someLongThing_____________ ?? someOtherThing; - - if ( - one - two == three - || one + two == three - || one * two == three - || one / two == three - || one % two == three - || one != three - || one < two - || one > two - || one <= two - || one >= two - || one is null - || one as Something == null - || one - two > three - || someLongThing - someOtherLongThing__________________________________ - > anotherLongThing - ) { } - - if ( - CallSomeMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) == 0 - ) { } - - if ( - someValue - && CallSomeMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) == 0 - ) { } - - if ( - CallSomeMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) == 0 - && someValue - ) { } - - if ( - CallMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) - && CallMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) - ) { } - - if ( - CallMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) || CallMethod(shortValue, "shortValue") - ) { } - - if ( - CallMethod( - someParameter_____________________________________, - someParameter_____________________________________ - ) - || CallMethod(shortValue, "shortValue") - || CallMethod(shortValue1, "shortValue1") - ) { } - - if ( - CallSomeMethod(someParameter) - == someLongerValue_______________________________________________________________ - ) { } - - return someValue != someOtherValue - && someLongValue_____________________ == someOtherLongValue_____________________; - - var someValue = - CallSomething( - someLongValue__________________________________________, - someLongValue__________________________________________ - ) == someOtherValue; - - var coalesceIsSpecial = - CallSomething( - someLongValue__________________________________________, - someLongValue__________________________________________ - ) ?? someOtherValue; - - var notIdealSee355 = - variable - .Replace(someParameter_______________________, '.') - .Replace(someParameter_______________________, '.') + "."; - - UglyButConsistentWithPrettier( - someValue - == someLongThing__________________________________________________________________ - || someOtherValue - == someOtherLongThing________________________________________________, - secondParameter - ); - - var x = one >>> two; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.actual.test deleted file mode 100644 index f37140e1b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore.actual.test +++ /dev/null @@ -1,148 +0,0 @@ -// csharpier-ignore -public class Unformatted { } - -// csharpier-ignore - also ignored -public class Unformatted { } - -// csharpier-ignore-not ignored -public class Unformatted { } - -public class ClassName -{ - // csharpier-ignore - private string unformatted; - - void BasicSingleIgnores() - { - // csharpier-ignore - var unformatted = true; - // csharpier-ignore - var trimsTrailingHere = true; - - if (true) - { - // csharpier-ignore - var unformatted = true; - } - } - - void RangeWithNodeAfter() - { - var formatMe = true; - // csharpier-ignore-start - var trimsTrailing1 = true; - var trimsTrailing2 = true; - // csharpier-ignore-start - var unformatted1 = true; - var unformatted2 = true; - // csharpier-ignore-end - var formatMe = true; - } - - void MultipleStatements() - { - // csharpier-ignore-start - var packet = new List(); - packet.Add(0x0f); packet.Add(0x00); - packet.Add(0x0f); packet.Add(0x00); - // csharpier-ignore-end - } - - void RangeToEndMethod() - { - var formatMe = true; - // csharpier-ignore-start - var unformatted1 = true; - var unformatted2 = true; - // csharpier-ignore-end - } - - void RangeWithoutEnd() - { - var formatMe = true; - // csharpier-ignore-start - var unformatted = true; - var unformatted = true; - } -} - -public class ClassName2 -{ - // csharpier-ignore-start - private string unformatted1; - // csharpier-ignore-end - - // csharpier-ignore-start - also ignored - private string unformatted1; - // csharpier-ignore-end - also ignored - - // csharpier-ignore-start-not ignored - private string unformatted1; - - // csharpier-ignore-end-not ignored - - private string formatMe; - // csharpier-ignore-start - private string noNewLine; - // csharpier-ignore-end - - // csharpier-ignore-start - private string keepNewLine; - // csharpier-ignore-end - - public void Method() - { - // csharpier-ignore-start - string unformatted1; - // csharpier-ignore-end - - string formatMe; - // csharpier-ignore-start - string noNewLine; - // csharpier-ignore-end - - // csharpier-ignore-start - string keepNewLine; - // csharpier-ignore-end - } - - public void KeepLines1() - { - // csharpier-ignore-start - var unformattedWithLine1; - - var unformattedWithLine2; - // csharpier-ignore-end - } - - public void KeepLines2() - { - // csharpier-ignore-start - string unformattedWithLine1; - - string unformattedWithLine2; - // csharpier-ignore-end - - string anotherValue; - } -} - -public class KeepLines1 -{ - // csharpier-ignore-start - private string first; - - private string second; - // csharpier-ignore-end -} - -public class KeepLines2 -{ - // csharpier-ignore-start - private string first; - - private string second; - // csharpier-ignore-end - - private string third; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.actual.test deleted file mode 100644 index 681e8f917..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_CompilationUnit.actual.test +++ /dev/null @@ -1,8 +0,0 @@ -namespace Namespace -{ - // csharpier-ignore-start - public class Unformatted { } - // csharpier-ignore-end - - public class FormatMe { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.actual.test deleted file mode 100644 index 0f4ce0536..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_Dont.actual.test +++ /dev/null @@ -1,20 +0,0 @@ -public -// csharpier-ignore -class ClassName -{ - private void MethodName( - // csharpier-ignore - string one - ) - { - var x - // csharpier-ignore - = someRandomValue; - - this.CallMethod( - // csharpier-ignore - true, - false - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.actual.test deleted file mode 100644 index 8ca05435c..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CSharpierIgnore_TopLevel.actual.test +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -// csharpier-ignore-start -string unformatted1; -// csharpier-ignore-end - -string formatMe; -// csharpier-ignore-start - string noNewLine; -// csharpier-ignore-end - -// csharpier-ignore-start -string keepNewLine; -// csharpier-ignore-end - - -// csharpier-ignore-start -string removeNewLine; -// csharpier-ignore-end diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.actual.test deleted file mode 100644 index 84981502b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CastExpressions.actual.test +++ /dev/null @@ -1,45 +0,0 @@ -class ClassName -{ - private short x = (short)0; - - void MethodName() - { - var someValue = (SomeType)someObject.CallMethod(); - var someValue = (SomeType)(someObject.CallMethod()); - - var someValue = (SomeType) - someObject - .CallMethod____________________________() - .CallMethod____________________________(); - - var someValue = (SomeType)( - someObject - .CallMethod____________________________() - .CallMethod____________________________() - ); - - var someObject = (SomeType____________________) - arrayIndexerDoesNotBreak[typeof(SomeType____________________)]; - - return (T)CallMethod( - someArgument_______________________________, - someArgument_______________________________ - ); - - return (SomeGenericType) - CallMethod( - someArgument_______________________________, - someArgument_______________________________ - ); - - return (SomeGenericType)( - CallMethod( - someArgument_______________________________, - someArgument_______________________________ - ) - ); - - var someValue____________________________ = - (SomeType)someIdentifier____________________________; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.actual.test deleted file mode 100644 index 639df3cc7..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CheckedStatements.actual.test +++ /dev/null @@ -1,21 +0,0 @@ -class ClassName -{ - void MethodName() - { - checked - { - checked(++i); - - checked(printsLikeInvocations + whenItsFlat); - - checked( - printsLikeInvocations + whenItBreaks______________________________________________ - ); - - checked( - printsLikeInvocations - + whenItLongBreaks_______________________________________________ - ); - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.actual.test deleted file mode 100644 index 2980e6eae..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations.actual.test +++ /dev/null @@ -1,61 +0,0 @@ -public class EmptyClass { } - -public static abstract class MoreModifiers { } - -class NoModifiers { } - -public class WithInterface : IInterface { } - -public class WithReallyLongNameInterface - : IReallyLongNameLetsMakeThisBreak___________________________ { } - -public class ThisIsSomeLongNameAndItShouldFormatWell1 - : AnotherLongClassName, - AndYetAnotherLongClassName, - AndStillOneMore { } - -public class SimpleGeneric - where T : new() { } - -public class LongTypeConstraints - where T : SomeLongNameThatJustKeepsGoing, - AndThenAnotherOneThatIsEvenLonger____________________ { } - -public class LongerClassNameWithLotsOfGenerics< - TLongName, - TAnotherLongName, - TThirdLongName__________________ -> { } - -public class LongerClassNameWithLotsOfGenerics< - TLongName, - TAnotherLongName, - TThirdLongName__________________ -> : SomeBaseClass { } - -public class SimpleGeneric : BaseClass - where T : new() { } - -public class ThisIsSomeLongNameAndItShouldFormatWell2 - : AnotherLongClassName, - AnotherClassName - where T : new(), AnotherTypeConstraint - where T2 : new() - where T3 : new() { } - -public class IdentityDbContext - : IdentityDbContext< - TUser, - TRole, - TKey, - IdentityUserClaim, - IdentityUserRole, - IdentityUserLogin, - IdentityRoleClaim, - IdentityUserToken - > - where TUser : IdentityUser - where TRole : IdentityRole - where TKey : IEquatable { } - -file class FileScopedType { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.actual.test deleted file mode 100644 index eeb9fe9e2..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_EdgeCase.actual.test +++ /dev/null @@ -1,3 +0,0 @@ -public class ClassName { } - -public class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.actual.test deleted file mode 100644 index 7b2c65197..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ClassDeclarations_Tabs.actual.test +++ /dev/null @@ -1,59 +0,0 @@ -public class EmptyClass { } - -public static abstract class MoreModifiers { } - -class NoModifiers { } - -public class WithInterface : IInterface { } - -public class WithReallyLongNameInterface - : IReallyLongNameLetsMakeThisBreak___________________________ { } - -public class ThisIsSomeLongNameAndItShouldFormatWell1 - : AnotherLongClassName, - AndYetAnotherLongClassName, - AndStillOneMore { } - -public class SimpleGeneric - where T : new() { } - -public class LongTypeConstraints - where T : SomeLongNameThatJustKeepsGoing, - AndThenAnotherOneThatIsEvenLonger____________________ { } - -public class LongerClassNameWithLotsOfGenerics< - TLongName, - TAnotherLongName, - TThirdLongName__________________ -> { } - -public class LongerClassNameWithLotsOfGenerics< - TLongName, - TAnotherLongName, - TThirdLongName__________________ -> : SomeBaseClass { } - -public class SimpleGeneric : BaseClass - where T : new() { } - -public class ThisIsSomeLongNameAndItShouldFormatWell2 - : AnotherLongClassName, - AnotherClassName - where T : new(), AnotherTypeConstraint - where T2 : new() - where T3 : new() { } - -public class IdentityDbContext - : IdentityDbContext< - TUser, - TRole, - TKey, - IdentityUserClaim, - IdentityUserRole, - IdentityUserLogin, - IdentityRoleClaim, - IdentityUserToken - > - where TUser : IdentityUser - where TRole : IdentityRole - where TKey : IEquatable { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.actual.test deleted file mode 100644 index 15aad2036..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CloseBraceRemovesLines.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - var x = 1; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.actual.test deleted file mode 100644 index c62296825..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CoalesceExpressions.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -public class ClassName -{ - public string Value = SomeValue ?? ""; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.actual.test deleted file mode 100644 index 6d4a9f52f..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments.actual.test +++ /dev/null @@ -1,105 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// NewLineAfterThis -// -// -------------------------------------------------------------------------------------------------------------------- - -// public class -public class ClassName { } - -// other class -class ClassName2 { } - -// leading -public // trailing -static // trailing -class // trailing -ClassName2 { } - -// this -public -// is -static -// valid -// wtf -class -// yeah -ClassName3 // more trailing -{ - // yeah - private - // no - readonly string Tester = "lajsdf"; -} - -/// single line doc comment -class ClassName { } - -class ClassName -{ - // indents -} - -namespace NameSpace -{ - class ClassName - { - // indents - } -} - -public class ClassName -{ - // method - public void MethodName() { } - - // leading modifer - public // trailing modifier - static // more trailing - // leading return type - void // more trailing - MethodName2() { } - - public static void MethodName3() { } - - void //other trailing - MethodName4() { } - - void TrailingCommentTest() // shouldn't space before the next brace - { - return; - } - - void TrailingCommentWithParameters( - string oasdflkjasdfljkaksjdfasjdkfjslakdf, - string ljasdfjklaskldfkalsfjkasdf - ) // shouldn't space before the next brace - { - return; - } - - void MethodName() - { - // indents - } - - IReadOnlyList ICommand.Arguments => Arguments; - - /// - IReadOnlyList ICommand.Arguments => Arguments; - - // regular comment does not cause breaking - IReadOnlyList ICommand.Arguments => Arguments; -} - -class ClassName -{ - void MethodName() - { - var x = 1; - - // keep line before this - } - - // keep line before this -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.actual.test deleted file mode 100644 index dd998f309..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Comments_EdgeCase.actual.test +++ /dev/null @@ -1,51 +0,0 @@ -public class ClassName -{ - /// singleLine documentation - /// second line - private string field; - - public void Method() - { - /* this should keep the * aligned - * multiline - */ - var variable = true; - } - - /// no tabs here - /// Tabs here - /// - public class ClassName { } - - /* this works fine - * because indentation does not change - */ - public class ClassName2 { } - - /* this doesn't fail -by trying to move it left 4 spaces */ - public class ClassName2 { } - - /* - public string String; - */ -} - -public interface Interface -{ - /// - /// tab here before < - void Method(); - - /* this should ditch the tabs - that were in from of here - */ - void Method(); -} - -/* -public class CommentedCodeShouldKeepFormatting -{ - void MethodName() { } -} -*/ diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.actual.test deleted file mode 100644 index bc69eb785..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitAttributes.actual.test +++ /dev/null @@ -1,6 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -[assembly: ForceLineAbove] -[assembly: ButNotHere] - -[assembly: ButKeepThisOne] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.actual.test deleted file mode 100644 index c953e00d0..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Linq; -using System.Reflection; - -#if KEEP_LINE_ABOVE -namespace System.Web.Http.Internal -#else -namespace System.Web.WebPages -#endif -{ } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.actual.test deleted file mode 100644 index 44b256a5d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase2.actual.test +++ /dev/null @@ -1,12 +0,0 @@ -#if DONT_ADD_EXTRA_LINES -using System.Net.Http; -#else -using System.Web.Routing; -#endif - -#if DONT_ADD_EXTRA_LINES -namespace System.Web.Http.Routing.Constraints -#else -namespace System.Web.Mvc.Routing.Constraints -#endif -{ } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.actual.test deleted file mode 100644 index 38bc81136..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase3.actual.test +++ /dev/null @@ -1,6 +0,0 @@ -#if NO_DOUBLE_LINE_WITH_FILE_SCOPED -using System; - -#endif - -namespace Namespace; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.actual.test deleted file mode 100644 index 7bd9084ee..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase4.actual.test +++ /dev/null @@ -1,6 +0,0 @@ -using System.Runtime.CompilerServices; -#if NO_EXTRA_LINES_WITH_ATTRIBUTE -using System.Runtime.CompilerServices; -#endif - -[assembly: Attribute] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.actual.test deleted file mode 100644 index 801cd0117..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase5.actual.test +++ /dev/null @@ -1,6 +0,0 @@ -using System.Runtime.CompilerServices; - -#if KEEP_LINE_ABOVE -[assembly: Attribute] -#endif -[assembly: Attribute] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.actual.test deleted file mode 100644 index 062cb4e59..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase6.actual.test +++ /dev/null @@ -1,5 +0,0 @@ -using System; - -[assembly: SomeAttribute] - -namespace Namespace { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.actual.test deleted file mode 100644 index 4b301ff38..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CompilationUnitIfDirectiveEdgeCase7.actual.test +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -#if DEBUG -[assembly: SomeAttribute] - -#endif - -namespace Namespace { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.actual.test deleted file mode 100644 index 3dd16a025..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalAccessExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - SomeObject?.MethodCall(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.actual.test deleted file mode 100644 index fe3bdcd9c..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions.actual.test +++ /dev/null @@ -1,143 +0,0 @@ -public class ClassName -{ - public string Value = true ? "yes" : "no"; - - public string Value = someLongCondition______________________ - ? "someLongValue" - : "someOtherLongValue"; - - public bool CloseParenIndents = someCondition - ? this.SomeMethodCallThatIsLonger____________________( - someLongValue, - someLongValue, - someLongValue - ) - : this.SomeMethodCallThatIsLonger____________________( - someLongValue, - someLongValue, - someLongValue - ); - - void Method() - { - var nestedConditions = someCondition - ? someOtherCondition______________ - ? someValue_______________________ - : someOtherValue___________________ - : someThirdCondition______________ - ? someThirdValue_________________ - : someOtherThirdValue_______________________; - - var value = - someLongValue__________________________________ - && someOtherValue__________________________________ - ? trueValue - : falseValue; - - CallMethod( - someValue, - someCondition - ? trueValue________________________________ - : falseValue_______________________________, - someCondition_____________________________________ - && someOtherCondition__________________________________ - ? trueValue________________________________ - : falseValue_______________________________, - someCondition_____________________________________ - && someOtherCondition__________________________________ - ); - - var fileContents = File.ReadAllText( - file, - // leading here should break parameters and GetEncoding should still group - encoding - ? File.GetEncoding________________________________(1252) - : encoding_____________________, - cancellationToken - ); - - var fileContents = File.ReadAllText( - file, - // leading here should break parameters - encoding ? GetEncoding(1252) : encoding, - cancellationToken - ); - - return someLongCondition___________________________ - ? trueValue________________________________ - : falseValue________________________________; - - return - someLongCondition____________________________________ - && someOtherLongCondition____________________________________ - ? trueValue________________________________ - : falseValue_______________________________; - - return - someLongCondition____________________________________ - is SomeLongType___________________________ - ? trueValue________________________________ - : falseValue_______________________________; - - return ( - someLongCondition____________________________________ - && someOtherLongCondition____________________________________ - ) - ? trueValue________________________________ - : falseValue_______________________________; - - return - someLongCondition____________________________________ - == someThingElse______________________ - && someOtherLongCondition____________________________________ - ? trueValue________________________________ - : falseValue_______________________________; - - return CallSomeMethod( - someLongCondition____________________________________, - someOtherLongCondition____________________________________ - ) - ? trueValue________________________________ - : falseValue_______________________________; - - return firstCondition - ? firstValue - : secondCondition - ? secondValue - : thirdCondition - ? thirdValue - : fourthValue; - - return firstCondition - ? secondCondition - ? firstValue - : secondValue - : thirdCondition - ? thirdValue - : fourthValue; - - return a ? b : c; - - return a - ? b - : c - ? d - : e; - - var invocationIndent = someCondition - ? SomeObject - .CallLongMethod__________________________________________() - .CallLongMethod__________________________________________() - : SomeObject - .CallLongMethod__________________________________________() - .CallLongMethod__________________________________________(); - - CallMethod( - someCondition - ? SomeValue - : SomeObject - .CallMethod__________________________________() - .CallMethod__________________________________() - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.actual.test deleted file mode 100644 index a854d09d3..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConditionalExpressions_Tabs.actual.test +++ /dev/null @@ -1,143 +0,0 @@ -public class ClassName -{ - public string Value = true ? "yes" : "no"; - - public string Value = someLongCondition______________________ - ? "someLongValue" - : "someOtherLongValue"; - - public bool CloseParenIndents = someCondition - ? this.SomeMethodCallThatIsLonger____________________( - someLongValue, - someLongValue, - someLongValue - ) - : this.SomeMethodCallThatIsLonger____________________( - someLongValue, - someLongValue, - someLongValue - ); - - void Method() - { - var nestedConditions = someCondition - ? someOtherCondition______________ - ? someValue_______________________ - : someOtherValue___________________ - : someThirdCondition______________ - ? someThirdValue_________________ - : someOtherThirdValue_______________________; - - var value = - someLongValue__________________________________ - && someOtherValue__________________________________ - ? trueValue - : falseValue; - - CallMethod( - someValue, - someCondition - ? trueValue________________________________ - : falseValue_______________________________, - someCondition_____________________________________ - && someOtherCondition__________________________________ - ? trueValue________________________________ - : falseValue_______________________________, - someCondition_____________________________________ - && someOtherCondition__________________________________ - ); - - var fileContents = File.ReadAllText( - file, - // leading here should break parameters and GetEncoding should still group - encoding - ? File.GetEncoding________________________________(1252) - : encoding_____________________, - cancellationToken - ); - - var fileContents = File.ReadAllText( - file, - // leading here should break parameters - encoding ? GetEncoding(1252) : encoding, - cancellationToken - ); - - return someLongCondition___________________________ - ? trueValue________________________________ - : falseValue________________________________; - - return - someLongCondition____________________________________ - && someOtherLongCondition____________________________________ - ? trueValue________________________________ - : falseValue_______________________________; - - return - someLongCondition____________________________________ - is SomeLongType___________________________ - ? trueValue________________________________ - : falseValue_______________________________; - - return ( - someLongCondition____________________________________ - && someOtherLongCondition____________________________________ - ) - ? trueValue________________________________ - : falseValue_______________________________; - - return - someLongCondition____________________________________ - == someThingElse______________________ - && someOtherLongCondition____________________________________ - ? trueValue________________________________ - : falseValue_______________________________; - - return CallSomeMethod( - someLongCondition____________________________________, - someOtherLongCondition____________________________________ - ) - ? trueValue________________________________ - : falseValue_______________________________; - - return firstCondition - ? firstValue - : secondCondition - ? secondValue - : thirdCondition - ? thirdValue - : fourthValue; - - return firstCondition - ? secondCondition - ? firstValue - : secondValue - : thirdCondition - ? thirdValue - : fourthValue; - - return a ? b : c; - - return a - ? b - : c - ? d - : e; - - var invocationIndent = someCondition - ? SomeObject - .CallLongMethod__________________________________________() - .CallLongMethod__________________________________________() - : SomeObject - .CallLongMethod__________________________________________() - .CallLongMethod__________________________________________(); - - CallMethod( - someCondition - ? SomeValue - : SomeObject - .CallMethod__________________________________() - .CallMethod__________________________________() - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.actual.test deleted file mode 100644 index b1b5e91c4..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConstructorDeclarations.actual.test +++ /dev/null @@ -1,130 +0,0 @@ -public class BasicClass -{ - public BasicClass() { } - - [Obsolete] - public BasicClass(string one) { } - - public ClassName() => this.Value = 1; - - public BasicClass(int two, string exactly100___________________________________________________) - { - return; - } - - public BasicClass( - int two, - string justOver100___________________________________________________ - ) - { - return; - } -} - -public class Initializers : BasicClass -{ - public Initializers() - : this(true) { } - - public Initializers(string value) - : base(value) { } - - public Initializers( - string longParameter_______________________________________________________________________________ - ) - : base( - longParameter_______________________________________________________________________________ - ) { } - - public Initializers( - string longParameter_______________________________________________________________________________ - ) - : base( - longParameter_______________________________________________________________________________ - ) - { - WithBody(); - } - - public Initializers( - string longParameter____________________________________________________________ - ) - : base(false) { } - - public Initializers( - string longParameter____________________________________________________________ - ) - : base(false) - { - WithBody(); - } - - public LongMethodName___________________________________________________________________________() - : base(false) { } - - public WithParameters(string parameter) - : base( - longParameter____________________________________________________________________________ - ) { } - - // this may change, see #372 - public WithParameters(string parameter) - : base( - longParameter____________________________________________________________________________ - ) - { - WithBody(); - } - - public LongMethodName___________________________________________________________________________() - : base( - longParameter____________________________________________________________________________ - ) { } - - public Initializers(string value) /*Comment*/ - : base(value) { } - - public LongMethodName___________________________________________________________() - /*Comment*/: base(false) { } - - public LongInitializerBreaksAtEdgeCase() - : this(someParameter, someOtherParameter___________________________________________________) - { - WithBody(); - } - - public LongParametersWithEmptyBody(string parameter, bool anotherParameter_________________) { } - - public LongParametersWithEmptyBody(string parameter, bool anotherParameter__________________) - { } - - public LongInitializerWithEmptyBody() - : base(parameter, anotherParameter___________________) { } - - public LongInitializerWithEmptyBody() - : base(parameter, anotherParameter__________________) { } - - public LongInitializerWithEmptyBody() - : base(parameter______________, anotherParameter___________________________________________) - { } -} - -public class Exactly100 -{ - public Exactly100() - : this(someParameter, someOtherParameter___________________________________________________) - { - WithBody(); - } - - public Exactly100(int longParameter____________________________________________________________) - { - return; - } - - // leading comments don't affect this - public Exactly100(int longParameter____________________________________________________________) - { - return; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.actual.test deleted file mode 100644 index 361866a89..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ConversionOperatorDeclarations.actual.test +++ /dev/null @@ -1,23 +0,0 @@ -class Test -{ - public static implicit operator Test(string s) - { - return new Test(); - } - - public static implicit operator Test( - OtherPerson someReallyLongNameThatWillMakeThisBreak_________________ - ) - { - return new Test(); - } - - public static implicit operator Test(Person p) => - new Test(p.First + " " + p.Last); - - public static implicit operator Test(int x) => new Test(x); - - public static implicit operator Test( - bool reallyLongNameThatWillMakeThisBreak________________ - ) => new Test(x); -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.actual.test deleted file mode 100644 index b3549ca37..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DeclarationExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - this.CallMethod(out var result); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.actual.test deleted file mode 100644 index 0b6b98b04..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DefaultExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - return default(T); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.actual.test deleted file mode 100644 index 87948bd2f..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DelegateDeclarations.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - delegate void Delegate(); - - delegate void Delegate<[System.Obsolete()] out T>() - where T : struct; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.actual.test deleted file mode 100644 index 77d9f69c7..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DestructorDeclarations.actual.test +++ /dev/null @@ -1,5 +0,0 @@ -class ClassName -{ - [SomeAttribute] - ~ClassName() { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.actual.test deleted file mode 100644 index a2368476e..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives.actual.test +++ /dev/null @@ -1,99 +0,0 @@ -#error Error message -#warning Warning new line test - -#pragma warning disable 414, 3021 -#pragma warning restore 3021 -#pragma checksum "file.txt" "{00000000-0000-0000-0000-000000000000}" "2453" -#define foo // Comment in directive -#if foo -#elif bar -#else -#endif -#undef foo -#line 6 - -class ClassName { } - -public class ClassName -{ - public bool SomeProperty => -#if !DEBUG - someValue - && // trailing comment with endif should work properly -#endif - someOtherValue; - - void MethodWithOnlyDisabled() - { -#if DEBUG - Console.WriteLine("Rosyln does not parse this because DEBUG is not defined"); -#endif - } - - void MethodWithDisabledAfterAnotherStatement() - { - var x = 1; -#if DEBUG - Console.WriteLine("Rosyln does not parse this because DEBUG is not defined"); -#endif - } -} - -namespace Namespace -{ -#pragma - using System.Linq; - -#pragma - class ExtraLineChecker { } -#pragma - class ExtraLineChecker2 - { -#pragma - void MethodName() { } - } -} - -public class ClassName -{ - public void MethodName() - { -#if !IF_STATEMENT_HERE_SHOULD_NOT_BREAK_INVOCATION_AFTER_ENDIF - if (true) - { - return; - } -#endif - SomeObject.CallMethod().CallOtherMethod(shouldNotBreak); - -#if IF_STATEMENT_HERE_SHOULD_NOT_BREAK_INVOCATION_AFTER_ENDIF - if (true) - { - return; - } -#endif - SomeObject.CallMethod().CallOtherMethod(shouldNotBreak); - } -} - -#if DIRECTIVES_AROUND_MODIFIERS_BREAK_CORRECTLY -public -#else -internal -#endif -static class ConditionallyPublic { } - -class EdgeCases -{ - void MethodWithNestedIfsDoesNotGetExtraLineBreak() - { -#if DEBUG - var x = 1; -#if NO_EXTRA_BREAK_ABOVE_ME - x = 2; -#endif -#endif - } -} - -// trivia at end of file should not get extra space in front of it diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.actual.test deleted file mode 100644 index d2af6e393..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_AddAndRemoveLines.actual.test +++ /dev/null @@ -1,75 +0,0 @@ -public class ClassName -{ -#if NET6_0_OR_GREATER - public void Method1() { } -#endif - - public void RemoveLineAbove() { } - -#if NET6_0_OR_GREATER - public void Method2() { } -#endif - - public void AddLineAbove() { } - -#if NET6_0_OR_GREATER - public void RemoveLineAbove() { } -#endif - - public void Method3() { } - -#if NET6_0_OR_GREATER - public void AddLineAbove() { } -#endif - - public void Method4() { } - -#if NET6_0_OR_GREATER - public void RemoveLineBelow() { } -#endif -} - -public class ClassName -{ -#if NET6_0_OR_GREATER - public void Method() { } -#endif - - public int AddLineAbove { get; set; } -} - -public class ClassName -{ -#if NET6_0_OR_GREATER - public void Method() { } -#endif - - /// Summary - public void AddLineAboveSummary() { } - -#if NET6_0_OR_GREATER - public void Method() { } -#endif - - // Comment - public void AddLineAboveComment() { } - -#if NET6_0_OR_GREATER - public void Method() { } -#endif - - // Comment - public void NoNewLineAbove() { } -} - -public class ClassName -{ -#if NET6_0_OR_GREATER - public void Method() { } -#endif - - public enum LineAbove - { - Member, - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.actual.test deleted file mode 100644 index 378678c5a..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.actual.test +++ /dev/null @@ -1,19 +0,0 @@ -#if NO_EXTRA_LINES -extern alias Foo1; -#else -extern alias Foo2; -#endif - -#if NO_EXTRA_LINES -using System.Net.Http; -#else -using System.Web.Routing; -#endif - -using System.Web.Http; - -#if KEEP_LINE_ABOVE -using System.Web.Http; -#endif - -namespace Namespace { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.actual.test deleted file mode 100644 index e9827484c..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_FileScopedNamespace.actual.test +++ /dev/null @@ -1,15 +0,0 @@ -namespace FileScoped; - -#if NO_EXTRA_LINES -extern alias Foo1; -#else -extern alias Foo2; -#endif - -#if NO_EXTRA_LINES -using System.Net.Http; -#else -using System.Web.Routing; -#endif - -class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.actual.test deleted file mode 100644 index dd120ac01..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Namespace.actual.test +++ /dev/null @@ -1,16 +0,0 @@ -namespace Namespace -{ -#if NO_EXTRA_LINES - extern alias Foo1; -#else - extern alias Foo2; -#endif - -#if NO_EXTRA_LINES - using System.Net.Http; -#else - using System.Web.Routing; -#endif - - class ClassName { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.actual.test deleted file mode 100644 index 91d23c91c..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_Regions.actual.test +++ /dev/null @@ -1,42 +0,0 @@ -public class ClassName -{ - #region Region - public int LongUglyMethod() => 42; - #endregion -} - -public class ClassName -{ - #region Region - public int LongUglyMethod() => 42; - - #endregion -} - -#region class -public class ClassName -{ - #region method - public void Method() - { - #region content - #endregion - } - #endregion -} -#endregion - -public class ClassName -{ - #region Region - private int x; // trailing comment here shouldn't give extra indent to the endregion after it - #endregion - - private int y; - - string RegionsIndentAndNewLineProperly = - #region one - @"using System;" - #endregion one - ; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.actual.test deleted file mode 100644 index 381879aae..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/DoStatements.actual.test +++ /dev/null @@ -1,22 +0,0 @@ -class ClassName -{ - void MethodName() - { - do - { - return; - } while (true); - - do x++; - while (x < 10); - - do - { - return; - } while ( - initialDepth - 1 < reader.Depth - (JsonTokenUtils.IsEndToken(reader.TokenType) ? 1 : 0) - && writeChildren - && reader.Read() - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.actual.test deleted file mode 100644 index 2ee16b9b2..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementAccessExpressions.actual.test +++ /dev/null @@ -1,5 +0,0 @@ -public class ClassName -{ - public string Value = Something[0]; - public string Value2 = Something["one"]; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.actual.test deleted file mode 100644 index 2e6b58049..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElementBindingExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - var first = customers?[0]; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.actual.test deleted file mode 100644 index 843096388..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ElseStatements.actual.test +++ /dev/null @@ -1,35 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - if (true) - { - DoIf(); - } - else - { - DoElse(); - } - - if (true) - { - DoIf(); - } - else if (false) - { - DoElse(); - } - - if (true) - { - DoIf(); - } - else if ( - jklasdfklalsdkfjlkasdflkaslkjfjsdkf - || kljadsfklaskldflkjasdfklaskjdfjklasdfjlkasdfjlkasdf - ) - { - DoElse(); - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.actual.test deleted file mode 100644 index 2cf8f57fd..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EmptyLines.actual.test +++ /dev/null @@ -1,26 +0,0 @@ -namespace Namespace -{ - public class RemovesLineBefore { } - - public class RemovesDoubledLines { } - - public class RemoveTrailingLine { } -} - -public class ClassName -{ - public int RemoveLineBefore; - - public int RemoveDoubleLines; - - public void MethodName() - { - var removeLineBefore = 1; - - var removeDoubleLines = 2; - - var removeTrailingLine = 3; - } - - public int RemoveTrailingLine; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.actual.test deleted file mode 100644 index 8729cc5fb..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarationComments.actual.test +++ /dev/null @@ -1,21 +0,0 @@ -public enum SubCode -{ - First, - - // force line - BasicComment, - - /* force line */ - MultiLineComment, - - /// force line - XmlComment, - - /// SingleLine - ExistingLine, - - DoNotKeepLine, - - [ForceLine] - ForceLine -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.actual.test deleted file mode 100644 index 82a392f7b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EnumDeclarations.actual.test +++ /dev/null @@ -1,13 +0,0 @@ -enum AnEnum -{ - One, - Two, - Three -} - -public enum E -{ - A, - B = A, - C = 2 + A -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.actual.test deleted file mode 100644 index 7a31f1c64..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventDeclarations.actual.test +++ /dev/null @@ -1,13 +0,0 @@ -class ClassName -{ - public readonly event Event E; - public event Action E1 - { - add { value = value; } - remove - { - E1 += Handler; - E -= Handler; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.actual.test deleted file mode 100644 index b358fb8bf..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/EventFieldDeclarations.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -class ClassName -{ - public event EventHandler MyEvent = delegate { }; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.actual.test deleted file mode 100644 index 2684b1930..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ExternAliasDirectives.actual.test +++ /dev/null @@ -1,15 +0,0 @@ -// leading -extern alias Foo; // trailing - -// leading with line -extern // extern trailing -// alias leading -alias // alias trailing -Foo; - -extern alias Foo; - -namespace Namespace -{ - extern alias Bar; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.actual.test deleted file mode 100644 index b1dd0df5d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FieldDeclarations.actual.test +++ /dev/null @@ -1,116 +0,0 @@ -public class ClassName -{ - private static const string SomeName = "1"; - public SomeClass SomeName; - - private string SomeFieldWithSadsfasdfasdfasdfuperLongNameYeahMan = - "kljasdfkljasdklfkjlasdfkjaskdlfasasdfasdfasdfasdfdfksdf"; - - private static readonly Regex FrontEndResourceRelativePathRegex = new Regex( - @".*?/Themes/.*?/.*?/(.*)", - RegexOptions.Compiled - | RegexOptions.CultureInvariant - | RegexOptions.IgnoreCase - | RegexOptions.MakeThisBreak - ); - - private SomeObject SomeLongerName = new SomeObject( - "lkjasdflkjasdfkljaskldjf", - "klasldkfaksdfasdfkjasdklf" - ) - { - Property1 = 1, - Property2 = 2 - }; - - private LotsOfParametersToCauseBreaking ShortFieldName = new LotsOfParametersToCauseBreaking( - "someValue", - "someOtherValue", - "anotherValue", - "yetAnotherValue" - ); - - private SomeReallyLongObjectName SomeReallyLongFieldName_____________ = - new SomeReallyLongObjectName("someValue", "someOtherValue"); - - private SomeReallyLongObjectName LongFieldNameAndLongParameters = new SomeReallyLongObjectName( - "someValue___________________", - "someOtherValue_____________________________________" - ); - - public ClassName Value = new ClassName - { - Property1 = true, - Property2 = false, - Property3 = false, - Property4 = false, - Property5 = false - }; - - // leading comments - private static const string SomeName = "1"; - - public SomeClass SomeName; // trailing comments - - public System.Text.StringBuilder NamespacedField; - - public Dictionary Property = - new Dictionary(); - - public Dictionary Property = - new Dictionary(); - - public static Dictionary< - SomeOtherLongTypeName_______________, - SomeOtherLongTypeName_______________ - > PropertiesByType = - new Dictionary(); - - public static Dictionary< - SomeOtherLongTypeName_______________________________, - SomeOtherLongTypeName_______________________________ - > PropertiesByType = - new Dictionary< - SomeOtherLongTypeName_______________________________, - SomeOtherLongTypeName_______________________________ - >(); - - private static readonly Func s_isVisualBasicCommentTrivia = ( - syntaxTrivia - ) => syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia); - - private Func SomeFieldFunc = (someValue) => true; - - private Func SomeFieldFunc = (someValue) => - SometimesBreaksThisWay(someValue); - - private Func SomeFieldFunc = (someValue) => - OrWhenLongerBreaksThisWay________(someValue); - - private Func SomeFieldFuncWithALongName_________ = - (someValue) => SomeOtherLongerMethod(someValue); - - private Func< - SomeLongObjectIn__________________________________, - bool - > SomeFieldFuncWithALongName = (someValue) => SometimesBreaksThisWay(someValue); - - private Func< - SomeLongObjectIn__________________________________, - bool - > SomeFieldFuncWithALongName = (someValue) => - SometimesBreaksThisWay(someValue, SomeOtherLongValue); - - private Func< - SomeLongObjectIn__________________________________, - bool - > SomeFieldFuncWithALongName = (someValue_____________________________) => - SometimesBreaksThisWay(someValue, SomeOtherLongValue); - - private Type OmittedTypes = typeof(OmittedTypes<,>); -} - -struct S -{ - fixed int field[10]; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_USC2LEBOM.actual.test deleted file mode 100644 index 7c1fc69a144cfd21063353d171846339424b3eb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmezWuYjSHA&DV}A(J7QK>>(!7!nzZflz_L8P4_tisdq-GVn5RF;s&|1)w|#qUtVV j$OoE}0u=WJsxD#30P<59V7fIJG=VbJKwJwp1404-XUG-$ diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.actual.test deleted file mode 100644 index ff8462d1f..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -public class ClassName -{ - public void MethodName() { } -} - -public enum MeetingLocation -{ - Café, - Restaurant -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.actual.test deleted file mode 100644 index 0e622b6b7..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileEncoding_UTF8BOM.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -public class ClassName -{ - public void MethodName() { } -} - -public enum MeetingLocation -{ - Café, - Restaurant -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.actual.test deleted file mode 100644 index ab4b151ca..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FileScopedNamespaceDeclaration.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -namespace Namespace; - -extern alias Foo; - -using System; - -class ClassName { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.actual.test deleted file mode 100644 index 954bac0d4..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FixedStatements.actual.test +++ /dev/null @@ -1,45 +0,0 @@ -class ClassName -{ - void MethodName() - { - fixed (int* p = stackalloc int[100]) - { - *intref = 1; - } - - fixed ( - int* someLongNameThatWillMakeThisBreakYeahKeepGoing_____________________ = - stackalloc int[100] - ) - { - *intref = 1; - } - - fixed (int* exactly100_______________________________________________ = stackalloc int[100]) - { - return; - } - - // leading comment doesn't break differently - fixed (int* exactly100_______________________________________________ = stackalloc int[100]) - { - return; - } - - fixed ( - int* justOver100_______________________________________________ = stackalloc int[100] - ) - { - return; - } - - fixed (char* pSrcBegin = text) - fixed (char* pDstBegin = _bufChars) - { - char* pSrc = pSrcBegin; - } - - fixed (int* pIndices = &indices[0]) - InternalGetReference(&elemref, indices.Length, pIndices); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.actual.test deleted file mode 100644 index cf5c86ce1..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachStatements.actual.test +++ /dev/null @@ -1,123 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - foreach (var x in y) - { - x = 1; - } - - foreach ( - var x in this.SomeMethodCall() - .SomeChainedCall() - .AnotherChainedCall__________________________() - ) - { - break; - } - - foreach ( - var x // trailing - in y - ) - { - return; - } - - foreach (var exactly100 in Something_______________________________________________________) - { - return; - } - - // leading comment doesn't break differently - foreach (var exactly100 in Something_______________________________________________________) - { - return; - } - - // leading comment doesn't break differently - await foreach (var exactly100 in Something_________________________________________________) - { - return; - } - - foreach ( - var justOver100 in Something_______________________________________________________ - ) - { - return; - } - - // leading await - await - // leading using - foreach (var y in Something()) - { - return; - } - - foreach (var x in y) - CallSomething(x); - - foreach (var someLongerNameThatMakesThis in BreakAndLongName____________________) - CallSomething(x); - - foreach ( - var someLongerNameThatMakesThis in BreakInAnotherWay_______________________________________ - ) - CallSomething(x); - - foreach (var x in y) - switch (x) - { - case 1: - return; - } - - foreach (var (x, y) in thing) - { - this.DoOtherThing(); - } - - foreach ( - ( - (int l2, int l3), - (int longName________________________, string[] anotherLongName___________) - ) in ( - from l2 in Enumerable.Range(1, 7) - from l3 in Enumerable.Range(1, 7) - select (l2, l3) - ) - .AsParallel() - .Select(l => (l, res: GenerateTable(l.l2, l.l3, cutOff))) - .OrderBy(v => v.res.Total) - ) - { - return; - } - - foreach (var x in y) - { - continue; - } - - foreach (var x in y) - { - KeepNewLine(); - - continue; - } - - foreach (var x in y) - { - break; - } - - foreach (var x in y) - { - KeepNewLine(); - - break; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.actual.test deleted file mode 100644 index 17e093e4b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForEachVariableStatements.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -class ClassName -{ - void MethodName() - { - foreach (var (x, y) in thing) - { - this.DoOtherThing(); - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.actual.test deleted file mode 100644 index ca1319ec8..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ForStatements.actual.test +++ /dev/null @@ -1,104 +0,0 @@ -class ClassName -{ - void MethodName() - { - for (var x = 0; x < 100; x++) - { - break; - } - - var y = 0; - for (y = 0; y < 100; y++) - { - break; - } - - for (; ; ) - { - break; - } - - for (var x = 1; ; ) - { - break; - } - - for (var x = 1; x < 0; ) - { - break; - } - - for (var x = 1; ; x++) - { - break; - } - - for (var x = 0; x < 100; x++) - break; - - for (var someLongerValue = 0; someLongerValue____________________ < 1; someLongerValue++) - Call(SomeLongerValue); - - for ( - var someLongerValue__________ = 0; - someLongerValue__________ < 1; - someLongerValue__________++ - ) - Call(someLongerValue__________); - - for (int i = 0, j = 0; i < length; i++, j++) - { - break; - } - - for ( - var shorterName = 0; - someLongName____________ - < someOtherLongName__________________________________________________; - someLongishName_________________________++ - ) - { - break; - } - - for ( - var someShortName = 0, anotherShortName = 1; - someRandomCondition; - someShortName++, anotherShortName++ - ) - { - break; - } - - for ( - var someLongerName_________________________ = 0, - anotherLongerName________________________________ = 1; - someRandomCondition; - someLongerName_________________________++, - anotherLongerName________________________________++ - ) - { - break; - } - - for (y = 0; y < exactly100____________________________________________________________; y++) - { - break; - } - - // leading comment doesn't break differently - for (y = 0; y < exactly100____________________________________________________________; y++) - { - break; - } - - for ( - y = 0; - y < justOver100____________________________________________________________; - y++ - ) - { - break; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.actual.test deleted file mode 100644 index 83ac44eda..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/FunctionPointerTypes.actual.test +++ /dev/null @@ -1,26 +0,0 @@ -class ClassName -{ - public unsafe void RegisterCallbacks( - delegate* unmanaged< - IntPtr, - IntPtr, - NativeMethods.REQUEST_NOTIFICATION_STATUS> requestCallback, - delegate* unmanaged shutdownCallback, - delegate* unmanaged disconnectCallback, - delegate* unmanaged< - IntPtr, - int, - int, - NativeMethods.REQUEST_NOTIFICATION_STATUS> asyncCallback, - delegate* unmanaged requestsDrainedHandler, - IntPtr pvRequestContext - ) - { - return; - } - - public static extern unsafe int InvokeCallbackFuncPtr_Inline_NoGCTransition( - delegate* unmanaged[Cdecl] cb, - int* n - ); -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.actual.test deleted file mode 100644 index 047e21e54..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/GlobalStatements.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -GlobalStatement(); - -WithNewLine(); -WithNoNewLine(); - -// comment -WithComment(); - -#error Error -WithDirective(); diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.actual.test deleted file mode 100644 index eb66b7ab2..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IfStatements.actual.test +++ /dev/null @@ -1,82 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - if (true) - { - return; - } - - if (true == false) { } - - if (true && false) { } - - if (true) - DoSomething(); - else if (false) - DoSomething(); - else - DoSomething; - - if (true) - while (true) - foreach (var x in y) - CallMethod(x); - - if (someLongCondition != someOtherCondition) - DoSomeLongMethodCall_________________________(); - else if (someLongCondition == someOtherCondition) - DoSomeLongMethodCall_________________________(); - else - DoSomeLongMethodCall________________________________________(); - - if ( - longStatementName - && longerStatementName - && evenLongerStatementName - && superLongStatementName - ) - { - return; - } - - if ( - longStatementName - && longerStatementName - && evenLongerStatementName - && superLongStatementName - ) - return; - - if (!true) { } - - if (true != false) { } - - if (true || false) { } - - if (true && (true || false)) { } - - if (exactly100 || moreTextToMakeItWork_____________________________________________________) - { - return; - } - - // leading comment doesn't break differently - if (exactly100 || moreTextToMakeItWork_____________________________________________________) - { - return; - } - - if ( - justOver100 || moreTextToMakeItWork_____________________________________________________ - ) - { - return; - } - - if (true) - { - // indent - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.actual.test deleted file mode 100644 index 8ca35c9c9..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitArrayCreationExpressions.actual.test +++ /dev/null @@ -1,36 +0,0 @@ -class ClassName -{ - int[] array = new[] { 1, 2 }; - - int[,] array = new[,] - { - { 1, 2 }, - { 3, 4 } - }; - - private string[] SomeArray = new[] - { - "SomeValue_____________________", - "SomeValue_____________________", - }; - - public HashSet TheArrayShouldNotBreak = new HashSet( - new[] { ".dll", "exe", ".winmd" }, - StringComparer.OrdinalIgnoreCase - ); - - void MethodName() - { - var implicitArrayShouldBreak = new[] - { - "someLongValue", - "anotherLongValue", - "yetAnotherLongValue" - }; - - return TheArrayInHereShouldAlsoNotBreak( - SomeLongThing__________, - new[] { one, two, three, found } - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.actual.test deleted file mode 100644 index 3cd5c8fa2..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitElementAccesses.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -class ClassName -{ - Dictionary dictionary = new Dictionary { [1] = "one", [2] = "two" }; - - Dictionary dictionary = new Dictionary - { - [1] = "one", - [2] = "two_______________________" - }; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.actual.test deleted file mode 100644 index 661ed7023..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ImplicitStackAllocArrayCreationExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - Span a = stackalloc[] { 1, 2, 3 }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.actual.test deleted file mode 100644 index e860afa0a..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IndexerDeclarations.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -abstract class ClassName -{ - abstract int this[int index] { get; set; } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.actual.test deleted file mode 100644 index fd4cd4e0d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.actual.test +++ /dev/null @@ -1,242 +0,0 @@ -class ClassName -{ - int[] array = { 1, 2 }; - - int[] array = - { - "someLongValue_____________________________________", - "someLongValue_____________________________________" - }; - - int[] array = new int[] - { - "someLongValue_____________________________________", - "someLongValue_____________________________________" - }; - - public IList Value = new List { "one", "two" }; - - Dictionary dictionary = new Dictionary - { - { 1, "one_________" }, - { 2, "two_________________" } - }; - - Dictionary dictionary = new Dictionary - { - // should break braces correctly - { 1, "one" }, - { 2, "two" }, - { - 3, - "ifThisIsReallyLongItShouldntInsertAnExtraLineAboveIt_________________________________" - } - }; - - private int[,] arrayInitializerWithoutSize = - { - // leading comment should not interfere with the next line breaking - { - longValue______________________________, - longValue______________________________, - longValue______________________________ - }, - { - longValue______________________________, - longValue______________________________, - longValue______________________________ - } - }; - - void MethodName() - { - var x = new SomeClass - { - Property1 = true - // should indent - }; - - var x = new OneProperty { One = true }; - var x = new TwoProperties { One = true, Two = true }; - var x = new ThreeProperties - { - One = true, - Two = true, - Three = true - }; - - var objectInitializerExpression = new SomeObject() - { - ShouldNotBreak = { SomeProperty = SomeValue }, - ShouldBreak = - { - SomeOtherProperty = SomeLongValue_______________________________________ - }, - SomeList = new List() - { - new() { SomeProperty = SomeLongValue_____________ }, -# pragma this should not affect the breaking of the next line - new() { SomeProperty = SomeLongValue_____________ }, - new() - { - SomeProperty = SomeOtherValue, - AnotherProperty = SomeThirdValue_______________________ - } - } - }; - - var someObject = new SomeObject - { - SomeProperty = - { - someOtherValue__________________________________________________________________ - } - }; - - var collectionInitializerExpressions = new SomeObject - { - ThisIsACollection = { one, two }, - ThisIsAlsoACollection = - { - longerValueThatMakesItBreak______________________, - longerValueThatMakesItBreak______________________ - }, - }; - - var emptyInitializer = new SomeObject[] { }; - - var emptyInitializer = new Thing { One = 1 }; - - var nestedInitializer = new Thing - { - One = 1, - Two = new Thing { One = 1 } - }; - - var nestedInitializer = new List() - { - new Thing() { One = 1 }, - new Thing() { One = 1 } - }; - - var nestedInitializer = new Thing - { - One = 1, - Two = new() { One = 1 } - }; - - var nestedInitializer = new List() - { - new() { One = 1 }, - new() { One = 1 } - }; - - var noBreak = new List { new Thing { One = 1 } }; - var yesBreak = new List - { - new Thing { One = 1, Two = 2 } - }; - var yesBreak = new List - { - new Thing { One = 1 }, - Two = 2 - }; - - var listInitializer = new List { 1, 2, 3 }; - var dictionaryInitializer = new Dictionary - { - { 1, "" }, - { 2, "a" }, - { 3, "b" } - }; - int[,,] cube = - { - { - { 111, 112 }, - { 121, 122 } - }, - { - { 211, 212 }, - { 221, 222 } - } - }; - int[][] jagged = - { - { 111 }, - { 121, 122 } - }; - - var conditionalsAndInvocations = new List - { - this.CallSomeMethod________________________________________() - .CallSomeMethod________________________________________() - ? one - : two, - SomeOtherMethod(), - SomethingElse - .CallSomeMethod________________________________________() - .CallSomeMethod________________________________________() - ? one - : two, - SomeOtherMethod(), - this.CallSomeMethod________________________________________() - .CallSomeMethod________________________________________(), - someLongCondition___________________________________ - && someLongCondition___________________________________ - ? one - : two - }; - - var someObject = new SomeObject - { - SomeArray = new SomeOtherObject[] - { - new SomeOtherObject { SomeProperty = 1 }, - new SomeOtherObject() - } - .CallMethod() - .CallMethod() - }; - - var result = SomeType - .CallMethod() - .CallOtherMethod(someParameter, new SomeObjectType().SomeProperty.SomeOtherProperty); - - var someObject = new SomeObject - { - SomeArray = new SomeOtherObject - { - new SomeOtherObject { SomeProperty = 1 }, - new SomeOtherObject() - } - .CallMethod() - .CallMethod() - }; - - var someObject = new SomeObject - { - SomeArray = new SomeOtherObject[] - { - new SomeOtherObject { SomeProperty = 1 }, - new SomeOtherObject() - } - }; - - var someObject = new SomeObject - { - SomeArray = new SomeOtherObject[] - { - new SomeOtherObject_________________________________(), - new SomeOtherObject_________________________________() - } - .CallMethod() - .CallMethod() - }; - } - - private SomeObject someObject = - new(someLongParameter___________________) - { - SomeProperty = someLongValue____________________________ - }; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.actual.test deleted file mode 100644 index cabfbf13c..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterfaceDeclarations.actual.test +++ /dev/null @@ -1,14 +0,0 @@ -public interface BasicInterface -{ - string Property { get; set; } -} - -public interface BasicInterface : BaseInterface { } - -public interface BasicInterface -{ - void SomeMethod(); - static abstract void SomeOtherMethod(); -} - -interface CoContra { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.actual.test deleted file mode 100644 index 010431fa9..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InterpolatedStringExpressions.actual.test +++ /dev/null @@ -1,28 +0,0 @@ -public class ClassName -{ - public string Test = $"test"; - - public string LeadingCommentWithInterpolatedString = - $"one" - + - // comment stays on this line - $"two"; - - public string TwoValues = $"{SomeValue}{SomeOtherValue}"; - - public string ForceFlatInString = - $"{SomeValue}{CallSomeLongMethodWithBiParameters(jlkasdfkljasdflkaskdf, jkasdflkjasdfsdkaljfasdkjf)}"; - - public string Test2 = CallSomeLongMethodWithBiParameters( - $"some super long interpolated string with some substitions like {jkasdflkjasdfsdkaljfasdkjf}", - $"another long interpolated string with some substitions like {jlkasdfkljasdflkaskdf}" - ); - - void AlignmentAndFormat() - { - var s1 = $"x {1, -2:d}"; - var s2 = $"x {1, -2}"; - var s3 = $"x {1:d}"; - var trailingComment = $"{someValue /* Comment shouldn't cause new line */}"; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.actual.test deleted file mode 100644 index a1ababd92..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InvocationExpressions.actual.test +++ /dev/null @@ -1,242 +0,0 @@ -class ClassName -{ - void MethodName() - { - this.DoSomething().DoSomething(); - - this.DoSomething___________________() - .DoSomething___________________() - .DoSomething___________________(); - - this.DoSomething___________________() - ?.DoSomething___________________() - ?.DoSomething___________________(); - - this.DoSomething___________________()! - .DoSomething___________________()! - .DoSomething___________________(); - - base.DoSomething___________________() - .DoSomething___________________() - .DoSomething___________________(); - - AnIdentifier - .DoSomething___________________() - .DoSomething___________________() - .DoSomething___________________(); - - this.Method( - someParameter__________________________________, - someParameter__________________________________ - ); - - this.SomeMethod( - SomeOtherMethod(parameter__________________________________________________) - ); - - var superLongName____________________________________ = - someOtherName.CallSomeMethod________________(); - - var superLongName_______________ = someOtherName____________ - .CallSomeMethod______________() - .CallSomeMethod______________(); - - var someValue = someOtherValue.Where(o => someLongCondition).Where(o => someLongCondition); - - var someValue = someOtherValue - .Where(o => someLongCondition__________________________) - .Where(o => someLongCondition__________________________); - - var someValue = someOtherValue! - .Where(o => someLongCondition__________________________) - .Where(o => someLongCondition__________________________); - - var someValue = someOtherValue!.Thing! - .Where(o => someLongCondition__________________________) - .Where(o => someLongCondition__________________________); - - var someValue = someOtherValue.Thing - .Where(o => someLongCondition__________________________) - .Where(o => someLongCondition__________________________); - - var someValue = someOtherValue - .Where(o => someLongCondition__________________________) - .Where(o => someLongCondition__________________________) - .Where(o => someLongCondition__________________________); - - roleNames - .ToList() - .Where(o => someLongCondition) - .Where(o => someLongCondition) - .Where(o => someLongCondition); - - this.SomeMethod( - SomeOtherMethod(parameter__________________________________________________) - ); - - roleNames - .ToList() - .ForEach( - role => - this.SomeProperty.Setup(o => longThing_______________________________________) - ); - - roleNames.Value - .Where(o => o.SomeProperty____________________________________) - .Select(o => o.SomethingElse); - - return someCondition - ? CallMethod( - someLongParameter____________________________, - someLongParameter____________________________ - ) - : Something.CallMethod( - someLongParameter____________________________, - someLongParameter____________________________ - ); - - someValue.CallMethod( - someLongParameter____________________________, - someLongParameter____________________________ - ); - - someValue!.CallMethod( - someLongParameter____________________________, - someLongParameter____________________________ - ); - - CallSomeMethod( - someParameter____________________________________, - someParameter____________________________________ - )!; - - var someVariable = someObject.Property.CallMethod( - someValue => someValue.SomeProperty == someOtherValue___________________________________ - ); - - CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ); - - CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ); - - // comment shouldn't do weird stuff - CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ); - - this.CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ); - - string.CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ); - - o.CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ) - .CallMethod( - firstParameter____________________________, - secondParameter___________________________ - ); - - CallMethod( - one__________________________________, - two__________________________________ - ) - .CallMethod( - one__________________________________, - two__________________________________ - ); - - SomeObject - ?.CallMethod(parameter_______________________________________________________________) - .ToArray(); - - SomeObject - .CallMethod(parameter_______________________________________________________________) - .ToArray(); - - // comment shouldn't do weird stuff - SomeObject.CallMethod(); - - CallMethod(lambdaWithBlock => - { - return; - }) - .CallMethod() - .CallMethod(); - - someObject.CallMethod(lambdaWithBlock => - { - return; - }); - - o.CallMethod(parameter_____________, parameter_____________) - .CallMethod(parameter_____________, parameter_____________); - - this.CallMethod() - .CallMethod__________________(one_____________________, two_____________________); - - var someValue = CallMethod__________________(longParameter________________________________)! - .CallMethod__________________(); - - var someValue = CallMethod__________________(longParameter________________________________) - .CallMethod__________________(); - - var someValue = CallMethod__________________( - longParameter_______________________________________ - )! - .CallMethod__________________(); - - var someValue = CallMethod__________________( - longParameter_______________________________________ - ) - .CallMethod__________________(); - - someThing_______________________.Property - .CallMethod__________________() - .CallMethod__________________(); - - someThing_______________________?.Property - .CallMethod__________________() - .CallMethod__________________(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.actual.test deleted file mode 100644 index 63613303b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - var x = null is object; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.actual.test deleted file mode 100644 index c59da45bc..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/IsPatternExpressions.actual.test +++ /dev/null @@ -1,242 +0,0 @@ -class ClassName -{ - void MethodName() - { - if (expr is Type v) - { - return; - } - - if (expr is not null) - { - return; - } - - if (expr is < 'A' or > 'Z') - { - return; - } - - Debug.Assert(result is Exception or IPAddress[] or IPHostEntry); - - if (expr is string { Length: 5 } s) - { - return; - } - - if (expr is { Length: 5 }) - { - return; - } - - if ( - expr is - { - SomeProperty: "someValue________________", - SomeOtherProperty: "someOtherValue______________" - } - ) - { - return; - } - - var useLine = - node.OperatorToken.Kind() - is SyntaxKind.BarBarToken - or SyntaxKind.BarToken - or SyntaxKind.AmpersandAmpersandToken - or SyntaxKind.AmpersandToken - or SyntaxKind.PlusToken; - - if ( - someRandomValue___________________ is SomeRandomType someRandomType - && someRandomType.IsEnum - ) - { - return; - } - - if (x is Y { NoExtraSpaceAfterThisNextBrace: true } && newGroup) - { - return; - } - - if (expr is { } noExtraSpaceBeforeOpenBrace) - { - return; - } - - if ( - someValue_________________________ is SomeType_________________ someType - && someType.SomeProperty - ) { } - - var value = someOtherValue is { Property: true }; - - var value = - someOtherValue - is SomeType___________________ - { - SomeProperty: SomeOtherType_____________________________________________ - } - or SomeThirdType___________; - - var value = - someOtherValue - is SomeType___________________ - { - SomeProperty: SomeOtherType_____________________________________________, - AnotherProperty: SomeType - } - or SomeThirdType___________; - - var value = - someOtherValue - is SomeType___________________ { SomeProperty: SomeType or SomeOtherType }; - - var value = - someOtherValue - is SomeType___________________ - { - SomeProperty: SomeLongType_______________ - or SomeOtherLongType___________________ - }; - - var value = - someOtherValue - is SomeType___________________ - or SomeOtherType___________________ - or SomeThirdType___________ - && someLongValue_________________; - - if (someOtherValue is (SomeType or SomeOtherType)) - { - return; - } - - if (someOtherValue is not (SomeType or SomeOtherType)) - { - return; - } - - if ( - someOtherValue_____________ - is (SomeLongType_____________ or SomeOtherLongType_____________) - ) - { - return; - } - - if ( - someOtherValue_____________ - is not (SomeLongType_____________ or SomeOtherLongType_____________) - ) - { - return; - } - - if ( - someOtherValue_____________ - is ( - SomeLongType_____________________________________ - or SomeLongType_____________________________________ - ) - ) - { - return; - } - - if ( - node is SomeType_______________ - { - SomeProperty: SomeOtherType_____________________________ - } - ) - { - return; - } - - if ( - node is PrefixUnaryExpressionSyntax - { - Operand: ParenthesizedExpressionSyntax - { - Expression: IsPatternExpressionSyntax or IsPatternExpressionSyntax - }, - } - ) - { - return; - } - - if ( - node is PrefixUnaryExpressionSyntax - { - Operand: - { - Expression: IsPatternExpressionSyntax or IsPatternExpressionSyntax______________ - }, - } - ) - { - return; - } - - if ( - !( - node is PrefixUnaryExpressionSyntax - { - Operand: ParenthesizedExpressionSyntax or IsPatternExpressionSyntax - } - ) - ) - { - return; - } - - if ( - someLongName____________________________________________________ is - { } anotherLongName______________________ - ) - { - return; - } - - if ( - someLongVariableName____________ - is SomeLongTypeName______________________________ someOtherLongVariableName_____________ - ) - { - return; - } - - if ( - someArray[index] - is SomeLongTypeName______________________________ someOtherLongVariableName_____________ - ) - { - return; - } - - if ( - someLongName_____________ - is SomeObjectType - or SomeOtherObjectType - or YetAnotherObjectType - ) - { - return; - } - - if ( - someCondition - && someLongName_____________ - is { Kind: SomeObjectType, Value: "___________________________________" } - ) { } - - if (expr is { Property.Length: 5 }) - { - return; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.actual.test deleted file mode 100644 index 6ecaaf582..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LabeledStatements.actual.test +++ /dev/null @@ -1,8 +0,0 @@ -class ClassName -{ - void MethodName() - { - label: - goto label; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.actual.test deleted file mode 100644 index 91dd93d0d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ListPatterns.actual.test +++ /dev/null @@ -1,21 +0,0 @@ -var someValue = someArray is [1, 2, 3]; - -var someValue = - triviaToMove - is [ - .., - { RawKind: (int)SyntaxKind.SingleLineCommentTrivia }, - { RawKind: (int)SyntaxKind.SingleLineCommentTrivia }, - { RawKind: (int)SyntaxKind.EndOfLineTrivia } - ]; - -var someValue = someString is [var firstCharacter, .. var rest]; - -var someValue = - someLongerStringString - is [ - var firstCharacter____________, - var secondCharacter__________, - var thirdCharacter, - .. var rest - ]; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.actual.test deleted file mode 100644 index 2b35caa60..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalDeclarationStatements.actual.test +++ /dev/null @@ -1,9 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - bool x; - - bool y = true; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.actual.test deleted file mode 100644 index d22b305f5..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LocalFunctionStatements.actual.test +++ /dev/null @@ -1,20 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - void LocalFunction() - { - return; - } - - void LocalFunctionWithParameters( - string one, - string two, - string three, - string four_______________ - ) - { - return; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.actual.test deleted file mode 100644 index 3d7fb2ec2..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/LockStatements.actual.test +++ /dev/null @@ -1,13 +0,0 @@ -class ClassName -{ - void MethodName() - { - lock (sync) - process(); - - lock (sync) - { - process(); - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.actual.test deleted file mode 100644 index c476d9e4b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MakeRefExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - TypedReference tr = __makeref(c); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.actual.test deleted file mode 100644 index db5255506..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberAccessExpressions.actual.test +++ /dev/null @@ -1,17 +0,0 @@ -class ClassName -{ - void MethodName() - { - this.SomeProperty____________________________________________ - .SomeProperty____________________________________________ - .SomeProperty____________________________________________; - - this.SomeProperty____________________________________________! - .SomeProperty____________________________________________! - .SomeProperty____________________________________________; - - this.SomeProperty____________________________________________ - ?.SomeProperty____________________________________________ - ?.SomeProperty____________________________________________; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.actual.test deleted file mode 100644 index 0fdcbbb01..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberLines.actual.test +++ /dev/null @@ -1,160 +0,0 @@ -public class ClassRules -{ - public void NeverLineBeforeFirstMember() { } - - public void AlwaysLineBetweenMethods() { } - - public void EvenWithLambdaBody() => ""; - - private enum AlwaysLineBeforeEnum - { - One, - Two - } - - private enum NoDoubleLines - { - One, - Two - } - - private class AlwaysLineBeforeClass { } - - private class NoDoubleLines { } - - private interface IAlwaysLineBeforeInterface { } - - private interface INoDoubleLines { } - - public ClassRules() { } - - public ClassRules() { } - - public ~ClassName() { } - - public ~ClassName() { } - - public static implicit operator ClassRules(string s) - { - return new Test(); - } - - public static implicit operator ClassRules(int i) - { - return new Test(); - } - - public record SomeRecord1(string property); - - public record SomeRecord2(string property); - - public struct SomeStruct1 { } - - public struct SomeStruct2 { } - - static ClassRules operator +(ClassRules a, ClassRules b) - { - return a.Add(b); - } - - static ClassRules operator -(ClassRules a, ClassRules b) - { - return a.Subtract(b); - } - - private string FieldsCanBeGroupedBecauseLinesWillBeKept; - private string ButLinesAreNotForcedHere; - - // comments force a line - private string FieldWithComment; - - /* comments force a line */ - private string FieldWithComment; - - /// comments force a line /// - private string FieldWithComment; - - [AttributesForceALine] - private string FieldWithAttribute; - - private string PropertiesCanBeGrouped { get; set; } - private string BecauseTheyDontForceLines { get; set; } - - // comments force a line - private string PropertyWithComment; - - [AttributesForceALine] - private string PropertyWithAttribute; - - delegate void DelegatesAreLikeFields(); - delegate void AndCanBeGrouped(); - - // comments force a line - delegate void DelegateWithComment(); - - [AttributesForceALine] - delegate void DelegateWithAttribute(); - - public void AlwaysLineBetweenMethods() { } - - private string FieldAfterMethodGetsLine; - -#if EDGE_CASE_SHOULD_KEEP_LINE_ABOVE_METHOD - private string Field; -#else - private string Field; -#endif - - public void SomeMethod() { } - -#pragma warning disable 0618 - public void KeepLineAboveAndBelow() { } -#pragma warning restore 0618 - - public void SomeMethod() { } -} - -public class LineBeforeClass { } - -public interface InterfaceRulesAreLikeClassesButMethodsFollowTheFieldRulesAbove -{ - void NeverLineHere(); - - void ExistingLineHereIsKept(); - void ButNoLineIsAdded(); - - // comments do force a line - void MethodWithComment(); -} - -abstract class AbstractClass -{ - abstract void NoLineHere() { } - - abstract void KeepTheLineHere(); - abstract void DoNotForceTheLineHere(); - - void ButForceLineForRealMethod() { } -} - -public class ClassName -{ - private string someField1; - -#if KEEP_LINE_ABOVE - private string someField2; -#endif - - private string someField2; -} - -public class ClassName -{ - #region RegionWithSpaceBeforeAndAfterMethod - - void SomeMethod() { } - - #endregion - - void SomeMethod() { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.actual.test deleted file mode 100644 index d19b435f7..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MethodDeclarations.actual.test +++ /dev/null @@ -1,124 +0,0 @@ -public class ClassName -{ - public void MethodName() { } - - public void LongMethodNameKeepsEmptyBraces__________________________________________________________() { } - - public void LongMethodNameKeepsEmptyBraces__________________________________________________________() - { - // comment - } - - public void LongMethodNameForceLineBreak( - string firstParameter___________, - string secondParameter___________, - string thirdParameter___________ - ) - { - return; - } - - public void LongMethodNameForceLineBreaks___________________________( - string one, - string two, - string three - ) { } - - public void ReallyLongMethodNameWithoutAnyParametersShouldNewLineBrace_______() - { - return; - } - - public void MethodName( - // leading - string one, // trailing - string two, - string three - ) - { - var x = 0; - } - - public void MethodName(string one, string two) { } - - public void MethodName() - { - MethodName(); - MethodName(); - } - - private Doc MethodWithParameters__________________( - SomeClass one, - SomeClass two, - SomeClass three - ) => CallSomethingElseWithALongNameThatForcesABreak_________(one, two, three); - - private Doc ShortMethod() => Method(); - - private Doc ShortishMethod(SomeClass one) => - CallSomeOtherLongMethodSoThatItBreaks____________________(one); - - private Doc MethodWithParameters_______________________( - SomeClass one, - SomeClass two, - SomeClass three - ) => CallSomething(one, two, three); - - private void MethodWithEmptyBlockShouldNotGetExtraSpace() - { - { - return; - } - } - - public void MethodName() - { - var keepNextExtraLine = 1; - - { - return; - } - } -} - -class ExplicitInterfaceSpecifier : IDisposable -{ - void IDisposable.Dispose() { } -} - -namespace SomeNamespace -{ - public class ClassName - { - public void Exactly100(IApplicationBuilder app, IWebHostEnvironment env____________________) - { - return; - } - - // leading comments don't affect modifiers - public void Exactly100(IApplicationBuilder app, IWebHostEnvironment env____________________) - { - return; - } - - // leading comments don't affect void - void Exactly100(IApplicationBuilder app, IWebHostEnvironment env___________________________) - { - return; - } - - // leading comments don't affect type - IList Exactly100(IApplicationBuilder app, IWebHostEnvironmet env___________________) - { - return; - } - - public void JustOver100( - IApplicationBuilder app, - IWebHostEnvironment env____________________ - ) - { - return; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.actual.test deleted file mode 100644 index 4ce15dbbc..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NamespaceDeclarations.actual.test +++ /dev/null @@ -1,20 +0,0 @@ -namespace EmptyNamespace { } - -// leading -namespace Namespace { } // trailing - -// leading with line -namespace // trailing keyword -// leading identifier -Namespace // trailing identifier -// leading semi start -{ // trailing semi start - // leading semi end -} // trailing semi end - -namespace NamespaceWithUsingAndClass -{ - using System; - - public class BasicClass { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.actual.test deleted file mode 100644 index 128fdb15b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/NullableTypes.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -public class BasicClass -{ - private Guid? NullableGuidField; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.actual.test deleted file mode 100644 index fa5a1509d..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObjectCreationExpressions.actual.test +++ /dev/null @@ -1,43 +0,0 @@ -public class ClassName -{ - public ClassName Basic = new ClassName(); - - public ClassName WithInitializer = new ClassName { Property = true }; - - public ClassName WithMediumInitializer = new ClassName - { - Property_____________________________ = true - }; - - public ClassName WithBigInitializer = new ClassName - { - Property1 = true, - Property2 = false, - Property3 = false, - Property4 = false, - Property5 = false - }; - - public ClassName TrailingComma = new ClassName_______________________ - { - Property1 = true, - Property2 = true, - }; - - public ClassName WithConstructorAndInitializer = new ClassName(false) - { - Property1 = true, - Property2 = false, - }; - - public ClassName WithComplexConstructor = new ClassName( - "parameter1", - new ClassName("parameter1", "parameter2") { Property1 = true } - ) - { - Property1 = true - }; - - public SomeGenericObject WithGenericLongEnoughToBreak = - new SomeGenericObject("someRandomValue"); -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.actual.test deleted file mode 100644 index f8111650a..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ObnoxiousEdgeCases.actual.test +++ /dev/null @@ -1,162 +0,0 @@ -// these are here so we can see how they change over time, see https://github.com/belav/csharpier/issues/272 -// try to clean these up if you are modifying formatting that affects them. -class ClassName -{ - public readonly StackObjectPool< - Dictionary - > KeyedItemInfoDictionaryPool_____; - - internal StackObjectPool< - Dictionary - > KeyedItemInfoDictionaryPool { get; } = - new StackObjectPool>( - maxPreservedItems: 10, - () => new Dictionary() - ); - - RenderFragment customNotAuthorized = state => - builder => builder.AddContent(0, $"Go away, {state.User.Identity.Name}"); - - public List<( - ClaimsPrincipal user, - object resource, - IEnumerable requirements - )> AuthorizeCalls { get; } = - new List<( - ClaimsPrincipal user, - object resource, - IEnumerable requirements - )>(); - - private static readonly Action _displayingNotFound = - LoggerMessage.Define( - LogLevel.Debug, - new EventId(1, "DisplayingNotFound"), - $"Displaying {nameof(NotFound)} because path '{{Path}}' with base URI '{{BaseUri}}' does not match any component route" - ); - - private static readonly Action< - ILogger, - Type, - string, - string, - Exception - > _navigatingToComponent = LoggerMessage.Define( - LogLevel.Debug, - new EventId(2, "NavigatingToComponent"), - "Navigating to component {ComponentType} in response to path '{Path}' with base URI '{BaseUri}'" - ); - - public void MethodName() - { - builder_________________.OpenComponent< - SecondCascadingParameterConsumerComponent - >(0); - } - - public static IRemoteAuthenticationBuilder< - RemoteAuthenticationState, - RemoteUserAccount - > AddAccountClaimsPrincipalFactory< - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] - TAccountClaimsPrincipalFactory - >(this IRemoteAuthenticationBuilder builder) - where TAccountClaimsPrincipalFactory : AccountClaimsPrincipalFactory => - builder.AddAccountClaimsPrincipalFactory< - RemoteAuthenticationState, - RemoteUserAccount, - TAccountClaimsPrincipalFactory - >(); - - private static readonly Action ActionNotImplemented = - new Action(_ => - { - throw new NotImplementedException(); - }); - - public void MapFrom(Func mappingFunction) - { - if (true) - { - PropertyMapActions.Add(pm => - { - Expression> expr = - (src, dest, destMember, ctxt) => mappingFunction(src, dest, destMember); - - pm.CustomMapFunction = expr; - }); - } - } - - public void Condition( - Func, bool> condition - ) => - PathMapActions.Add(pm => - { - Expression< - Func - > expr = (src, dest, srcMember, destMember, ctxt) => - condition( - new ConditionParameters( - src, - dest, - srcMember, - destMember, - ctxt - ) - ); - pm.Condition = expr; - }); - - public override Type SourceType - { - get => - _sourceType ??= - CustomMapExpression?.ReturnType - ?? CustomMapFunction?.ReturnType - ?? ( - _sourceMembers.Length > 0 - ? _sourceMembers[_sourceMembers.Length - 1].GetMemberType() - : Parameter.ParameterType - ); - protected set => _sourceType = value; - } - - public static Expression IfNullElse( - this Expression expression, - Expression then, - Expression @else - ) => - expression.Type.IsValueType - ? ( - expression.Type.IsNullableType() - ? Condition(Property(expression, "HasValue"), ToType(@else, then.Type), then) - : @else - ) - : Condition(ReferenceEqual(expression, Null), then, ToType(@else, then.Type)); - - private bool VisitChildForCompare(Pair tuple, ref int result) - { - int r; - return 0 - != ( - result = - (null == tuple.Item1) - ? -1 - : (null == tuple.Item2) - ? +1 - : 0 - != (r = comparer.Compare(tuple.Item1.LocalName, tuple.Item2.LocalName)) - ? r - : 0 - != ( - r = comparer.Compare( - tuple.Item1.NamespaceURI, - tuple.Item2.NamespaceURI - ) - ) - ? r - : 0 - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.actual.test deleted file mode 100644 index 91a186b8b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/OperatorDeclarations.actual.test +++ /dev/null @@ -1,21 +0,0 @@ -class ClassName -{ - static Complex operator +(Complex a, Complex b) - { - return a.Add(b); - } - - static Complex operator -( - Complex someOverlyLongNameToForceBreak, - Complex someOverlyLongNameToForceBreak2 - ) - { - return a.Add(b); - } - - static Complex operator checked -(Complex value); - - static BigInteger IUnaryNegationOperators.operator checked -( - BigInteger value - ) => -value; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.actual.test deleted file mode 100644 index a1248d1b5..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedExpressions.actual.test +++ /dev/null @@ -1,16 +0,0 @@ -class ClassName -{ - void MethodName() - { - var x = - query - && ( - currentChar == '=' - || currentChar == '<' - || currentChar == '!' - || currentChar == '>' - || currentChar == '|' - || currentChar == '&' - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.actual.test deleted file mode 100644 index a69ea08d7..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedLambdaExpressions.actual.test +++ /dev/null @@ -1,91 +0,0 @@ -public class ClassName -{ - public static readonly EventCallback Empty = new EventCallback(null, (Action)(() => { })); - public static readonly EventCallback Empty = new EventCallback( - null, - (Action)(() => { }) - ); - private static readonly Action _callbackCompleted = () => { }; - - public void MethodName() - { - this.Where(() => true); - this.Where([Attribute] () => true); - this.Where(async () => true); - this.Where([Attribute] async () => true); - this.Where(static () => true); - this.Where(async static () => true); - this.SomeMethod( - (longParameter__________________, longParameter_________________) => - longParameter________________ - ); - - this.SomeMethod( - ( - longerParameter_________________________, - longerParameter_________________________, - longerParameter_________________________ - ) => evenLongerParameter - ); - - this.SomeMethod( - [Attribute] - ( - longerParameter_________________________, - longerParameter_________________________, - longerParameter_________________________ - ) => evenLongerParameter - ); - - CallMethod(() => - { - CallOtherMethod(); - }); - - CallMethod( - () => CallOtherMethod___________________________________________________________() - ); - - var task = Task.Factory.StartNew(async () => - { - return await new WebClient().DownloadStringTaskAsync____________________( - "http://example.com" - ); - }); - - Action find = () => - EntryPointDiscoverer.FindStaticEntryMethod(typeof(IEnumerable<>).Assembly); - - var @delegate = (Action)((s) => { }); - - var reusedCommand = new Command("reused") { Handler = CommandHandler.Create(() => { }) }; - - var component = new EventComponent - { - OnArbitraryDelegateEvent = (Action)((x, y) => { }), - }; - - Parallel.For(0, OuterLoopCount, () => schedulers, _parallelAction, (s) => { }); - - var reusedCommand = new Command("reused") - { - Handler = CommandHandler.Create(() => - { - doSomething(); - }) - }; - - CallSomeMethod( - () => - CallAnotherMethodWithParameters( - someParameter, - someParameter___________________________________ - ) > someValue, - anotherParameter - ); - - var returnType = object (bool o) => o ? 1 : "two"; - var returnTypeWithAsync = async object (bool o) => o ? 1 : "two"; - var returnTypeWithAttribute = [Attribute] object (bool o) => o ? 1 : "two"; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.actual.test deleted file mode 100644 index 25037d0ea..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ParenthesizedVariableDesignations.actual.test +++ /dev/null @@ -1,12 +0,0 @@ -class ClassName -{ - void MethodName() - { - var (one, two, three) = CallMethod(); - var ( - oneoneoneoneoneoneoneoneoneone, - oneoneoneoneoneoneoneoneoneone, - oneoneoneoneoneoneoneoneoneone - ) = CallMethod(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.actual.test deleted file mode 100644 index 293b6228a..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PostIncrementExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - i++; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.actual.test deleted file mode 100644 index f8762d518..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreIncrementExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - ++i; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.actual.test deleted file mode 100644 index 1f60bc0b5..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols.actual.test +++ /dev/null @@ -1,52 +0,0 @@ -public class ClassName -{ -#if BASIC_IF - public string ShortPropertyName; -#elif BASIC_ELIF - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if !NOT_IF - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if EQUALS_TRUE == true - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if true == TRUE_EQUALS - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if NOT_EQUALS_TRUE != true - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if true != TRUE_NOT_EQUALS - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if LEFT_AND && RIGHT_AND - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif - -#if (LEFT_PAREN && RIGHT_PAREN) - public string ShortPropertyName; -#else - public string ShortPropertyName; -#endif -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.actual.test deleted file mode 100644 index 94ceef2cf..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PreprocessorSymbols_KeepNewIines.actual.test +++ /dev/null @@ -1,17 +0,0 @@ -class ClassName1 -{ - public void MethodName1() { } - -#if DEBUG - public void MethodName2() { } -#endif -} - -#if DEBUG - -class ClassName2 -{ - public void MethodName() { } -} - -#endif diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.actual.test deleted file mode 100644 index 98d7e5ce5..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/PropertyDeclarations.actual.test +++ /dev/null @@ -1,105 +0,0 @@ -public class ClassName -{ - public string Property { get; set; } - public string Interface.Property { get; set; } - - string ShortModifiers { get; private set; } - - string PropertyWithModifiersThatIsLongEnoughToBreak - { - protected internal get; - internal protected set; - } - - private string backingValue; - public string PropertyWithBackingValue - { - get { return backingValue; } - set { backingValue = value; } - } - - public string First { get; set; } = "First"; // trailing initializer comment - - public string LambdaAccessors - { - get => this.Property; - set => this.Property = value; - } - - public string LambdaBod => this.Property; - - public string LongNameForcesALineBreakSoWeCanTestEvenLonger____________________ => - this.Property; - - public string Property - { - get { return this.Property; } - } - - public string GetMultiLines - { - set { value = value; } - get - { - var x = "test"; - return x; - } - } - - public string Property - { - [Obsolete] - get; - [Obsolete] - set; - } - - public virtual ICollection SomeLongNameThatForcesALineBreak______________________ { get; set; } = - new HashSet(); - - public Dictionary Properties_________________ { get; set; } = - new Dictionary(); - - public IReadOnlyCollection> SomeName => true; - - public IReadOnlyCollection< - Action - > SomeRandomLongName___________________ => someRandomResult_________________; - - public IReadOnlyCollection< - Action, - SomethingElse - > SomeRandomLongName___________________ => someRandomResult_________________; - - public virtual LongerPropertyConfiguration LongerPropertyConfiguration { get; set; } - - public List<( - ClaimsPrincipal user, - object resource, - IEnumerable requirements - )> AuthorizeCalls { get; } = - new List<( - ClaimsPrincipal user, - object resource, - IEnumerable requirements - )>(); - - public int[] ArrayWithoutSizesDoesntBreak { get; set; } - - public int[] ArrayWithInitializer { get; set; } = { 1, 2, 3, 4, 5 }; - - public Guid[] BreakingArray1 { get; set; } = - { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() }; - - public Guid[] BreakingArray2 { get; set; } = - { - Guid.NewGuid(), - Guid.NewGuid(), - Guid.NewGuid(), - Guid.NewGuid(), - Guid.NewGuid(), - Guid.NewGuid(), - Guid.NewGuid(), - Guid.NewGuid() - }; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.actual.test deleted file mode 100644 index 3fdf9819e..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions.actual.test +++ /dev/null @@ -1,102 +0,0 @@ -class ClassName -{ - void MethodName() - { - var query1 = from c in customers select c; - query1 = from c in customers select c into d select d; - query1 = - from c in customers - join c1 in customers_____________________________ - on c1.GetHashCode() equals c.GetHashCode() - into e - select c into d - select d; - - var query2 = from Customer c in customers select c; - - var selectBreak = - from Customer c in customers - select new - { - One = c.One, - Two = c.Two, - Three = C.Three - }; - - var whereQuery = from c in customers where c.Value == "true" select d; - - var orderByQuery = - from c in customers - where c.Value == "true" - orderby c.FirstProperty, c.SecondProperty descending - select d; - - var complexWhere = - from c in customers - where - c.Value == "true" - && someLongValueThatForcesABreak_________________________ != someOtherValue - select d; - - var selectIntoQuery = from c in customers select c into d select d; - - var longJoin = - from c in customers - join c1 in customers_____________________________ - on c1.GetHashCode() equals c.GetHashCode() - into e - select c into d - select d; - - var joinWitType = - from c in customers - join Customers c1 in customers_____________________________ - on c1.GetHashCode() equals c.GetHashCode() - into e - select c into d - select d; - - var complexQuery = - from c in customers - let d = c - where d != null - join c1 in customers1 on c1 equals c - join c1 in customers__________________________________ - on c1.GetHashCode() equals c.GetHashCode() - into e - group c by c.Country into g - orderby g.Count() ascending - orderby g.Key descending - select new - { - Country________________________ = g.Key, - CustCount____________________________ = g.Count() - }; - - var complexQuerySupportsNewLines = - from c in customers - - let d = c - - where d != null - - join c1 in customers1 on c1 equals c - - group c by c.Country into g - - orderby g.Count() ascending - - select new { Country = g.Key, CustCount = g.Count() }; - - var asyncQuery = await - from c in customers - from u in users - from res in HandleAsync(c, u) - select res; - - return from i in Enumerable.Range(0, 10) - let i2 = i * i - where i2 < 100 - select new { Square = i2, Root = i }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.actual.test deleted file mode 100644 index 99f5bfd76..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/QueryExpressions_RemoveSpaces.actual.test +++ /dev/null @@ -1,14 +0,0 @@ -var complexQuerySupportsNewLines = - from c in customers - - let d = c - - where d != null - - join c1 in customers1 on c1 equals c - - group c by c.Country into g - - orderby g.Count() ascending - - select new { Country = g.Key, CustCount = g.Count() }; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.actual.test deleted file mode 100644 index 4323a49d0..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RangeExpressions.actual.test +++ /dev/null @@ -1,14 +0,0 @@ -class ClassName -{ - void Ranges() - { - var thirdItem = list[2]; - var lastItem = list[^1]; - var multiDimensional = list[3, ^2]; - var slice1 = list[2..^3]; - var slice2 = list[..^3]; - var slice3 = list[2..]; - var slice4 = list[..]; - var multiDimensional = list[1..2, ..]; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.actual.test deleted file mode 100644 index 51b706e48..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RecordDeclarations.actual.test +++ /dev/null @@ -1,53 +0,0 @@ -record DailyTemperature(double HighTemp, double LowTemp) -{ - public double Mean => (HighTemp + LowTemp) / 2.0; -} - -record MostlyWeeklyTemperature( - double monday, - double monday, - double thursday, - double friday, - double sunday -) -{ - public double Mean => (monday + monday + thursday + friday + sunday) / 5.0; -} - -record PC(string x) : PrimaryConstructor(x) { } - -public record RecordWithProperty -{ - public string Property { get; set; } -} - -record RecordWithoutBody(string property); - -record LongerRecordNameWhatHappens_________________________________________(string x) - : R4(x) { } - -record GenericRecord(T Result); - -public record LotsOfParametersWithBase( - string longNameParameter, - string areTheyCalledParametersWithRecords, - string theyLookLikeParameters -) : BaseRecord(longNameParameter); - -public record LotsOfParametersWithBaseWithLots( - string longNameParameter, - string areTheyCalledParametersWithRecords, - string theyLookLikeParameters -) - : BaseRecord( - longNameParameter, - areTheyCalledParametersWithRecords, - theyLookLikeParameters, - "someExtraValueToMakeThisReallyLong" - ); - -public record SomeRecord : SomeBaseRecord { } - -public record struct StructRecord; - -public record class ClassRecord; diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.actual.test deleted file mode 100644 index 64a311e72..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - ref readonly var r1 = ref MethodName(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.actual.test deleted file mode 100644 index b3647ec40..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RefTypes.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - ref Vector3 MethodName() - { - break; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.actual.test deleted file mode 100644 index 2342b9aa6..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ReturnStatements.actual.test +++ /dev/null @@ -1,25 +0,0 @@ -class ClassName -{ - void EmptyReturn() - { - return; - } - - bool ReturnBinaryExpression() - { - return someOther || otherValue; - } - - bool ReturnLongBinaryExpression() - { - return someValueThatIsLongAndForcesALineBreak - || otherValueThatIsLongAndForcesALineBreak_____________________; - } - - string LongMethodCallWithParameter() - { - return CallSomeLongMethodThatIndentsInsideOfItAndSeeWhatHappens( - "SomeLongerValue________________________________" - ); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.actual.test deleted file mode 100644 index 445751f47..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SimpleLambdaExpressions.actual.test +++ /dev/null @@ -1,25 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - this.Where(o => true); - - this.WhereAsync(async o => true); - - this.WhereAsync(static o => true); - - this.Where___________________( - longName__________________ => someOtherLongName__________________ - ); - - this.Where___________________( - superLongName________________________________ => - someOtherLongName_______________________________ - ); - - this.Where___________________(superLongName________________________________ => - { - return someOtherLongName__________________; - }); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.actual.test deleted file mode 100644 index a0bcba979..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StackAllocArrayCreationExpressions.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -class ClassName -{ - void MethodName() - { - Span a = stackalloc int[3]; - Span a = stackalloc int[3] { 1, 2, 3 }; - Span a = stackalloc int[] { 1, 2, 3 }; - Span a = stackalloc[] { 1, 2, 3 }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.actual.test deleted file mode 100644 index 4fbb6276b..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StringLiterals.actual.test +++ /dev/null @@ -1,165 +0,0 @@ -[assembly: System.Copyright( - @"(C)"" -2009" -)] - -class ClassName -{ - private string bothLineEndingsPersist = @"\r\n \n"; - private string interpolatedVersion = @$"\r\n \n"; - - private string emptyLines = - @"one - -two - - -three -"; - - private string interpolatedEmptyLines = - @$"one - -two - - -three -"; - - public void VerbatimNewlineInInterpolated() - { - return @$"{CallMethod(o => @" - IndentedAfterNewLine")}"; - } - - private string stayOnLine1 = - @"one -two -"; - - private string stayOnLine2 = - $@"one -two -"; - - private string stayOnLine3 = - @"one -two -three -four"; - - private string stayOnLine4 = - @$"one -two -three -four"; - - private void MethodName() - { - CallSomeLongMethod( - @"one -two -three -four -five -" - ); - - CallSomeLongMethod( - $@"one -two -three -four -five -" - ); - - CallSomeLongMethod( - @"one -two -three -four", - five - ); - - CallSomeLongMethod( - $@"one -two -three -four", - five - ); - - var multiLineRaw = """ - This is a long message. - It has several lines. - Some are indented - more than others. - Some should start at the first column. - Some have "quoted text" in them. - """; - - var multiLineRawInterpolated = $""" - This is a long message. - It has several lines. - Some are indented - more than others. - Some should start at the first column. - Some have "quoted text" in them. - """; - - var shortRaw = """Short Raw String"""; - var shortRawInterpolated = $"""Short Raw String"""; - var longRaw = - """Long Raw String """; - var longRawInterpolated = - $"""Long Raw String """; - - CallSomeLongMethod( - """ -one -two -three -four -five -""" - ); - - CallSomeLongMethod( - """ -one -two -three -four -""", - five - ); - - CallSomeLongMethod( - one, - """ -two -three -four -""", - five - ); - - var expressionsInInterpolatedVerbatimStringDontBreak = - $@"{CallMethod_____________________________().CallMethod_____________________________().CallMethod_____________________________()}"; - - var butKeepExistingBreaks = - $@" { - // some comment - CallMethod() - } "; - - var butKeepExistingBreaks = - $" { - // some comment - CallMethod() - } "; - - ReadOnlySpan utf8StringLiteral = "hello"u8; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.actual.test deleted file mode 100644 index afc2499d6..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/StructDeclarations.actual.test +++ /dev/null @@ -1,3 +0,0 @@ -struct BasicStruct { } - -public readonly struct ReadonlyStruct { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.actual.test deleted file mode 100644 index 764e53018..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions.actual.test +++ /dev/null @@ -1,92 +0,0 @@ -class ClassName -{ - void MethodName() - { - return 1 switch - { - 1 => 100, - 2 => 200, - 3 when false => 300, - - _ => throw new global::System.Exception() - }; - - return (GetState(), action, hasKey) switch - { - // Comment - (DoorState.Closed, Action.Open, _) => DoorState.Opened, - (DoorState.Opened, Action.Close, _) => DoorState.Closed, - - // ExtraLineBeforeThis - (DoorState.Closed, Action.Lock, true) => DoorState.Locked, - (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, - (var state, _, _) => state, - (_, _, _) - => DoorState.LongStateShouldNotGetExtraLine________________________________________ - }; - - return someValue switch - { - SomeSimpleObject => DoSomething(), - { IsParameter: true } => 1, - // this comment shouldn't affect the next line - { IsParameter: false } => 0, - SomeLongObject someLongObject - => CallSomeMethodWith____________________________(someLongObject), - YetAnotherObject - => CallSomeMethod( - someValue, - andOtherParameters, - thatMakeThisLongEnoughToBreak___________________ - ), - VeryLongObject_______________________________________________________________ - when count > 0 - => CallSomeMethod(someValue), - OneMore - => "someStrings" - + "moreStrings" - + "andMoreStrings_________________________________________", - SomeOtherObject - or AnotherObject - or OrEvenSomeOtherObject_________________ - => CallSomeMethod(someValue), - SomeOtherObject { SomeProperty: SomeOtherProject } - or AnotherObject - => CallSomeMethod(someValue), - AnotherObject - or SomeOtherObject { SomeProperty: SomeOtherProject } - => CallSomeMethod(someValue), - SomeOtherObject { Property: true } => CallSomeMethod(someValue), - SomeOtherObject { SomeProperty: YetAnotherObject { Property: true } } - => CallSomeMethod(someValue), - { } otherSyntax => CallSomeMethod(otherSyntax), - { SomeProperty: true } - => "Just because this is long, don't break the pattern ", - _ => CallSomeMethod(someValue) - }; - - return someValue switch - { - { IsParameter: true, } => noExtraLineAfterThis, - { IsParameter: someLongValue____________________________________________, } - => someOtherValue - }; - - return (original, updated) switch - { - ( - FieldSymbol - { - ContainingType: { IsTupleType: true }, - TupleElementIndex: var oi - } originalField, - FieldSymbol - { - ContainingType: { IsTupleType: true }, - TupleElementIndex: var ui - } updatedField - ) - => originalField.Type.Equals(updatedField.Type) - }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.actual.test deleted file mode 100644 index fbd2f8561..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchExpressions_Tabs.actual.test +++ /dev/null @@ -1,92 +0,0 @@ -class ClassName -{ - void MethodName() - { - return 1 switch - { - 1 => 100, - 2 => 200, - 3 when false => 300, - - _ => throw new global::System.Exception() - }; - - return (GetState(), action, hasKey) switch - { - // Comment - (DoorState.Closed, Action.Open, _) => DoorState.Opened, - (DoorState.Opened, Action.Close, _) => DoorState.Closed, - - // ExtraLineBeforeThis - (DoorState.Closed, Action.Lock, true) => DoorState.Locked, - (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, - (var state, _, _) => state, - (_, _, _) - => DoorState.LongStateShouldNotGetExtraLine________________________________________ - }; - - return someValue switch - { - SomeSimpleObject => DoSomething(), - { IsParameter: true } => 1, - // this comment shouldn't affect the next line - { IsParameter: false } => 0, - SomeLongObject someLongObject - => CallSomeMethodWith____________________________(someLongObject), - YetAnotherObject - => CallSomeMethod( - someValue, - andOtherParameters, - thatMakeThisLongEnoughToBreak___________________ - ), - VeryLongObject_______________________________________________________________ - when count > 0 - => CallSomeMethod(someValue), - OneMore - => "someStrings" - + "moreStrings" - + "andMoreStrings_________________________________________", - SomeOtherObject - or AnotherObject - or OrEvenSomeOtherObject_________________ - => CallSomeMethod(someValue), - SomeOtherObject { SomeProperty: SomeOtherProject } - or AnotherObject - => CallSomeMethod(someValue), - AnotherObject - or SomeOtherObject { SomeProperty: SomeOtherProject } - => CallSomeMethod(someValue), - SomeOtherObject { Property: true } => CallSomeMethod(someValue), - SomeOtherObject { SomeProperty: YetAnotherObject { Property: true } } - => CallSomeMethod(someValue), - { } otherSyntax => CallSomeMethod(otherSyntax), - { SomeProperty: true } - => "Just because this is long, don't break the pattern ", - _ => CallSomeMethod(someValue) - }; - - return someValue switch - { - { IsParameter: true, } => noExtraLineAfterThis, - { IsParameter: someLongValue____________________________________________, } - => someOtherValue - }; - - return (original, updated) switch - { - ( - FieldSymbol - { - ContainingType: { IsTupleType: true }, - TupleElementIndex: var oi - } originalField, - FieldSymbol - { - ContainingType: { IsTupleType: true }, - TupleElementIndex: var ui - } updatedField - ) - => originalField.Type.Equals(updatedField.Type) - }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.actual.test deleted file mode 100644 index 019cbcc11..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/SwitchStatements.actual.test +++ /dev/null @@ -1,116 +0,0 @@ -public class ClassName -{ - public void MethodName() - { - switch (0) - { - case 0: - case 1: - { - break; - } - - case 1 + 1: - { - return; - } - - case 4: - var x = 1; - break; - - default: - { - return; - } - } - - switch (0) - { - case 1: - case 2: - - default: - break; - } - - switch (0) - { - case 1: - { - goto case 2; - } - case 2: - { - goto default; - } - default: - { - return; - } - } - - switch (0) { } - - switch (arg) - { - case "A" when b > 50: - case "B" when B < 50: - - case "C______________________________________________________________________" - when C == 50: - return; - case "D______________________________________________________________________" - when D == 50: - case "E______________________________________________________________________" - when E == 50: - { - return; - } - default: - { - break; - } - } - - switch (emptyBlockInCaseShouldntGetExtraSpace) - { - case 1: - { - { - return 1; - } - } - } - - switch ( - someLongValue - + someOtherLongValue_________________________________________________________ - ) - { - default: - return; - } - - switch (patternMatching) - { - case SomeLongRecursivePattern - { - SomeProperty: " ", - SomeOtherProperty: { SomeProperty: One or Two } - }: - return 1; - case SomeShortRecursivePattern { SomeProperty: "" }: - return 2; - default: - break; - } - - switch (positionalPattern1, positionalPattern2) - { - case (SomeValue, _) when !isEquality: - case (_, SomeValue) when !isEquality: - return; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.actual.test deleted file mode 100644 index 6c76db3d5..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - var result = nullableResult ?? throw new NullReferenceException(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.actual.test deleted file mode 100644 index 75da62d53..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/ThrowStatements.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - throw new Exception(); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.actual.test deleted file mode 100644 index e103d1cd1..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TryStatements.actual.test +++ /dev/null @@ -1,59 +0,0 @@ -class ClassName -{ - void MethodName() - { - try - { - throw null; - } - catch (Exception) - { - throw; - } - catch (ArgumentException ex) - { - throw; - } - finally - { - return; - } - - try { } - catch { } - - try { } - finally { } - - try - { - throw null; - } - catch (Exception e) when (myFilter(e)) - { - throw; - } - - try - { - throw new Exception(); - } - catch (Exception exception) - when (exception.Message.Contains("someLongValueThatMakesThisLineTooLong")) - { - return; - } - - try - { - throw new Exception(); - } - catch (Exception exception) - when (exception.Message.Contains("someLongValueThatMakesThisLineTooLong") - && someLongCondition == someOtherLongValue - ) - { - return; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.actual.test deleted file mode 100644 index b6f1318b7..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TupleExpressions.actual.test +++ /dev/null @@ -1,53 +0,0 @@ -class ClassName -{ - void MethodName() - { - (int, int) t1; - var res = t1 == (1, 2); - } - - List<(string x, string y)> TupleWithIdentifier() - { - return new() { (href: "one", title: "two") }; - } - - public async Task TupleAssignment() - { - var (noteTexts, matcher) = await ( - GetAndAnalyzeNoteTexts(), - _wordInfoCollectionManager.BuildWordMatcher() - ); - - var (a, b) = await (c(), d()); - } - - public async Task<( - ILookup someLookup, - ILookup reverseLookup, - ILookup thirdLookup - )> CreateLookups() - { - // do something - } - - public async ( - ILookup someLookup, - ILookup reverseLookup, - ILookup thirdLookup - ) CreateLookups() - { - // do something - } - - public void TuplesAsInput( - ( - int myInt, - string myString, - ClassName myClassNameInstance, - Dictionary wordList - ) inputArgs - ) - { - // do something - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.actual.test deleted file mode 100644 index bc1f37e65..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeArgumentLists.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -typeof(AnExceptionallyLongAndElaborateClassNameToMakeAnExampleRegardingOpenGenerics<,>).MakeGenericType( - typeof(string), - typeof(int) -); diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.actual.test deleted file mode 100644 index 6d2533a9e..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeOfExpressions.actual.test +++ /dev/null @@ -1,7 +0,0 @@ -class ClassName -{ - void MethodName() - { - var t = typeof(int); - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.actual.test deleted file mode 100644 index cbc19f140..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/TypeParameterConstraintClauses.actual.test +++ /dev/null @@ -1,89 +0,0 @@ -delegate void Delegate() - where T : struct; - -class ClassName - where T : class -{ - void MethodName() - where T : class - { - void LocalFunction() - where T : class - { - return; - } - } - - public static ReturnType MethodName() - where T : class - where U : class - { - return; - } - - public static ReturnType MethodName() - where T : class - where U : class { } - - public static ReturnType MethodName(string parameter) - where T : class - where U : class - { - return; - } - - public static ReturnType MethodName( - string longParameter_______________________, - string longParameter_______________________ - ) - where T : class - { - return; - } - - public static ReturnType MethodName( - string longParameter_______________________, - string longParameter_______________________ - ) - where T : class { } - - public static ReturnType MethodName( - string longParameter_______________________, - string longParameter_______________________ - ) - where T : class - where U : class - { - return; - } - - public static ReturnType MethodName( - string longParameter_______________________, - string longParameter_______________________ - ) - where T : class - where U : class { } -} - -interface InterfaceName - where T : class { } - -struct Struct - where T : class { } - -class ClassName - where N : new() - where C : class - where T : IComparable - where TT : IList - where L : class, new() -{ - private string x; -} - -class ClassName - where N : new() - where C : class - where T : IComparable - where TT : IList - where L : class, new() { } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.actual.test deleted file mode 100644 index e126d7dcd..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryMinusExpressions.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -class ClassName -{ - int x = -1; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.actual.test deleted file mode 100644 index 49eb8c2bc..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnaryPlusExpressions.actual.test +++ /dev/null @@ -1,4 +0,0 @@ -class ClassName -{ - int x = +1; -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.actual.test deleted file mode 100644 index 7576541b0..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UnsafeStatements.actual.test +++ /dev/null @@ -1,10 +0,0 @@ -class ClassName -{ - void MethodName() - { - unsafe - { - int* p = null; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.actual.test deleted file mode 100644 index 9f53a36e9..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.actual.test +++ /dev/null @@ -1,28 +0,0 @@ -// leading -using First; // trailing - -// leading with space -using // another trailing -Second; - -using -// static leading -static // static trailing -Third; - -using M = System.Math; - -using static System.Math; - -global using System; - -using First; -using Second; - -namespace Namespace -{ - using Third; - using One.Two.Three; - - public class ClassName { } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.actual.test deleted file mode 100644 index 87bc214ab..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingStatements.actual.test +++ /dev/null @@ -1,70 +0,0 @@ -class ClassName -{ - void MethodName() - { - using (var x = BeginScope()) - { - return; - } - - await using (var x = BeginScope()) - { - return; - } - - using (var x = BeginScope()) - using (var y = BeginScope()) - { - return; - } - - using (BeginScope()) - { - return; - } - - using (BeginScope()) - return; - - using ( - BeginScope() - .LongerMethod_________________________() - .MakeThisThingChain______________________() - ) - { - return; - } - - using (var x = SomeMethodCallThatHitsExactly100__________________________________________()) - { - return; - } - - // leading comment doesn't break differently - using (var x = SomeMethodCallThatHitsExactly100__________________________________________()) - { - return; - } - - // leading comment doesn't break differently - await using (var x = SomeMethodCallThatHitsExactly100____________________________________()) - { - return; - } - - using ( - var x = SomeMethodCallThatHitsJustOver100__________________________________________() - ) - { - return; - } - - // leading await - await - // leading using - using (var y = Something()) - { - return; - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.actual.test deleted file mode 100644 index 60fa1ac67..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.actual.test +++ /dev/null @@ -1,184 +0,0 @@ -class ClassName -{ - void MethodName() - { - int x = 0, - y = 1, - z = 12; - - string one = "one", - two = "two"; - - // leading comment - var leading = 0; - - var trailing = 0; // trailing comment - - // leading comment - bool leading2; - - bool trailing2; // trailing comment - - var trailingMulti = 1; /* ensure no extra line after this */ - var trailingMultiAfter = 2; - - var captureUnmatchedValuesParameters______________________________ = - new List(); - - Func s_isVisualBasicCommentTrivia = (syntaxTrivia) => - syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia); - - Func s_isVisualBasicCommentTrivia = ( - syntaxTrivia_________________________________ - ) => syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia); - - Action find = () => - EntryPointDiscoverer.FindStaticEntryMethod(typeof(IEnumerable<>).Assembly); - - Action find = () => - EntryPointDiscoverer.FindStaticEntryMethod( - typeof(IEnumerable<>).Assembly_________________________________________ - ); - - var arrayCreationExpression1 = new byte[100]; - var arrayCreationExpression2 = new byte[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth - ]; - var arrayCreationExpression3 = new byte[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 - ]; - var shortOne______ = new byte[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 - ]; - var muchLongerOne_________________ = new byte[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth + DefaultValueColumnWidth - ]; - var muchLongerOne_________________ = new byte[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth - + SqlParameterCollectionExtensions.DefaultValueColumnWidth - ]; - - var elementAccessExpression1 = anArray[100]; - var elementAccessExpression2 = anArray[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth - ]; - var elementAccessExpression3 = anArray[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 - ]; - var shortOne______ = anArray_[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100 - ]; - var shortOne______ = anArray[ - DefaultValueColumnWidth_________ + DefaultValueColumnWidth_______ - ]; - var shortOne______ = anArray[ - SqlParameterCollectionExtensions.DefaultValueColumnWidth - + SqlParameterCollectionExtensions.DefaultValueColumnWidth - ]; - - var someLongValue_________________ = memberAccessExpression[ - elementAccessExpression - ].theMember______________________________; - - var someLongValue_________________ = memberAccessExpression[ - elementAccessExpression - ].theMember______________________________(); - - var someLongValue_________________ = memberAccessExpression( - elementAccessExpression - ).theMember______________________________; - - var someLongValue_________________ = memberAccessExpression(elementAccessExpression) - .theMember______________________________(); - - var someLongVariable_doesNotBreakArrayRank____________________________ = - (ArrayType[])CallMethod(); - - var conditionalIndentation = someBoolean - ? someLongValue____________________________________ - + someLongValue____________________________________ - : someLongValue____________________________________ - + someLongValue____________________________________; - - var longEnoughToMakeThisBreak = - something == somethingElse ? shortValue__________ : otherShortValue; - - var value = - someLongValue__________________________________ - && someOtherValue__________________________________ - ? trueValue - : falseValue; - - var value = someLongCondition______________________ - ? "someLongValue" - : "someOtherLongValue"; - - fixed ( - byte* someName_____________________ = - (someCondition > someOtherLongCondition_______________________) - ? new byte[someValue] - : null - ) { } - - var variableDeclarator = conditionalAccessExpression?.invocationExpression( - o => someLongValue___________________________________ - ); - - var variableDeclarator = (CastExpression) - invocationExpression.SomeMethod(someParameter______________________); - - var someValue = - (SomeLongGenericType)someLongValue___________________________; - - var variableDeclarator = ( - @"parenthesizedExpression -withLineEnding" - ); - - var value = coalesceAssignmentExpression ??= CallMethod( - parameter_____________________, - parameter_____________________ - ); - - var value = - coalesceAssignmentExpression = - coalesceAssignmentExpression ??= - CallMethod(parameter_____________________, parameter_____________________); - - var value = CallSomeMethod( - someParameter_____________________, - someParameter_____________________ - ) - ? someValue - : someOtherValue; - - var someValue = - await SomeObject.CallLongAsyncMethod____________________________________________( - someParameter_________________________, - someParameter_________________________ - ); - - var someValue = - SomeObject.CallLongMethod____________________________________________________( - someParameter_________________________, - someParameter_________________________ - ); - - var someValue = - SomeObject.CallLongMethod____________________________________________________() - ? someValue - : someOtherValue; - - var someValue = SomeObject - .CallLongMethod____________________________________________________() - .CallLongMethod____________________________________________________() - ? someValue - : someOtherValue; - - var someValue = - someLongCondition___________________________________ - && someOtheLongCondition___________________________________ - ? someValue - : someValue; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.actual.test deleted file mode 100644 index 6f979d467..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WhileStatements.actual.test +++ /dev/null @@ -1,58 +0,0 @@ -class ClassName -{ - void MethodName() - { - while (true) - { - return; - } - - while (true && false) - { - return; - } - - while ( - directoryInfo.Name != "Test" - && directoryInfo.Parent != null - && someLongCondition == "test" - ) - { - directoryInfo = directoryInfo.Parent; - } - - while (exactly100 || moreTextToMakeItWork__________________________________________________) - { - return; - } - - // leading comment doesn't break differently - while (exactly100 || moreTextToMakeItWork__________________________________________________) - { - return; - } - - while ( - justOver100 || moreTextToMakeItWork__________________________________________________ - ) - { - return; - } - - while (true) - return; - - while (someLongerStatement && someOtherLongerStatement________________) - return someLongerValue; - - while ( - someEvenLongerStatement && someOtherEvenLongerStatement________________________________ - ) - return someLongerValue; - - while (true) - { - // indent - } - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.actual.test deleted file mode 100644 index bd87fa5c8..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/WithExpressions.actual.test +++ /dev/null @@ -1,14 +0,0 @@ -class ClassName -{ - void MethodName() - { - someRecord = someRecord with { Property = "Value" }; - - someRecord = someRecord with - { - Property = "Value", - AnotherProperty = "Value", - YetAnother = "Value" - }; - } -} diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.actual.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.actual.test deleted file mode 100644 index 5ba360463..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/YieldReturnStatements.actual.test +++ /dev/null @@ -1,8 +0,0 @@ -class ClassName -{ - void MethodName() - { - yield return null; - yield break; - } -} diff --git a/Src/CSharpier.Tests/Samples/AllInOne.actual.cst b/Src/CSharpier.Tests/Samples/AllInOne.actual.cst new file mode 100644 index 000000000..130d9ca01 --- /dev/null +++ b/Src/CSharpier.Tests/Samples/AllInOne.actual.cst @@ -0,0 +1,1202 @@ +#error Error message +#warning Warning message +#pragma warning disable 414, 3021 +#pragma warning restore 3021 +#pragma checksum "file.txt" "{00000000-0000-0000-0000-000000000000}" "2453" +#define foo // Comment in directive +#if foo +#else +#endif +#undef foo + +extern alias Foo; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using M = System.Math; + +#if DEBUG || TRACE +using System.Diagnostics; +#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false +using System.Diagnostics; +#else +using System.Diagnostics; +#endif + +#region Region + +#region more +using ConsoleApplication2.Test; +#endregion +using X = int1; +using Y = ABC.X; + +using static System.Math; +using static System.DayOfWeek; +using static System.Linq.Enumerable; + +#endregion + +[assembly: System.Copyright( + @"(C)"" + +2009" +)] +[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] + +class TopLevelType : IDisposable +{ + void IDisposable.Dispose() { } +} + +namespace My +{ + using A.B; + + interface CoContra { } + + delegate void CoContra2<[System.Obsolete()] out T, in K>() + where T : struct; + + public unsafe partial class A : C, I + { + [DllImport("kernel32", SetLastError = true)] + static extern bool CreateDirectory(string name, SecurityAttribute sa); + + private const int global = int.MinValue - 1; + + static A() { } + + public A(int foo) + { + L: + { + int i = sizeof(int); + ++i; + var s1 = $"x {1, -2:d}"; + var s2 = $@"x {1, -2:d}"; + } + +#if DEBUG + Console.WriteLine(export.iefSupplied.command); +#endif + const int? local = int.MaxValue; + const Guid? local0 = new Guid(r.ToString()); + + var привет = local; + var мир = local; + var local3 = 0, + local4 = 1; + local3 = local4 = 1; + var local5 = null as Action ?? null; + var local6 = local5 is Action; + + var u = 1u; + var U = 1U; + long hex = 0xBADC0DE, + Hex = 0XDEADBEEF, + l = -1L, + L = 1L, + l2 = 2l; + ulong ul = 1ul, + Ul = 1Ul, + uL = 1uL, + UL = 1UL, + lu = 1lu, + Lu = 1Lu, + lU = 1lU, + LU = 1LU; + int minInt32Value = -2147483648; + int minInt64Value = -9223372036854775808L; + + bool @bool; + byte @byte; + char @char = 'c', + \u0066 = '\u0066', + hexchar = '\x0130', + hexchar2 = (char)0xBAD; + string \U00000065 = "\U00000065"; + decimal @decimal = 1.44M; + @decimal = 1.2m; + dynamic @dynamic; + double @double = M.PI; + @double = 1d; + @double = 1D; + @double = -1.2e3; + float @float = 1.2f; + @float = 1.44F; + int @int = local ?? -1; + long @long; + object @object; + sbyte @sbyte; + short @short; + string @string = @"""/*"; + uint @uint; + ulong @ulong; + ushort @ushort; + + dynamic dynamic = local5; + var add = 0; + var alias = 0; + var arglist = 0; + var ascending = 0; + var async = 0; + var await = 0; + var by = 0; + var descending = 0; + var dynamic = 0; + var equals = 0; + var from = 0; + var get = 0; + var group = 0; + var into = 0; + var join = 0; + var let = 0; + var nameof = 0; + var on = 0; + var orderby = 0; + var partial = 0; + var remove = 0; + var select = 0; + var set = 0; + var when = 0; + var where = 0; + var yield = 0; + var __ = 0; + where = yield = 0; + + if (i > 0) + { + return; + } + else if (i == 0) + { + throw new Exception(); + } + var o1 = new MyObject(); + var o2 = new MyObject(var); + var o3 = new MyObject { A = i }; + var o4 = new MyObject(@dynamic) + { + A = 0, + B = 0, + C = 0 + }; + var o5 = new { A = 0 }; + var dictionaryInitializer = new Dictionary { { 1, "" }, { 2, "a" } }; + float[] a = new float[] { 0f, 1.1f }; + int[,,] cube = + { + { + { 111, 112 }, + { 121, 122 } + }, + { + { 211, 212 }, + { 221, 222 } + } + }; + + int[][] jagged = + { + { 111 }, + { 121, 122 } + }; + int[][,] arr = new int[5][,]; // as opposed to new int[][5,5] + arr[0] = new int[5, 5]; // as opposed to arr[0,0] = new int[5]; + arr[0][0, 0] = 47; + int[] arrayTypeInference = new[] { 0, 1 }; + switch (3) { } + switch (i) + { + case 0: + case 1: + { + goto case 2; + } + case 2 + 3: + { + goto default; + break; + } + default: + { + return; + } + } + while (i < 10) + { + ++i; + if (true) + { + continue; + } + break; + } + do + { + ++i; + if (true) + { + continue; + } + break; + } while (i < 10); + for (int j = 0; j < 100; ++j) + { + for (; ; ) + { + for (int i = 0, j = 0; i < length; i++, j++) { } + if (true) + { + continue; + } + break; + } + } + label: + goto label; + label2: + ; + foreach (var i in Items()) + { + if (i == 7) + { + return; + } + else + { + continue; + } + } + checked + { + checked(++i); + } + unchecked + { + unchecked(++i); + } + lock (sync) + process(); + using (var v = BeginScope()) + using (A a = new A()) + using ( + A a = new A(), + b = new A() + ) + using (BeginScope()) + return; + yield return this.items[3]; + yield break; + fixed ( + int* p = stackalloc int[100], + q = &y + ) + { + *intref = 1; + } + fixed (int* p = stackalloc int[100]) + { + *intref = 1; + } + unsafe + { + int* p = null; + } + try + { + throw null; + } + catch (System.AccessViolationException av) + { + throw av; + } + catch (Exception) + { + throw; + } + finally + { + try { } + catch { } + } + var anonymous = { A = 1, B = 2, C = 3 }; + var query = + from c in customers + let d = c + where d != null + join c1 in customers on c1.GetHashCode() equals c.GetHashCode() + join c1 in customers on c1.GetHashCode() equals c.GetHashCode() into e + group c by c.Country into g + orderby g.Count() ascending + orderby g.Key descending + select new { Country = g.Key, CustCount = g.Count() }; + query = from c in customers select c into d select d; + } + + ~A() { } + + private readonly int f1; + + [Obsolete] + [NonExisting] + [Foo::NonExisting(var, 5)] + [CLSCompliant(false)] + [Obsolete, System.NonSerialized, NonSerialized, CLSCompliant(true || false & true)] + private volatile int f2; + + [return: Obsolete] + [method: Obsolete] + public void Handler(object value) { } + + public int m(T t) + where T : class, new() + { + base.m(t); + return 1; + } + + public string P + { + get { return "A"; } + set; + } + public abstract string P { get; } + public abstract int this[int index] { protected internal get; internal protected set; } + + [method: Obsolete] + [field: Obsolete] + [event: Obsolete] + public readonly event Event E; + + [event: Test] + public event Action E1 + { + [Obsolete] + add { value = value; } + [Obsolete] + [return: Obsolete] + remove + { + E += Handler; + E -= Handler; + } + } + + public static A operator +(A first, A second) + { + Delegate handler = new Delegate(Handler); + return first.Add(second); + } + + [method: Obsolete] + [return: Obsolete] + public static bool operator true(A a) + { + return true; + } + + public static bool operator false(A a) + { + return false; + } + + class C { } + } + + public struct S : I + { + public S() { } + + private int f1; + + [Obsolete("Use Script instead", error: false)] + private volatile int f2; + + public abstract int m(T t) + where T : struct + { + return 1; + } + + public string P + { + get + { + int value = 0; + return "A"; + } + set; + } + public abstract string P { get; } + + public abstract int this[int index] { get; internal protected set; } + public event Event E; + + public static A operator +(A first, A second) + { + return first.Add(second); + } + + fixed int field[10]; + + class C { } + } + + public interface I + { + void A(int value); + string Value { get; set; } + unsafe void UpdateSignatureByHashingContent([In] byte* buffer, int size); + } + + [type: Flags] + public enum E + { + A, + B = A, + C = 2 + A, +#if DEBUG + D, + } +#else + E, + } +#endif + + public delegate void Delegate(object P); + + namespace Test + { + using System; + using System.Collections; + + public class Список + { + public static IEnumerable Power(int number, int exponent) + { + Список Список = new Список(); + Список.Main(); + int counter = (0 + 0); + int אתר = 0; + while (++counter++ < --exponent--) + { + result = result * number + +number++++ + number; + yield return result; + } + } + + static void Main() + { + foreach (int i in Power(2, 8)) + { + Console.Write("{0} ", i); + } + } + + async void Wait() + { + await System.Threading.Tasks.Task.Delay(0); + } + + void AsyncAnonymous() // C # 5 feature + { + var task = Task.Factory.StartNew(async () => + { + return await new WebClient().DownloadStringTaskAsync("http://example.com"); + }); + } + } + } +} + +namespace ConsoleApplication1 +{ + namespace RecursiveGenericBaseType + { + class A : B, A> + where T : A + { + protected virtual A M() { } + + protected abstract B, A> N() { } + + static B, A> O() { } + } + + sealed class B : A> + { + protected override A M() { } + + protected sealed override B, A> N() { } + + new static A O() { } + } + } + + namespace Boo + { + public class Bar + where T : IComparable + { + public T f; + + public class Foo : IEnumerable + { + public void Method(K k, T t, U u) + where K : IList, IList, IList + where V : IList + { + A a; + M(A(5)); + } + } + } + } + + class Test + { + void Bar3() + { + var x = new Boo.Bar.Foo(); + x.Method(" ", 5, new object()); + + var q = from i in new int[] { 1, 2, 3, 4 } where i > 5 select i; + } + + public static implicit operator Test(string s) + { + return new ConsoleApplication1.Test(); + } + + public static explicit operator Test(string s = "") + { + return new Test(); + } + + public int foo = 5; + + void Bar2() + { + foo = 6; + this.Foo = 5.GetType(); + Test t = "sss"; + } + + public event EventHandler MyEvent = delegate { }; + + void Blah() + { + int i = 5; + int? j = 6; + + Expression> e = () => i; + Expression> e2 = b => + () => + { + return; + }; + Func f = async delegate(bool a) + { + return await !a; + }; + Func f2 = (a, b) => 0; + f2 = (int a, int b) => 1; + Action a = Blah; + f2 = () => { }; + f2 = () => + { + ; + }; + } + + delegate Recursive Recursive(Recursive r); + delegate Recursive Recursive(Recursive r); + + public Type Foo + { + [Obsolete("Name", error = false)] + get + { + var result = typeof(IEnumerable); + var t = typeof(int?) == typeof(Nullable); + t = typeof(IEnumerable); + return typeof(IEnumerable<>); + } + set + { + var t = typeof(System.Int32); + t.ToString(); + t = value; + } + } + + public void Constants() + { + int i = 1 + 2 + 3 + 5; + global::System.String s = "a" + (System.String)"a" + "a" + "a" + "a" + "A"; + } + + public void ConstructedType() + { + List i = null; + int c = i.Count; + } + } +} + +namespace Comments.XmlComments.UndocumentedKeywords +{ + /// + /// Whatever + /// + /// + /// // + /// /* */ + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + class /*///*/ + C + { + void M(T t, U u) + { + // comment + /* *** / */ + /* // + */ + /*s*/ + //comment + // /***/ + /*s*/int /*s*/ + intValue = 0; + intValue = + intValue /*s*/ + + 1; + string strValue = /*s*/ + "hello"; + /*s*/MyClass c = new MyClass(); + string verbatimStr = /*s*/ + @"\\\\"; + } + } + + //General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324) + class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /*Scen8*/ + { } + + class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22 /*Scen9*/ + { } + + class yield + { + void Foo(__arglist) + { + C c = null; + c.M(5, default(U)); + TypedReference tr = __makeref(c); + Type t = __reftype(tr); + int j = __refvalue(tr, int); + Params(a: t, b: t); + Params(ref c, out c); + } + + void Params(ref dynamic a, out dynamic b, params dynamic[] c) { } + + void Params(out dynamic a = 2, ref dynamic c = default(dynamic), params dynamic[][] c) { } + + public override string ToString() + { + return base.ToString(); + } + + public partial void OnError(); + + public partial void method() + { + int?[] a = new int?[5]; /*[] bug*/ // YES [] + int[] var = { 1, 2, 3, 4, 5 }; /*,;*/ + int i = a[i]; /*[]*/ + Foo f = new Foo(); /*<> ()*/ + f.method(); /*().*/ + i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ + bool b = true & false | true ^ false; /*& | ^*/ + b = !b; /*!*/ + i = ~i; /*~i*/ + b = i < i && i > i; /*< && >*/ + int? ii = 5; /*? bug*/ // NO ? + int f = true ? 1 : 0; /*? :*/ // YES : + i++; /*++*/ + i--; /*--*/ + b = true && false || true; /*&& ||*/ + i << 5; /*<<*/ + i >> 5; /*>>*/ + b = i == i && i != i && i <= i && i >= i; /*= == && != <= >=*/ + i += 5.0; /*+=*/ + i -= i; /*-=*/ + i *= i; /* *=*/ + i /= i; /*/=*/ + i %= i; /*%=*/ + i &= i; /*&=*/ + i |= i; /*|=*/ + i ^= i; /*^=*/ + i <<= i; /*<<=*/ + i >>= i; /*>>=*/ + object s = x => x + 1; /*=>*/ + double d = .3; + Point point; + unsafe + { + Point* p = &point; /* * &*/ + p->x = 10; /*->*/ + } + IO::BinaryReader br = null; + x[i: 1] = 3; + x[i: 1, j: 5] = "str"; + } + + struct Point + { + public int X; + public int Y; + + public void ThisAccess() + { + this = this; + } + } + } + + // From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6 + class CSharp6Features + { + // Initializers for auto-properties + public string First { get; set; } = "Jane"; + public string Last { get; set; } = "Doe"; + + // Getter-only auto-properties + public string Third { get; } = "Jane"; + public string Fourth { get; } = "Doe"; + + // Expression bodies on method-like members + public Point Move(int dx, int dy) => new Point(x + dx, y + dy); + + public static Complex operator +(Complex a, Complex b) => a.Add(b); + + public static implicit operator string(Person p) => p.First + " " + p.Last; + + public void Print() => Console.WriteLine(First + " " + Last); + + // Expression bodies on property-like function members + public string Name => First + " " + Last; + public int this[long id] => id; + + async void Test() + { + // Using static + WriteLine(Sqrt(3 * 3 + 4 * 4)); + WriteLine(Friday - Monday); + var range = Range(5, 17); // Ok: not extension + var even = range.Where(i => i % 2 == 0); // Ok + + // Null-conditional operators + int? length = customers?.Length; // null if customers is null + Customer first = customers?[0]; // null if customers is null + int length = customers?.Length ?? 0; // 0 if customers is null + int? first = customers?[0]?.Orders?.Count(); + PropertyChanged?.Invoke(this, args); + + // String interpolation + string s = $"{p.Name, 20} is {p.Age:D3} year{{s}} old #"; + s = $"{p.Name} is \"{p.Age} year{(p.Age == 1 ? "" : "s")} old"; + s = $"{(p.Age == 2 ? $"{new Person { }}" : "")}"; + s = + $@"\{p.Name} + ""\"; + s = $"Color [ R={func(b: 3):#0.##}, G={G:#0.##}, B={B:#0.##}, A={A:#0.##} ]"; + + // nameof expressions + if (x == null) + { + throw new ArgumentNullException(nameof(x)); + } + + WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode" + + // Index initializers + var numbers = new Dictionary + { + [7] = "seven", + [9] = "nine", + [13] = "thirteen" + }; + + // Exception filters + try { } + catch (MyException e) when (myfilter(e)) { } + + // Await in catch and finally blocks + Resource res = null; + try + { + res = await Resource.OpenAsync(); // You could do this. + } + catch (ResourceException e) + { + await Resource.LogAsync(res, e); // Now you can do this … + } + finally + { + if (res != null) + { + await res.CloseAsync(); // … and this. + } + } + } + } +} + +#line 6 +#line 2 "test.cs" +#line default +#line hidden + +class CSharp70 +{ + void PatternMatching(string arg, int b) + { + switch (arg) + { + case "A" when b > 50: + case "B" when b < 50: + default: + break; + } + + (A D, E H) = e; + + if (x?.y?.z is Type value2) + { + // code using value + } + + if (expr is Type v) + { + Hello(); + } + } + + public static async Task LocalFunctions(string[] args) + { + string Hello2(int i) + { + return args[i]; + } + + async Task Hello(T i) => await Task.FromResult(args[i]); + await Hello(1); + } + + public static void OutVar(string[] args) + { + int.TryParse(Hello(1), out var item); + int.TryParse(Hello(1), out int item); + } + + public void ThrowExpression() + { + var result = nullableResult ?? throw new NullReferenceException(); + } + + public void BinaryLiterals() + { + int nineteen = 0b10011; + } + + public void DigitSeparators() + { + int bin = 0b1001_1010_0001_0100; + int hex = 0x1b_a0_44_fe; + int dec = 33_554_432; + int weird = 1_2__3___4____5_____6______7_______8________9; + double real = 1_000.111_1e-1_000; + } +} + +class CSharp71 +{ + void DefaultWithoutTypeName(string content = default) + { + DefaultWithoutTypeName(default); + } + + void TupleRecognize(int a, (int, int) b, (int, int, int)? c) + { + var result = list.Select(c => (c.f1, f3: c.f2)).Where(t => t.f2 == 1); + } +} + +class CSharp72 +{ + readonly struct ReadonlyRef1 + { + Func s = (in int x) => x; + ref TValue this[in TKey index] => null; + + public static Vector3 operator +(in Vector3 x, in Vector3 y) => null; + + static readonly ref Vector3 M1_Trace() + { + // OK + ref readonly var r1 = ref M1(); + + // Not valid. Need an LValue + ref readonly Vector3 r2 = ref default(Vector3); + + // Not valid. r1 is readonly. + Mutate(ref r1); + + // OK. + Print(in r1); + + // OK. + return ref r1; + } + } + + ref struct ReadonlyRef2 + { + ref readonly Guid Test(in Vector3 v1, in Vector3 v2) + { + // not OK!! + v1 = default(Vector3); + + // not OK!! + v1.X = 0; + + // not OK!! + foo(ref v1.X); + + return ref (arr != null ? ref arr[0] : ref otherArr[0]); + + Span span = stackalloc int[1]; + + // OK + return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); + } + + ref T Choice(bool condition, ref T consequence, ref T alternative) + { + if (condition) + { + return ref consequence; + } + else + { + return ref alternative; + } + } + } + + public void DoSomething(bool isEmployed, string personName, int personAge) { } + + public void NonTrailingNamedArguments() + { + DoSomething(isEmployed: true, name, age); // currently CS1738, but would become legal + DoSomething(true, personName: name, age); // currently CS1738, but would become legal + DoSomething(name, isEmployed: true, age); // remains illegal + DoSomething(name, age, isEmployed: true); // remains illegal + DoSomething(true, personAge: age, personName: name); // already legal + } + + public void ConditionalRef() + { + ref var r = ref (arr != null ? ref arr[0] : ref otherArr[0]); + } + + public void LeadingSeparator() + { + var res = + 0 + + 123 // permitted in C# 1.0 and later + + 1_2_3 // permitted in C# 7.0 and later + + 0x1_2_3 // permitted in C# 7.0 and later + + 0b101 // binary literals added in C# 7.0 + + 0b1_0_1 // permitted in C# 7.0 and later + // in C# 7.2, _ is permitted after the `0x` or `0b` + + 0x_1_2 // permitted in C# 7.2 and later + + 0b_1_0_1 // permitted in C# 7.2 and later + ; + } +} + +class CSharp73 +{ + void Blittable(T value) + where T : unmanaged + { + var unmanaged = 666; + } + + unsafe struct IndexingMovableFixed + { + public fixed int myFixedField[10]; + } + + static IndexingMovableFixed s; + + public unsafe void IndexingMovableFixedFields() + { + int* ptr = s.myFixedField; + int t = s.myFixedField[5]; + } + + public void PatternBasedFixed() + { + fixed (byte* ptr = byteArray) + { + // ptr is a native pointer to the first element of the array + // byteArray is protected from being moved/collected by the GC for the duration of this block + } + } + + public void StackallocArrayInitializer() + { + Span a = stackalloc int[3]; // currently allowed + Span a = stackalloc int[3] { 1, 2, 3 }; + Span a = stackalloc int[] { 1, 2, 3 }; + Span a = stackalloc[] { 1, 2, 3 }; + } + + public void TupleEquality() + { + (int, (int, int)) t1, + t2; + var res = t1 == (1, (2, 3)); + } +} + +namespace CSharp80 +{ + class CSharp80ExceptInterfaceDefaultImplement + { + void ReferenceNullable() + { + var? x = E; + x!.ToString(); + string? wtf = null; + int?[]? hello; + } + + void Patterns() + { + if (o is string { Length: 5 } s) + { + Do(); + } + + return lang.CountOfTokens switch + { + 1 => 100, + 2 => 200, + _ => throw new global::System.Exception() + }; + + var newState = (GetState(), action, hasKey) switch + { + (DoorState.Closed, Action.Open, _) => DoorState.Opened, + (DoorState.Opened, Action.Close, _) => DoorState.Closed, + (DoorState.Closed, Action.Lock, true) => DoorState.Locked, + (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, + (var state, _, _) => state + }; + } + + async Task AsyncStreams() + { + await foreach (var item in asyncEnumerables) { } + } + + void Ranges() + { + var thirdItem = list[2]; // list[2] + var lastItem = list[^1]; // list[Index.CreateFromEnd(1)] + var multiDimensional = list[3, ^2]; // list[3, Index.CreateFromEnd(2)] + + var slice1 = list[2..^3]; // list[Range.Create(2, Index.CreateFromEnd(3))] + var slice2 = list[..^3]; // list[Range.ToEnd(Index.CreateFromEnd(3))] + var slice3 = list[2..]; // list[Range.FromStart(2)] + var slice4 = list[..]; // list[Range.All] + var multiDimensional = list[1..2, ..]; // list[Range.Create(1, 2), Range.All] + } + + void UsingDeclarators() + { + using var item = new FileStream("./.f"); + fixed (char* ch = "hell") + ; + item.Dispose(); + } + + void StaticLocalFunction() + { + static unsafe void Func1() { } + static unsafe void Func1() { } + async static void Func2() { } + static async void Func2() { } + } + + void NullCoalescingAssignment() + { + var item = a ??= b ??= c ??= d ??= throw new Exception(); + } + + public readonly float Hello() + { + return 0.1f; + } + } + + interface IA + { + void M() + { + WriteLine("IA.M"); + } + } + + interface IA + { + void M() + { + WriteLine("IA.M"); + } + } + + interface IB : IA + { + override void IA.M() // explicitly named + { + WriteLine("IB.M"); + } + } + + interface IC : IA + { + override void M() // implicitly named + { + WriteLine("IC.M"); + } + } +} diff --git a/Src/CSharpier.Tests/Samples/Scratch.actual.cst b/Src/CSharpier.Tests/Samples/Scratch.actual.cst new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/Src/CSharpier.Tests/Samples/Scratch.actual.cst @@ -0,0 +1 @@ + \ No newline at end of file From b1fdc0f373332829bd4460f7361099ed9581d681 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 11:23:12 -0500 Subject: [PATCH 05/21] Some cleanup --- .../Samples/AllInOne.actual.cst | 1202 ----------------- .../Samples/{AllInOne.cst => AllInOne.test} | 0 Src/CSharpier.Tests/Samples/Samples.cs | 4 +- .../Samples/Scratch.actual.cst | 1 - Src/CSharpier.Tests/Samples/Scratch.test | 0 Src/CSharpier/CodeFormatterResult.cs | 2 +- Src/CSharpier/IFormatter.cs | 2 +- 7 files changed, 4 insertions(+), 1207 deletions(-) delete mode 100644 Src/CSharpier.Tests/Samples/AllInOne.actual.cst rename Src/CSharpier.Tests/Samples/{AllInOne.cst => AllInOne.test} (100%) delete mode 100644 Src/CSharpier.Tests/Samples/Scratch.actual.cst create mode 100644 Src/CSharpier.Tests/Samples/Scratch.test diff --git a/Src/CSharpier.Tests/Samples/AllInOne.actual.cst b/Src/CSharpier.Tests/Samples/AllInOne.actual.cst deleted file mode 100644 index 130d9ca01..000000000 --- a/Src/CSharpier.Tests/Samples/AllInOne.actual.cst +++ /dev/null @@ -1,1202 +0,0 @@ -#error Error message -#warning Warning message -#pragma warning disable 414, 3021 -#pragma warning restore 3021 -#pragma checksum "file.txt" "{00000000-0000-0000-0000-000000000000}" "2453" -#define foo // Comment in directive -#if foo -#else -#endif -#undef foo - -extern alias Foo; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using M = System.Math; - -#if DEBUG || TRACE -using System.Diagnostics; -#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false -using System.Diagnostics; -#else -using System.Diagnostics; -#endif - -#region Region - -#region more -using ConsoleApplication2.Test; -#endregion -using X = int1; -using Y = ABC.X; - -using static System.Math; -using static System.DayOfWeek; -using static System.Linq.Enumerable; - -#endregion - -[assembly: System.Copyright( - @"(C)"" - -2009" -)] -[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] - -class TopLevelType : IDisposable -{ - void IDisposable.Dispose() { } -} - -namespace My -{ - using A.B; - - interface CoContra { } - - delegate void CoContra2<[System.Obsolete()] out T, in K>() - where T : struct; - - public unsafe partial class A : C, I - { - [DllImport("kernel32", SetLastError = true)] - static extern bool CreateDirectory(string name, SecurityAttribute sa); - - private const int global = int.MinValue - 1; - - static A() { } - - public A(int foo) - { - L: - { - int i = sizeof(int); - ++i; - var s1 = $"x {1, -2:d}"; - var s2 = $@"x {1, -2:d}"; - } - -#if DEBUG - Console.WriteLine(export.iefSupplied.command); -#endif - const int? local = int.MaxValue; - const Guid? local0 = new Guid(r.ToString()); - - var привет = local; - var мир = local; - var local3 = 0, - local4 = 1; - local3 = local4 = 1; - var local5 = null as Action ?? null; - var local6 = local5 is Action; - - var u = 1u; - var U = 1U; - long hex = 0xBADC0DE, - Hex = 0XDEADBEEF, - l = -1L, - L = 1L, - l2 = 2l; - ulong ul = 1ul, - Ul = 1Ul, - uL = 1uL, - UL = 1UL, - lu = 1lu, - Lu = 1Lu, - lU = 1lU, - LU = 1LU; - int minInt32Value = -2147483648; - int minInt64Value = -9223372036854775808L; - - bool @bool; - byte @byte; - char @char = 'c', - \u0066 = '\u0066', - hexchar = '\x0130', - hexchar2 = (char)0xBAD; - string \U00000065 = "\U00000065"; - decimal @decimal = 1.44M; - @decimal = 1.2m; - dynamic @dynamic; - double @double = M.PI; - @double = 1d; - @double = 1D; - @double = -1.2e3; - float @float = 1.2f; - @float = 1.44F; - int @int = local ?? -1; - long @long; - object @object; - sbyte @sbyte; - short @short; - string @string = @"""/*"; - uint @uint; - ulong @ulong; - ushort @ushort; - - dynamic dynamic = local5; - var add = 0; - var alias = 0; - var arglist = 0; - var ascending = 0; - var async = 0; - var await = 0; - var by = 0; - var descending = 0; - var dynamic = 0; - var equals = 0; - var from = 0; - var get = 0; - var group = 0; - var into = 0; - var join = 0; - var let = 0; - var nameof = 0; - var on = 0; - var orderby = 0; - var partial = 0; - var remove = 0; - var select = 0; - var set = 0; - var when = 0; - var where = 0; - var yield = 0; - var __ = 0; - where = yield = 0; - - if (i > 0) - { - return; - } - else if (i == 0) - { - throw new Exception(); - } - var o1 = new MyObject(); - var o2 = new MyObject(var); - var o3 = new MyObject { A = i }; - var o4 = new MyObject(@dynamic) - { - A = 0, - B = 0, - C = 0 - }; - var o5 = new { A = 0 }; - var dictionaryInitializer = new Dictionary { { 1, "" }, { 2, "a" } }; - float[] a = new float[] { 0f, 1.1f }; - int[,,] cube = - { - { - { 111, 112 }, - { 121, 122 } - }, - { - { 211, 212 }, - { 221, 222 } - } - }; - - int[][] jagged = - { - { 111 }, - { 121, 122 } - }; - int[][,] arr = new int[5][,]; // as opposed to new int[][5,5] - arr[0] = new int[5, 5]; // as opposed to arr[0,0] = new int[5]; - arr[0][0, 0] = 47; - int[] arrayTypeInference = new[] { 0, 1 }; - switch (3) { } - switch (i) - { - case 0: - case 1: - { - goto case 2; - } - case 2 + 3: - { - goto default; - break; - } - default: - { - return; - } - } - while (i < 10) - { - ++i; - if (true) - { - continue; - } - break; - } - do - { - ++i; - if (true) - { - continue; - } - break; - } while (i < 10); - for (int j = 0; j < 100; ++j) - { - for (; ; ) - { - for (int i = 0, j = 0; i < length; i++, j++) { } - if (true) - { - continue; - } - break; - } - } - label: - goto label; - label2: - ; - foreach (var i in Items()) - { - if (i == 7) - { - return; - } - else - { - continue; - } - } - checked - { - checked(++i); - } - unchecked - { - unchecked(++i); - } - lock (sync) - process(); - using (var v = BeginScope()) - using (A a = new A()) - using ( - A a = new A(), - b = new A() - ) - using (BeginScope()) - return; - yield return this.items[3]; - yield break; - fixed ( - int* p = stackalloc int[100], - q = &y - ) - { - *intref = 1; - } - fixed (int* p = stackalloc int[100]) - { - *intref = 1; - } - unsafe - { - int* p = null; - } - try - { - throw null; - } - catch (System.AccessViolationException av) - { - throw av; - } - catch (Exception) - { - throw; - } - finally - { - try { } - catch { } - } - var anonymous = { A = 1, B = 2, C = 3 }; - var query = - from c in customers - let d = c - where d != null - join c1 in customers on c1.GetHashCode() equals c.GetHashCode() - join c1 in customers on c1.GetHashCode() equals c.GetHashCode() into e - group c by c.Country into g - orderby g.Count() ascending - orderby g.Key descending - select new { Country = g.Key, CustCount = g.Count() }; - query = from c in customers select c into d select d; - } - - ~A() { } - - private readonly int f1; - - [Obsolete] - [NonExisting] - [Foo::NonExisting(var, 5)] - [CLSCompliant(false)] - [Obsolete, System.NonSerialized, NonSerialized, CLSCompliant(true || false & true)] - private volatile int f2; - - [return: Obsolete] - [method: Obsolete] - public void Handler(object value) { } - - public int m(T t) - where T : class, new() - { - base.m(t); - return 1; - } - - public string P - { - get { return "A"; } - set; - } - public abstract string P { get; } - public abstract int this[int index] { protected internal get; internal protected set; } - - [method: Obsolete] - [field: Obsolete] - [event: Obsolete] - public readonly event Event E; - - [event: Test] - public event Action E1 - { - [Obsolete] - add { value = value; } - [Obsolete] - [return: Obsolete] - remove - { - E += Handler; - E -= Handler; - } - } - - public static A operator +(A first, A second) - { - Delegate handler = new Delegate(Handler); - return first.Add(second); - } - - [method: Obsolete] - [return: Obsolete] - public static bool operator true(A a) - { - return true; - } - - public static bool operator false(A a) - { - return false; - } - - class C { } - } - - public struct S : I - { - public S() { } - - private int f1; - - [Obsolete("Use Script instead", error: false)] - private volatile int f2; - - public abstract int m(T t) - where T : struct - { - return 1; - } - - public string P - { - get - { - int value = 0; - return "A"; - } - set; - } - public abstract string P { get; } - - public abstract int this[int index] { get; internal protected set; } - public event Event E; - - public static A operator +(A first, A second) - { - return first.Add(second); - } - - fixed int field[10]; - - class C { } - } - - public interface I - { - void A(int value); - string Value { get; set; } - unsafe void UpdateSignatureByHashingContent([In] byte* buffer, int size); - } - - [type: Flags] - public enum E - { - A, - B = A, - C = 2 + A, -#if DEBUG - D, - } -#else - E, - } -#endif - - public delegate void Delegate(object P); - - namespace Test - { - using System; - using System.Collections; - - public class Список - { - public static IEnumerable Power(int number, int exponent) - { - Список Список = new Список(); - Список.Main(); - int counter = (0 + 0); - int אתר = 0; - while (++counter++ < --exponent--) - { - result = result * number + +number++++ + number; - yield return result; - } - } - - static void Main() - { - foreach (int i in Power(2, 8)) - { - Console.Write("{0} ", i); - } - } - - async void Wait() - { - await System.Threading.Tasks.Task.Delay(0); - } - - void AsyncAnonymous() // C # 5 feature - { - var task = Task.Factory.StartNew(async () => - { - return await new WebClient().DownloadStringTaskAsync("http://example.com"); - }); - } - } - } -} - -namespace ConsoleApplication1 -{ - namespace RecursiveGenericBaseType - { - class A : B, A> - where T : A - { - protected virtual A M() { } - - protected abstract B, A> N() { } - - static B, A> O() { } - } - - sealed class B : A> - { - protected override A M() { } - - protected sealed override B, A> N() { } - - new static A O() { } - } - } - - namespace Boo - { - public class Bar - where T : IComparable - { - public T f; - - public class Foo : IEnumerable - { - public void Method(K k, T t, U u) - where K : IList, IList, IList - where V : IList - { - A a; - M(A(5)); - } - } - } - } - - class Test - { - void Bar3() - { - var x = new Boo.Bar.Foo(); - x.Method(" ", 5, new object()); - - var q = from i in new int[] { 1, 2, 3, 4 } where i > 5 select i; - } - - public static implicit operator Test(string s) - { - return new ConsoleApplication1.Test(); - } - - public static explicit operator Test(string s = "") - { - return new Test(); - } - - public int foo = 5; - - void Bar2() - { - foo = 6; - this.Foo = 5.GetType(); - Test t = "sss"; - } - - public event EventHandler MyEvent = delegate { }; - - void Blah() - { - int i = 5; - int? j = 6; - - Expression> e = () => i; - Expression> e2 = b => - () => - { - return; - }; - Func f = async delegate(bool a) - { - return await !a; - }; - Func f2 = (a, b) => 0; - f2 = (int a, int b) => 1; - Action a = Blah; - f2 = () => { }; - f2 = () => - { - ; - }; - } - - delegate Recursive Recursive(Recursive r); - delegate Recursive Recursive(Recursive r); - - public Type Foo - { - [Obsolete("Name", error = false)] - get - { - var result = typeof(IEnumerable); - var t = typeof(int?) == typeof(Nullable); - t = typeof(IEnumerable); - return typeof(IEnumerable<>); - } - set - { - var t = typeof(System.Int32); - t.ToString(); - t = value; - } - } - - public void Constants() - { - int i = 1 + 2 + 3 + 5; - global::System.String s = "a" + (System.String)"a" + "a" + "a" + "a" + "A"; - } - - public void ConstructedType() - { - List i = null; - int c = i.Count; - } - } -} - -namespace Comments.XmlComments.UndocumentedKeywords -{ - /// - /// Whatever - /// - /// - /// // - /// /* */ - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - class /*///*/ - C - { - void M(T t, U u) - { - // comment - /* *** / */ - /* // - */ - /*s*/ - //comment - // /***/ - /*s*/int /*s*/ - intValue = 0; - intValue = - intValue /*s*/ - + 1; - string strValue = /*s*/ - "hello"; - /*s*/MyClass c = new MyClass(); - string verbatimStr = /*s*/ - @"\\\\"; - } - } - - //General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324) - class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /*Scen8*/ - { } - - class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22 /*Scen9*/ - { } - - class yield - { - void Foo(__arglist) - { - C c = null; - c.M(5, default(U)); - TypedReference tr = __makeref(c); - Type t = __reftype(tr); - int j = __refvalue(tr, int); - Params(a: t, b: t); - Params(ref c, out c); - } - - void Params(ref dynamic a, out dynamic b, params dynamic[] c) { } - - void Params(out dynamic a = 2, ref dynamic c = default(dynamic), params dynamic[][] c) { } - - public override string ToString() - { - return base.ToString(); - } - - public partial void OnError(); - - public partial void method() - { - int?[] a = new int?[5]; /*[] bug*/ // YES [] - int[] var = { 1, 2, 3, 4, 5 }; /*,;*/ - int i = a[i]; /*[]*/ - Foo f = new Foo(); /*<> ()*/ - f.method(); /*().*/ - i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ - bool b = true & false | true ^ false; /*& | ^*/ - b = !b; /*!*/ - i = ~i; /*~i*/ - b = i < i && i > i; /*< && >*/ - int? ii = 5; /*? bug*/ // NO ? - int f = true ? 1 : 0; /*? :*/ // YES : - i++; /*++*/ - i--; /*--*/ - b = true && false || true; /*&& ||*/ - i << 5; /*<<*/ - i >> 5; /*>>*/ - b = i == i && i != i && i <= i && i >= i; /*= == && != <= >=*/ - i += 5.0; /*+=*/ - i -= i; /*-=*/ - i *= i; /* *=*/ - i /= i; /*/=*/ - i %= i; /*%=*/ - i &= i; /*&=*/ - i |= i; /*|=*/ - i ^= i; /*^=*/ - i <<= i; /*<<=*/ - i >>= i; /*>>=*/ - object s = x => x + 1; /*=>*/ - double d = .3; - Point point; - unsafe - { - Point* p = &point; /* * &*/ - p->x = 10; /*->*/ - } - IO::BinaryReader br = null; - x[i: 1] = 3; - x[i: 1, j: 5] = "str"; - } - - struct Point - { - public int X; - public int Y; - - public void ThisAccess() - { - this = this; - } - } - } - - // From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6 - class CSharp6Features - { - // Initializers for auto-properties - public string First { get; set; } = "Jane"; - public string Last { get; set; } = "Doe"; - - // Getter-only auto-properties - public string Third { get; } = "Jane"; - public string Fourth { get; } = "Doe"; - - // Expression bodies on method-like members - public Point Move(int dx, int dy) => new Point(x + dx, y + dy); - - public static Complex operator +(Complex a, Complex b) => a.Add(b); - - public static implicit operator string(Person p) => p.First + " " + p.Last; - - public void Print() => Console.WriteLine(First + " " + Last); - - // Expression bodies on property-like function members - public string Name => First + " " + Last; - public int this[long id] => id; - - async void Test() - { - // Using static - WriteLine(Sqrt(3 * 3 + 4 * 4)); - WriteLine(Friday - Monday); - var range = Range(5, 17); // Ok: not extension - var even = range.Where(i => i % 2 == 0); // Ok - - // Null-conditional operators - int? length = customers?.Length; // null if customers is null - Customer first = customers?[0]; // null if customers is null - int length = customers?.Length ?? 0; // 0 if customers is null - int? first = customers?[0]?.Orders?.Count(); - PropertyChanged?.Invoke(this, args); - - // String interpolation - string s = $"{p.Name, 20} is {p.Age:D3} year{{s}} old #"; - s = $"{p.Name} is \"{p.Age} year{(p.Age == 1 ? "" : "s")} old"; - s = $"{(p.Age == 2 ? $"{new Person { }}" : "")}"; - s = - $@"\{p.Name} - ""\"; - s = $"Color [ R={func(b: 3):#0.##}, G={G:#0.##}, B={B:#0.##}, A={A:#0.##} ]"; - - // nameof expressions - if (x == null) - { - throw new ArgumentNullException(nameof(x)); - } - - WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode" - - // Index initializers - var numbers = new Dictionary - { - [7] = "seven", - [9] = "nine", - [13] = "thirteen" - }; - - // Exception filters - try { } - catch (MyException e) when (myfilter(e)) { } - - // Await in catch and finally blocks - Resource res = null; - try - { - res = await Resource.OpenAsync(); // You could do this. - } - catch (ResourceException e) - { - await Resource.LogAsync(res, e); // Now you can do this … - } - finally - { - if (res != null) - { - await res.CloseAsync(); // … and this. - } - } - } - } -} - -#line 6 -#line 2 "test.cs" -#line default -#line hidden - -class CSharp70 -{ - void PatternMatching(string arg, int b) - { - switch (arg) - { - case "A" when b > 50: - case "B" when b < 50: - default: - break; - } - - (A D, E H) = e; - - if (x?.y?.z is Type value2) - { - // code using value - } - - if (expr is Type v) - { - Hello(); - } - } - - public static async Task LocalFunctions(string[] args) - { - string Hello2(int i) - { - return args[i]; - } - - async Task Hello(T i) => await Task.FromResult(args[i]); - await Hello(1); - } - - public static void OutVar(string[] args) - { - int.TryParse(Hello(1), out var item); - int.TryParse(Hello(1), out int item); - } - - public void ThrowExpression() - { - var result = nullableResult ?? throw new NullReferenceException(); - } - - public void BinaryLiterals() - { - int nineteen = 0b10011; - } - - public void DigitSeparators() - { - int bin = 0b1001_1010_0001_0100; - int hex = 0x1b_a0_44_fe; - int dec = 33_554_432; - int weird = 1_2__3___4____5_____6______7_______8________9; - double real = 1_000.111_1e-1_000; - } -} - -class CSharp71 -{ - void DefaultWithoutTypeName(string content = default) - { - DefaultWithoutTypeName(default); - } - - void TupleRecognize(int a, (int, int) b, (int, int, int)? c) - { - var result = list.Select(c => (c.f1, f3: c.f2)).Where(t => t.f2 == 1); - } -} - -class CSharp72 -{ - readonly struct ReadonlyRef1 - { - Func s = (in int x) => x; - ref TValue this[in TKey index] => null; - - public static Vector3 operator +(in Vector3 x, in Vector3 y) => null; - - static readonly ref Vector3 M1_Trace() - { - // OK - ref readonly var r1 = ref M1(); - - // Not valid. Need an LValue - ref readonly Vector3 r2 = ref default(Vector3); - - // Not valid. r1 is readonly. - Mutate(ref r1); - - // OK. - Print(in r1); - - // OK. - return ref r1; - } - } - - ref struct ReadonlyRef2 - { - ref readonly Guid Test(in Vector3 v1, in Vector3 v2) - { - // not OK!! - v1 = default(Vector3); - - // not OK!! - v1.X = 0; - - // not OK!! - foo(ref v1.X); - - return ref (arr != null ? ref arr[0] : ref otherArr[0]); - - Span span = stackalloc int[1]; - - // OK - return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); - } - - ref T Choice(bool condition, ref T consequence, ref T alternative) - { - if (condition) - { - return ref consequence; - } - else - { - return ref alternative; - } - } - } - - public void DoSomething(bool isEmployed, string personName, int personAge) { } - - public void NonTrailingNamedArguments() - { - DoSomething(isEmployed: true, name, age); // currently CS1738, but would become legal - DoSomething(true, personName: name, age); // currently CS1738, but would become legal - DoSomething(name, isEmployed: true, age); // remains illegal - DoSomething(name, age, isEmployed: true); // remains illegal - DoSomething(true, personAge: age, personName: name); // already legal - } - - public void ConditionalRef() - { - ref var r = ref (arr != null ? ref arr[0] : ref otherArr[0]); - } - - public void LeadingSeparator() - { - var res = - 0 - + 123 // permitted in C# 1.0 and later - + 1_2_3 // permitted in C# 7.0 and later - + 0x1_2_3 // permitted in C# 7.0 and later - + 0b101 // binary literals added in C# 7.0 - + 0b1_0_1 // permitted in C# 7.0 and later - // in C# 7.2, _ is permitted after the `0x` or `0b` - + 0x_1_2 // permitted in C# 7.2 and later - + 0b_1_0_1 // permitted in C# 7.2 and later - ; - } -} - -class CSharp73 -{ - void Blittable(T value) - where T : unmanaged - { - var unmanaged = 666; - } - - unsafe struct IndexingMovableFixed - { - public fixed int myFixedField[10]; - } - - static IndexingMovableFixed s; - - public unsafe void IndexingMovableFixedFields() - { - int* ptr = s.myFixedField; - int t = s.myFixedField[5]; - } - - public void PatternBasedFixed() - { - fixed (byte* ptr = byteArray) - { - // ptr is a native pointer to the first element of the array - // byteArray is protected from being moved/collected by the GC for the duration of this block - } - } - - public void StackallocArrayInitializer() - { - Span a = stackalloc int[3]; // currently allowed - Span a = stackalloc int[3] { 1, 2, 3 }; - Span a = stackalloc int[] { 1, 2, 3 }; - Span a = stackalloc[] { 1, 2, 3 }; - } - - public void TupleEquality() - { - (int, (int, int)) t1, - t2; - var res = t1 == (1, (2, 3)); - } -} - -namespace CSharp80 -{ - class CSharp80ExceptInterfaceDefaultImplement - { - void ReferenceNullable() - { - var? x = E; - x!.ToString(); - string? wtf = null; - int?[]? hello; - } - - void Patterns() - { - if (o is string { Length: 5 } s) - { - Do(); - } - - return lang.CountOfTokens switch - { - 1 => 100, - 2 => 200, - _ => throw new global::System.Exception() - }; - - var newState = (GetState(), action, hasKey) switch - { - (DoorState.Closed, Action.Open, _) => DoorState.Opened, - (DoorState.Opened, Action.Close, _) => DoorState.Closed, - (DoorState.Closed, Action.Lock, true) => DoorState.Locked, - (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, - (var state, _, _) => state - }; - } - - async Task AsyncStreams() - { - await foreach (var item in asyncEnumerables) { } - } - - void Ranges() - { - var thirdItem = list[2]; // list[2] - var lastItem = list[^1]; // list[Index.CreateFromEnd(1)] - var multiDimensional = list[3, ^2]; // list[3, Index.CreateFromEnd(2)] - - var slice1 = list[2..^3]; // list[Range.Create(2, Index.CreateFromEnd(3))] - var slice2 = list[..^3]; // list[Range.ToEnd(Index.CreateFromEnd(3))] - var slice3 = list[2..]; // list[Range.FromStart(2)] - var slice4 = list[..]; // list[Range.All] - var multiDimensional = list[1..2, ..]; // list[Range.Create(1, 2), Range.All] - } - - void UsingDeclarators() - { - using var item = new FileStream("./.f"); - fixed (char* ch = "hell") - ; - item.Dispose(); - } - - void StaticLocalFunction() - { - static unsafe void Func1() { } - static unsafe void Func1() { } - async static void Func2() { } - static async void Func2() { } - } - - void NullCoalescingAssignment() - { - var item = a ??= b ??= c ??= d ??= throw new Exception(); - } - - public readonly float Hello() - { - return 0.1f; - } - } - - interface IA - { - void M() - { - WriteLine("IA.M"); - } - } - - interface IA - { - void M() - { - WriteLine("IA.M"); - } - } - - interface IB : IA - { - override void IA.M() // explicitly named - { - WriteLine("IB.M"); - } - } - - interface IC : IA - { - override void M() // implicitly named - { - WriteLine("IC.M"); - } - } -} diff --git a/Src/CSharpier.Tests/Samples/AllInOne.cst b/Src/CSharpier.Tests/Samples/AllInOne.test similarity index 100% rename from Src/CSharpier.Tests/Samples/AllInOne.cst rename to Src/CSharpier.Tests/Samples/AllInOne.test diff --git a/Src/CSharpier.Tests/Samples/Samples.cs b/Src/CSharpier.Tests/Samples/Samples.cs index 3a425d5ec..8afa72f29 100644 --- a/Src/CSharpier.Tests/Samples/Samples.cs +++ b/Src/CSharpier.Tests/Samples/Samples.cs @@ -24,7 +24,7 @@ public static async Task RunTest(string fileName) { var directory = DirectoryFinder.FindParent("CSharpier.Tests"); - var file = Path.Combine(directory.FullName, $"Samples/{fileName}.cst"); + var file = Path.Combine(directory.FullName, $"Samples/{fileName}.test"); if (!File.Exists(file)) { await File.WriteAllTextAsync(file, ""); @@ -42,7 +42,7 @@ public static async Task RunTest(string fileName) compareResult.Should().BeEmpty(); await File.WriteAllTextAsync( - file.Replace(".cst", ".actual.cst"), + file.Replace(".cst", ".actual.test"), result.Code, Encoding.UTF8 ); diff --git a/Src/CSharpier.Tests/Samples/Scratch.actual.cst b/Src/CSharpier.Tests/Samples/Scratch.actual.cst deleted file mode 100644 index 5f282702b..000000000 --- a/Src/CSharpier.Tests/Samples/Scratch.actual.cst +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Src/CSharpier.Tests/Samples/Scratch.test b/Src/CSharpier.Tests/Samples/Scratch.test new file mode 100644 index 000000000..e69de29bb diff --git a/Src/CSharpier/CodeFormatterResult.cs b/Src/CSharpier/CodeFormatterResult.cs index 66eaa6749..2d11c1432 100644 --- a/Src/CSharpier/CodeFormatterResult.cs +++ b/Src/CSharpier/CodeFormatterResult.cs @@ -13,4 +13,4 @@ internal CodeFormatterResult() { } internal string FailureMessage { get; init; } = string.Empty; internal static readonly CodeFormatterResult Null = new(); -} \ No newline at end of file +} diff --git a/Src/CSharpier/IFormatter.cs b/Src/CSharpier/IFormatter.cs index 96f8bb59c..5b0e4fa7d 100644 --- a/Src/CSharpier/IFormatter.cs +++ b/Src/CSharpier/IFormatter.cs @@ -7,4 +7,4 @@ Task FormatAsync( PrinterOptions printerOptions, CancellationToken cancellationToken ); -} \ No newline at end of file +} From 756b51f56aee916e6f78bef099d9c19781bdeab9 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 12:05:27 -0500 Subject: [PATCH 06/21] Working on getting the generators happy with multiple directories --- Directory.Build.props | 2 +- .../CSharpier.Generators.csproj | 12 +- .../NodePrinterGenerator.cs | 51 +- .../TemplatedGenerator.cs | 55 - .../CSharpier.Tests.Generators.csproj | 11 +- .../FormattingTestsGenerator.cs | 73 +- .../FormattingTestsGenerator.sbntxt | 2 +- Src/CSharpier.Tests/CSharpier.Tests.csproj | 3 - .../FormattingTests/BaseTest.cs | 4 +- .../TestFiles/csproj/BasicProject.test | 9 + Src/CSharpier.Tests/Samples/AllInOne.test | 25096 +++++++++++++++- Src/CSharpier.Tests/Samples/Scratch.test | 1 + Src/CSharpier/CSharpFormatter.cs | 11 +- Src/CSharpier/CodeFormatter.cs | 26 +- Src/CSharpier/IFormatter.cs | 10 - Src/CSharpier/XmlFormatter.cs | 6 +- 16 files changed, 24115 insertions(+), 1257 deletions(-) delete mode 100644 Src/CSharpier.Generators/TemplatedGenerator.cs create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test delete mode 100644 Src/CSharpier/IFormatter.cs diff --git a/Directory.Build.props b/Directory.Build.props index e02a13fa0..74c50d587 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ enable enable - CS8032 + CS8032;CS8033 true diff --git a/Src/CSharpier.Generators/CSharpier.Generators.csproj b/Src/CSharpier.Generators/CSharpier.Generators.csproj index b03dbd518..c45501356 100644 --- a/Src/CSharpier.Generators/CSharpier.Generators.csproj +++ b/Src/CSharpier.Generators/CSharpier.Generators.csproj @@ -7,13 +7,13 @@ SYSLIB0013 - - - - - + + + + + - + diff --git a/Src/CSharpier.Generators/NodePrinterGenerator.cs b/Src/CSharpier.Generators/NodePrinterGenerator.cs index 92d40330a..097ecd22a 100644 --- a/Src/CSharpier.Generators/NodePrinterGenerator.cs +++ b/Src/CSharpier.Generators/NodePrinterGenerator.cs @@ -1,16 +1,53 @@ -using System.IO; -using System.Linq; -using Generators; -using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis; namespace CSharpier.Generators; +using System.Text; +using Microsoft.CodeAnalysis.Text; +using Scriban; + [Generator] -public class NodePrinterGenerator : TemplatedGenerator +public class NodePrinterGenerator : ISourceGenerator { - protected override string SourceName => "Node"; + public void Initialize(GeneratorInitializationContext context) { } + + public void Execute(GeneratorExecutionContext context) + { + var template = Template.Parse(this.GetContent(this.GetType().Name + ".sbntxt")); + var renderedSource = template.Render(this.GetModel(context), member => member.Name); + + var sourceText = SourceText.From(renderedSource, Encoding.UTF8); + + context.AddSource("Node", sourceText); + } + + public string GetContent(string relativePath) + { + var assembly = this.GetType().Assembly; + var baseName = assembly.GetName().Name; + var resourceName = relativePath + .TrimStart('.') + .Replace(Path.DirectorySeparatorChar, '.') + .Replace(Path.AltDirectorySeparatorChar, '.'); + + var name = baseName + "." + resourceName; + using var stream = assembly.GetManifestResourceStream(name); + + if (stream == null) + { + var list = assembly.GetManifestResourceNames(); + + throw new Exception( + $"No embedded resource found with the name {name}. Resources found are " + + string.Join(", ", list) + ); + } + + using var reader = new StreamReader(stream); + return reader.ReadToEnd(); + } - protected override object GetModel(GeneratorExecutionContext context) + private object GetModel(GeneratorExecutionContext context) { var nodeTypes = context.Compilation.SyntaxTrees .Where(o => o.FilePath.Contains("SyntaxNodePrinters")) diff --git a/Src/CSharpier.Generators/TemplatedGenerator.cs b/Src/CSharpier.Generators/TemplatedGenerator.cs deleted file mode 100644 index 9c63ab5fc..000000000 --- a/Src/CSharpier.Generators/TemplatedGenerator.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.IO; -using System.Text; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; -using Scriban; - -namespace Generators; - -// this should be in a shared project but the build hates that sometimes and it isn't worth figuring out right now -// see https://github.com/dotnet/roslyn/discussions/47517 -public abstract class TemplatedGenerator : ISourceGenerator -{ - protected abstract string SourceName { get; } - - public void Initialize(GeneratorInitializationContext context) { } - - public void Execute(GeneratorExecutionContext context) - { - var template = Template.Parse(this.GetContent(this.GetType().Name + ".sbntxt")); - var renderedSource = template.Render(this.GetModel(context), member => member.Name); - - var sourceText = SourceText.From(renderedSource, Encoding.UTF8); - - context.AddSource(this.SourceName, sourceText); - } - - protected abstract object GetModel(GeneratorExecutionContext context); - - public string GetContent(string relativePath) - { - var assembly = this.GetType().Assembly; - var baseName = assembly.GetName().Name; - var resourceName = relativePath - .TrimStart('.') - .Replace(Path.DirectorySeparatorChar, '.') - .Replace(Path.AltDirectorySeparatorChar, '.'); - - var name = baseName + "." + resourceName; - using var stream = assembly.GetManifestResourceStream(name); - - if (stream == null) - { - var list = assembly.GetManifestResourceNames(); - - throw new Exception( - $"No embedded resource found with the name {name}. Resources found are " - + string.Join(", ", list) - ); - } - - using var reader = new StreamReader(stream); - return reader.ReadToEnd(); - } -} diff --git a/Src/CSharpier.Tests.Generators/CSharpier.Tests.Generators.csproj b/Src/CSharpier.Tests.Generators/CSharpier.Tests.Generators.csproj index 98e723bf3..6bde20ef6 100644 --- a/Src/CSharpier.Tests.Generators/CSharpier.Tests.Generators.csproj +++ b/Src/CSharpier.Tests.Generators/CSharpier.Tests.Generators.csproj @@ -5,15 +5,10 @@ SYSLIB0013 - - + + - - - - - TemplatedGenerator.cs - + diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs index 840a5fe27..a48ecfa78 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs @@ -1,16 +1,46 @@ -using System.IO; -using System.Linq; -using Generators; -using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis; namespace CSharpier.Tests.Generators; +using System.Text; +using Microsoft.CodeAnalysis.Text; +using Scriban; + [Generator] -public class FormattingTestsGenerator : TemplatedGenerator +public class FormattingTestsGenerator : ISourceGenerator { - protected override string SourceName => "FormattingTests"; + public void Initialize(GeneratorInitializationContext context) { } - protected override object GetModel(GeneratorExecutionContext context) + public void Execute(GeneratorExecutionContext context) + { + var template = Template.Parse(this.GetContent(this.GetType().Name + ".sbntxt")); + + foreach (var extension in this.GetExtensions(context)) + { + var renderedSource = template.Render( + this.GetModel(context, extension), + member => member.Name + ); + + var sourceText = SourceText.From(renderedSource, Encoding.UTF8); + + context.AddSource("FormattingTests_" + extension, sourceText); + } + } + + private IEnumerable GetExtensions(GeneratorExecutionContext context) + { + return context.AdditionalFiles + .Where( + o => + o.Path.EndsWith(".test") + && !o.Path.EndsWith(".actual.test") + && !o.Path.EndsWith(".expected.test") + ) + .Select(o => new FileInfo(o.Path).DirectoryName!); + } + + protected object GetModel(GeneratorExecutionContext context, string extension) { var tests = context.AdditionalFiles .Where( @@ -18,6 +48,7 @@ protected override object GetModel(GeneratorExecutionContext context) o.Path.EndsWith(".test") && !o.Path.EndsWith(".actual.test") && !o.Path.EndsWith(".expected.test") + && new FileInfo(o.Path).DirectoryName == extension ) .Select( o => @@ -29,6 +60,32 @@ protected override object GetModel(GeneratorExecutionContext context) } ); - return new { Tests = tests }; + return new { Tests = tests, FileExtension = extension }; + } + + public string GetContent(string relativePath) + { + var assembly = this.GetType().Assembly; + var baseName = assembly.GetName().Name; + var resourceName = relativePath + .TrimStart('.') + .Replace(Path.DirectorySeparatorChar, '.') + .Replace(Path.AltDirectorySeparatorChar, '.'); + + var name = baseName + "." + resourceName; + using var stream = assembly.GetManifestResourceStream(name); + + if (stream == null) + { + var list = assembly.GetManifestResourceNames(); + + throw new Exception( + $"No embedded resource found with the name {name}. Resources found are " + + string.Join(", ", list) + ); + } + + using var reader = new StreamReader(stream); + return reader.ReadToEnd(); } } diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt index 78908ab97..e67f14be6 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt @@ -1,6 +1,6 @@ using NUnit.Framework; -namespace CSharpier.Tests.FormattingTests +namespace CSharpier.Tests.FormattingTests.{{ FileExtension }} { [TestFixture] [Parallelizable(ParallelScope.All)] diff --git a/Src/CSharpier.Tests/CSharpier.Tests.csproj b/Src/CSharpier.Tests/CSharpier.Tests.csproj index 85f2c9cdf..cafce0e3e 100644 --- a/Src/CSharpier.Tests/CSharpier.Tests.csproj +++ b/Src/CSharpier.Tests/CSharpier.Tests.csproj @@ -27,7 +27,4 @@ $([System.String]::Copy(%(Filename)).Replace('.expected', '.test')) - - - diff --git a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs index b2c319ad7..5be743897 100644 --- a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs +++ b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs @@ -28,9 +28,9 @@ protected async Task RunTest(string fileName, string fileExtension, bool useTabs PreprocessorSymbols.Reset(); - // TODO xml use proper formatter - var result = await CSharpFormatter.FormatAsync( + var result = await CodeFormatter.FormatAsync( fileReaderResult.FileContents, + fileExtension, new PrinterOptions { Width = PrinterOptions.WidthUsedByTests, UseTabs = useTabs }, CancellationToken.None ); diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test new file mode 100644 index 000000000..f70c6324b --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test @@ -0,0 +1,9 @@ + + + 4 + + + + + + diff --git a/Src/CSharpier.Tests/Samples/AllInOne.test b/Src/CSharpier.Tests/Samples/AllInOne.test index 30dffe258..178a4bda4 100644 --- a/Src/CSharpier.Tests/Samples/AllInOne.test +++ b/Src/CSharpier.Tests/Samples/AllInOne.test @@ -1,623 +1,12130 @@ -#error Error message -#warning Warning message -#pragma warning disable 414, 3021 -#pragma warning restore 3021 -#pragma checksum "file.txt" "{00000000-0000-0000-0000-000000000000}" "2453" -#define foo // Comment in directive -#if foo -#else -#endif -#undef foo - -extern alias Foo; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using M = System.Math; - -#if DEBUG || TRACE -using System.Diagnostics; -#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false -using System.Diagnostics; -#else -using System.Diagnostics; -#endif - -#region Region - - #region more -using ConsoleApplication2.Test; - #endregion -using X = int1; -using Y = ABC.X; - -using static System.Math; -using static System.DayOfWeek; -using static System.Linq.Enumerable; - -#endregion - -[assembly: System.Copyright(@"(C)"" - -2009")] -[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] - -class TopLevelType : IDisposable -{ - void IDisposable.Dispose() { } -} - -namespace My -{ - using A.B; - - interface CoContra { } - delegate void CoContra2<[System.Obsolete()] out T, in K>() - where T : struct; - - public unsafe partial class A : C, I - { - [DllImport("kernel32", SetLastError = true)] - static extern bool CreateDirectory(string name, SecurityAttribute sa); - - private const int global = int.MinValue - 1; - - static A() { } - - public A(int foo) - { - L: - { - int i = sizeof(int); - ++i; - var s1 = $"x {1, -2:d}"; - var s2 = $@"x {1, -2:d}"; - } - -#if DEBUG - Console.WriteLine(export.iefSupplied.command); -#endif - const int? local = int.MaxValue; - const Guid? local0 = new Guid(r.ToString()); - - var привет = local; - var мир = local; - var local3 = 0, - local4 = 1; - local3 = local4 = 1; - var local5 = null as Action ?? null; - var local6 = local5 is Action; - - var u = 1u; - var U = 1U; - long hex = 0xBADC0DE, - Hex = 0XDEADBEEF, - l = -1L, - L = 1L, - l2 = 2l; - ulong ul = 1ul, - Ul = 1Ul, - uL = 1uL, - UL = 1UL, - lu = 1lu, - Lu = 1Lu, - lU = 1lU, - LU = 1LU; - int minInt32Value = -2147483648; - int minInt64Value = -9223372036854775808L; - - bool @bool; - byte @byte; - char @char = 'c', - \u0066 = '\u0066', - hexchar = '\x0130', - hexchar2 = (char)0xBAD; - string \U00000065 = "\U00000065"; - decimal @decimal = 1.44M; - @decimal = 1.2m; - dynamic @dynamic; - double @double = M.PI; - @double = 1d; - @double = 1D; - @double = -1.2e3; - float @float = 1.2f; - @float = 1.44F; - int @int = local ?? -1; - long @long; - object @object; - sbyte @sbyte; - short @short; - string @string = @"""/*"; - uint @uint; - ulong @ulong; - ushort @ushort; - - dynamic dynamic = local5; - var add = 0; - var alias = 0; - var arglist = 0; - var ascending = 0; - var async = 0; - var await = 0; - var by = 0; - var descending = 0; - var dynamic = 0; - var equals = 0; - var from = 0; - var get = 0; - var group = 0; - var into = 0; - var join = 0; - var let = 0; - var nameof = 0; - var on = 0; - var orderby = 0; - var partial = 0; - var remove = 0; - var select = 0; - var set = 0; - var when = 0; - var where = 0; - var yield = 0; - var __ = 0; - where = yield = 0; - - if (i > 0) - { - return; - } - else if (i == 0) - { - throw new Exception(); - } - var o1 = new MyObject(); - var o2 = new MyObject(var); - var o3 = new MyObject { A = i }; - var o4 = new MyObject(@dynamic) { A = 0, B = 0, C = 0 }; - var o5 = new { A = 0 }; - var dictionaryInitializer = new Dictionary - { - { 1, "" }, - { 2, "a" } - }; - float[] a = new float[] { 0f, 1.1f }; - int[,,] cube = { - { { 111, 112 }, { 121, 122 } }, - { { 211, 212 }, { 221, 222 } } - }; - - int[][] jagged = { { 111 }, { 121, 122 } }; - int[][,] arr = new int[5][,]; // as opposed to new int[][5,5] - arr[0] = new int[5,5]; // as opposed to arr[0,0] = new int[5]; - arr[0][0, 0] = 47; - int[] arrayTypeInference = new[] { 0, 1 }; - switch (3) { } - switch (i) - { - case 0: - case 1: - { - goto case 2; - } - case 2 + 3: - { - goto default; - break; - } - default: - { - return; - } - } - while (i < 10) - { - ++i; - if (true) - { - continue; - } - break; - } - do - { - ++i; - if (true) - { - continue; - } - break; - } - while (i < 10); - for (int j = 0; j < 100; ++j) - { - for (;;) - { - for (int i = 0, j = 0; i < length; i++, j++) { } - if (true) - { - continue; - } - break; - } - } - label: - goto label; - label2: - ; - foreach (var i in Items()) - { - if (i == 7) - { - return; - } - else - { - continue; - } - } - checked - { - checked(++i); - } - unchecked - { - unchecked(++i); - } - lock (sync) - process(); - using (var v = BeginScope()) - using (A a = new A()) - using (A a = new A(), b = new A()) - using (BeginScope()) - return; - yield return this.items[3]; - yield break; - fixed (int* p = stackalloc int[100], q = &y) - { - *intref = 1; - } - fixed (int* p = stackalloc int[100]) - { - *intref = 1; - } - unsafe - { - int* p = null; - } - try - { - throw null; - } - catch (System.AccessViolationException av) - { - throw av; - } - catch (Exception) - { - throw; - } - finally - { - try { } - catch { } - } - var anonymous = { A = 1, B = 2, C = 3 }; - var query = - from c in customers - let d = c - where d != null - join c1 in customers on c1.GetHashCode() equals c.GetHashCode() - join c1 in customers - on c1.GetHashCode() equals c.GetHashCode() - into e - group c by c.Country into g - orderby g.Count() ascending - orderby g.Key descending - select new { Country = g.Key, CustCount = g.Count() }; - query = from c in customers select c into d select d; - } - ~A() { } - private readonly int f1; - [Obsolete] - [NonExisting] - [Foo::NonExisting(var, 5)] - [CLSCompliant(false)] - [ - Obsolete, - System.NonSerialized, - NonSerialized, - CLSCompliant(true || false & true) - ] - private volatile int f2; - [return: Obsolete] - [method: Obsolete] - public void Handler(object value) { } - public int m(T t) - where T : class, new() - { - base.m(t); - return 1; - } - public string P - { - get { return "A"; } - set; - } - public abstract string P { get; } - public abstract int this[int index] - { - protected internal get; - internal protected set; - } - [method: Obsolete] - [field: Obsolete] - [event: Obsolete] - public readonly event Event E; - [event: Test] - public event Action E1 - { - [Obsolete] - add { value = value; } - [Obsolete] - [return: Obsolete] - remove - { - E += Handler; - E -= Handler; - } - } - public static A operator +(A first, A second) - { - Delegate handler = new Delegate(Handler); - return first.Add(second); - } - [method: Obsolete] - [return: Obsolete] - public static bool operator true(A a) - { - return true; - } - public static bool operator false(A a) - { - return false; - } - class C { } +Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#error Error message"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#warning Warning message"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#pragma warning disable 414, 3021"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#pragma warning restore 3021"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#pragma checksum \"file.txt\" \"{00000000-0000-0000-0000-000000000000}\" \"2453\""), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#define foo // Comment in directive"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if foo"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#else"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#undef foo"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "extern", + " " + ), + Doc.Concat( + "alias", + " " + ), + "Foo", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + "System", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + "System", + ".", + "Collections" + ), + ".", + "Generic" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Linq" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + "System", + ".", + "Linq" + ), + ".", + "Expressions" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Text" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Concat( + "M", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Concat( + "System", + ".", + "Math" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if DEBUG || TRACE"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Diagnostics" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.Trim, + "using System.Diagnostics; +", + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#else"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.Trim, + "using System.Diagnostics; +", + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.BeginRegion("#region Region"), + Doc.HardLine, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.BeginRegion("#region more"), + Doc.HardLine + ) + ), + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "ConsoleApplication2", + ".", + "Test" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.EndRegion("#endregion"), + Doc.HardLine + ) + ), + "using", + " " + ), + Doc.Null, + Doc.Concat( + "X", + " ", + Doc.Concat( + "=", + " " + ) + ), + "int1", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Concat( + "Y", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Concat( + "ABC", + ".", + Doc.Group( + "X", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Concat( + "static", + " " + ), + Doc.Null, + Doc.Concat( + "System", + ".", + "Math" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Concat( + "static", + " " + ), + Doc.Null, + Doc.Concat( + "System", + ".", + "DayOfWeek" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Concat( + "static", + " " + ), + Doc.Null, + Doc.Concat( + Doc.Concat( + "System", + ".", + "Linq" + ), + ".", + "Enumerable" + ), + ";" + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.EndRegion("#endregion"), + Doc.HardLine, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "[" + ), + "assembly", + Doc.Concat( + ":", + " " + ), + Doc.Group( + Doc.Concat( + "System", + ".", + "Copyright" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "@\"(C)\"\"", + Doc.LiteralLine, + "", + Doc.LiteralLine, + "2009\"" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + "[", + "module", + Doc.Concat( + ":", + " " + ), + Doc.Group( + Doc.Concat( + "System", + ".", + "Copyright" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "\"\n\t\u0123(C) \\"2009\"", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "\"\u0123\"" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "TopLevelType", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "IDisposable", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "IDisposable", + ".", + "Dispose", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "My", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "A", + ".", + "B" + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "CoContra", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "out", + " " + ), + "T" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "in", + " " + ), + "K" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "delegate", + " " + ), + "void", + " ", + "CoContra2", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.GroupWithId( + "7b3c97da-ed9e-48ad-84ac-43f4cacce838", + Doc.Group( + "[", + Doc.Group( + Doc.Concat( + "System", + ".", + "Obsolete" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Null + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.IndentIfBreak( + Doc.Line, + "7b3c97da-ed9e-48ad-84ac-43f4cacce838" + ), + Doc.Concat( + "out", + " " + ), + "T" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "in", + " " + ), + "K" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + "(", + Doc.Null, + ")" + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "struct", + Doc.Null + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + "public", + " ", + "unsafe", + " ", + "partial" + ), + " " + ), + Doc.Concat( + "class", + " " + ), + "A", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "C", + Doc.Indent( + ",", + Doc.Line, + "I" + ) + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Group( + "[", + Doc.Group( + "DllImport", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "\"kernel32\"" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "SetLastError", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Null, + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "extern", + " " + ) + ) + ), + "bool", + " ", + "CreateDirectory", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + " ", + "name" + ), + ",", + Doc.Line, + Doc.Concat( + "SecurityAttribute", + " ", + "sa" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "private", + " ", + "const" + ), + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "global", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "int", + Doc.Concat( + ".", + "MinValue" + ) + ), + Doc.Group( + Doc.Line, + "-", + " ", + "1" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Null + ), + "A", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "A", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "foo" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "L", + ":", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "287971df-90e0-45db-9c38-423108431296", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "sizeof", + "(", + "int", + ")" + ), + "287971df-90e0-45db-9c38-423108431296" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "++", + "i" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "s1", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + "x ", + Doc.Concat( + "{", + "1", + Doc.Concat( + ",", + " " + ), + Doc.Concat( + "-", + "2" + ), + ":", + "d", + "}" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "s2", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$@\"", + "x ", + Doc.Concat( + "{", + "1", + Doc.Concat( + ",", + " " + ), + Doc.Concat( + "-", + "2" + ), + ":", + "d", + "}" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if DEBUG"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "Console" + ), + Doc.Concat( + ".", + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "export", + Doc.Concat( + ".", + "iefSupplied" + ), + Doc.Concat( + ".", + "command" + ) + ), + Doc.Concat( + Doc.Concat( + "export" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "iefSupplied" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "command" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "const" + ), + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "local", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "1bd4281e-555c-4563-b87b-4b1193ca3774", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "int", + Doc.Concat( + ".", + "MaxValue" + ) + ), + "1bd4281e-555c-4563-b87b-4b1193ca3774" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "const", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "Guid", + "?" + ), + " ", + "local0", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "1ee4c78a-9cb1-469a-b2da-cdcf12b2ad62", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Guid", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "r", + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "r" + ), + Doc.Concat( + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "1ee4c78a-9cb1-469a-b2da-cdcf12b2ad62" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "привет", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "99692793-7f4e-4819-8cf2-41afa230494d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "local", + "99692793-7f4e-4819-8cf2-41afa230494d" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "мир", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "867f226a-2bd3-4492-8412-082a3d0b8631", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "local", + "867f226a-2bd3-4492-8412-082a3d0b8631" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "var", + " ", + Doc.Indent( + Doc.Concat( + "local3", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "local4", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "local3", + " " + ), + "=", + Doc.GroupWithId( + "ffa3aefa-1fde-4aa9-93b1-2c3cc0143412", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Group( + "local4", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + "ffa3aefa-1fde-4aa9-93b1-2c3cc0143412" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "local5", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "null", + Doc.Indent( + Doc.Group( + Doc.Line, + "as", + " ", + "Action" + ) + ) + ), + Doc.Line, + "??", + " ", + "null" + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "local6", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "local5", + Doc.Group( + Doc.Line, + "is", + " ", + "Action" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "u", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1u" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "U", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1U" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "long", + " ", + Doc.Indent( + Doc.Concat( + "hex", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0xBADC0DE" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "Hex", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0XDEADBEEF" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "l", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + "-", + "1L" + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "L", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1L" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "l2", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "2l" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "ulong", + " ", + Doc.Indent( + Doc.Concat( + "ul", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1ul" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "Ul", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1Ul" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "uL", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1uL" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "UL", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1UL" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "lu", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1lu" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "Lu", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1Lu" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "lU", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1lU" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "LU", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1LU" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "minInt32Value", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "fe0580a9-db93-4a79-a122-3b66f07b1cdc", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "-", + "2147483648" + ), + "fe0580a9-db93-4a79-a122-3b66f07b1cdc" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "minInt64Value", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "11626f7d-fa68-48b0-8768-3fd29c3105f5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "-", + "9223372036854775808L" + ), + "11626f7d-fa68-48b0-8768-3fd29c3105f5" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "bool", + " ", + "@bool", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "byte", + " ", + "@byte", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "char", + " ", + Doc.Indent( + Doc.Concat( + "@char", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "'c'" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "\u0066", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "'\u0066'" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "hexchar", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "'\x0130'" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "hexchar2", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Group( + "(", + "char", + ")", + Doc.Indent( + Doc.SoftLine, + "0xBAD" + ) + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "\U00000065", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"\U00000065\"" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "decimal", + " ", + "@decimal", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.44M" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@decimal", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.2m" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "dynamic", + " ", + "@dynamic", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "double", + " ", + "@double", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "14d7fad1-2297-46ec-9e08-d5a5fe3f7bd5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "M", + Doc.Concat( + ".", + "PI" + ) + ), + "14d7fad1-2297-46ec-9e08-d5a5fe3f7bd5" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@double", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1d" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@double", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1D" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@double", + " " + ), + "=", + Doc.GroupWithId( + "20e8e628-9adc-4d49-b9e3-6219f250c0f9", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "-", + "1.2e3" + ), + "20e8e628-9adc-4d49-b9e3-6219f250c0f9" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "float", + " ", + "@float", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.2f" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@float", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.44F" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "@int", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "local", + Doc.Group( + Doc.Line, + "??", + " ", + Doc.Concat( + "-", + "1" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "long", + " ", + "@long", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "object", + " ", + "@object", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "sbyte", + " ", + "@sbyte", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "short", + " ", + "@short", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "@string", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "@\"\"\"/*\"" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "uint", + " ", + "@uint", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "ulong", + " ", + "@ulong", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "ushort", + " ", + "@ushort", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "dynamic", + " ", + "dynamic", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8124b7fd-aa3b-4d09-840a-8a44bfae95cd", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "local5", + "8124b7fd-aa3b-4d09-840a-8a44bfae95cd" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "add", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "alias", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "arglist", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "ascending", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "async", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "await", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "by", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "descending", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "dynamic", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "equals", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "from", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "get", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "group", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "into", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "join", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "let", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "nameof", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "on", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "orderby", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "partial", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "remove", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "select", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "set", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "when", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "where", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "yield", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "__", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "where", + " " + ), + "=", + Doc.GroupWithId( + "a584e616-fa17-4ad9-ad80-43d1ae3acec4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Group( + "yield", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + "a584e616-fa17-4ad9-ad80-43d1ae3acec4" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + ">", + " ", + "0" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "else", + Doc.Concat( + " ", + Doc.Concat( + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "==", + " ", + "0" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Exception", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o1", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "59ef7887-cabf-415e-9de0-0bcd820f0430", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "59ef7887-cabf-415e-9de0-0bcd820f0430" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "059d38c1-9c3b-45bc-aa6a-432c45473e83", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "var" + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "059d38c1-9c3b-45bc-aa6a-432c45473e83" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o3", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "83a788f7-1e0a-4db7-b9ed-531b740023fd", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Null, + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "A", + " " + ), + "=", + Doc.GroupWithId( + "5eee871b-9d0c-4289-8616-a27c83c87ee8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "5eee871b-9d0c-4289-8616-a27c83c87ee8" + ) + ) + ), + Doc.Line, + "}" + ) + ) + ), + "83a788f7-1e0a-4db7-b9ed-531b740023fd" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o4", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "11d7e43e-cdf0-480c-9e83-7dc85ce1b385", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "@dynamic" + ), + Doc.SoftLine, + ")" + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Group( + "A", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + "B", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + "C", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ) + ) + ), + Doc.HardLine, + "}" + ) + ) + ), + "11d7e43e-cdf0-480c-9e83-7dc85ce1b385" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o5", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "76767dc7-7314-4dfc-a5c9-6a1e2b7dbaf8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + Doc.Line + ), + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "A", + " " + ), + Doc.Concat( + "=", + " " + ), + "0" + ) + ), + Doc.Line, + "}" + ), + "76767dc7-7314-4dfc-a5c9-6a1e2b7dbaf8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "dictionaryInitializer", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "06de45a6-6f29-4bdc-9352-283e935164c8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Group( + "Dictionary", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null, + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "\"\"" + ) + ), + Doc.Line, + "}" + ), + ",", + Doc.Line, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "2", + ",", + Doc.Line, + "\"a\"" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.Line, + "}" + ) + ) + ), + "06de45a6-6f29-4bdc-9352-283e935164c8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "float", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "9faf569f-e120-4277-ba5e-86164bfec4a0", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "float", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "0f", + ",", + Doc.Line, + "1.1f" + ) + ), + Doc.Line, + "}" + ) + ) + ), + "9faf569f-e120-4277-ba5e-86164bfec4a0" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Concat( + Doc.Null, + ",", + Doc.Null, + Doc.Null, + ",", + Doc.Null, + Doc.Null + ), + "]" + ) + ) + ), + " ", + "cube", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "111", + ",", + Doc.Line, + "112" + ) + ), + Doc.Line, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "121", + ",", + Doc.Line, + "122" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "211", + ",", + Doc.Line, + "212" + ) + ), + Doc.Line, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "221", + ",", + Doc.Line, + "222" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "jagged", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + "111" + ), + Doc.Line, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "121", + ",", + Doc.Line, + "122" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Concat( + Doc.Null, + ",", + Doc.Null, + Doc.Null + ), + "]" + ) + ) + ), + " ", + "arr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "0f0abac0-6097-4ba0-ae2e-2f634b8a9add", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine + ), + "]" + ), + Doc.Concat( + "[", + Doc.Concat( + Doc.Null, + ",", + Doc.Null, + Doc.Null + ), + "]" + ) + ) + ), + Doc.Null + ), + "0f0abac0-6097-4ba0-ae2e-2f634b8a9add" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// as opposed to new int[][5,5]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.GroupWithId( + "61a5707a-01ae-44f8-b6b0-315943e70fe5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + "5" + ) + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + Doc.Null + ), + "61a5707a-01ae-44f8-b6b0-315943e70fe5" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// as opposed to arr[0,0] = new int[5];", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ), + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "0", + ",", + Doc.Line, + "0" + ) + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "47" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "arrayTypeInference", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "84c73b93-8865-4d94-b9ed-885d76ca96e8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "new", + "[", + Doc.Concat( + ), + "]", + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "0", + ",", + Doc.Line, + "1" + ) + ), + Doc.Line, + "}" + ) + ), + "84c73b93-8865-4d94-b9ed-885d76ca96e8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "switch", + " ", + "(", + Doc.GroupWithId( + "71007e25-26cc-4105-8a8d-054bceed800b", + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine + ), + ")", + " ", + "{", + " ", + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "switch", + " ", + "(", + Doc.GroupWithId( + "b280d6a4-7b14-4ad0-8fdc-dd42b5fe48d7", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine + ), + ")", + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + Doc.Group( + "0" + ), + ":" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + Doc.Group( + "1" + ), + ":" + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "goto", + " ", + "case", + Doc.Concat( + " ", + "2" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + Doc.Group( + Doc.Group( + "2", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "3" + ) + ) + ) + ), + ":" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + "goto", + " ", + "default", + "", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + "default", + ":" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "while", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "<", + " ", + "10" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Concat( + "++", + "i" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "true" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "do", + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Concat( + "++", + "i" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "true" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + " ", + Doc.Concat( + "while", + " " + ), + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "<", + " ", + "10" + ) + ) + ), + Doc.SoftLine + ), + ")", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "for", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "j", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + Doc.Null, + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Group( + "j", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "100" + ) + ) + ) + ), + ";", + Doc.Line, + Doc.Group( + Doc.Indent( + "++", + "j" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "for", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + Doc.Null, + ";" + ), + Doc.Line, + ";", + Doc.Line, + Doc.Group( + Doc.Indent( + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "for", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Concat( + "int", + " ", + Doc.Indent( + Doc.Concat( + "i", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + "j", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0" + ) + ) + ) + ) + ), + Doc.Null, + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "length" + ) + ) + ) + ), + ";", + Doc.Line, + Doc.Group( + Doc.Indent( + Doc.Concat( + "i", + "++" + ), + ",", + Doc.Line, + Doc.Concat( + "j", + "++" + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "true" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "label", + ":", + Doc.HardLine, + Doc.Concat( + Doc.Null, + "goto", + Doc.Null, + Doc.Null, + Doc.Concat( + " ", + "label" + ), + ";" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "label2", + ":", + Doc.HardLine, + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "foreach", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "var", + " ", + "i" + ), + " ", + "in", + " ", + Doc.ConditionalGroup( + Doc.Concat( + "Items", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Items", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "==", + " ", + "7" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "else", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "checked", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "checked", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "++", + "i" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "unchecked", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "unchecked", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "++", + "i" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "lock", + " " + ), + "(", + "sync", + ")", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "process", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "process", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "v", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "d27eb205-8165-4962-ab8c-8e394da6e812", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.ConditionalGroup( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + "d27eb205-8165-4962-ab8c-8e394da6e812" + ) + ), + Doc.Null + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + "A", + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c4cfc74c-284f-4e78-869f-fcadbc203cd3", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "A", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "c4cfc74c-284f-4e78-869f-fcadbc203cd3" + ) + ), + Doc.Null + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + " ", + Doc.Indent( + Doc.Concat( + "a", + Doc.Group( + " ", + Doc.Concat( + "=", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "A", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "b", + Doc.Group( + " ", + Doc.Concat( + "=", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "A", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ), + Doc.Null + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ) + ) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "yield", + " " + ), + "return", + Doc.Concat( + " ", + Doc.Concat( + Doc.Group( + "this", + Doc.Concat( + ".", + "items" + ) + ), + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine, + "]" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "yield", + " " + ), + "break", + "", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + Doc.Indent( + Doc.Concat( + "p", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "100" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "q", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + "&", + "y" + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "*", + "intref" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + "p", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "100" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "*", + "intref" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "unsafe", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + "p", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "try", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + "null" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + Doc.Concat( + "System", + ".", + "AccessViolationException" + ), + " ", + "av", + ")" + ), + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + "av" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + "Exception", + Doc.Null, + Doc.Null, + ")" + ), + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + "", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + "finally", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "try", + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Null, + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "var", + " ", + "anonymous", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Group( + Doc.Group( + "A", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "B", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "2" + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "C", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "3" + ) + ) + ) + ) + ), + Doc.Line, + "}" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "query", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "from", + " " + ), + Doc.Null, + Doc.Concat( + "c", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers" + ), + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "let", + " " + ), + Doc.Concat( + "d", + " " + ), + Doc.Concat( + "=", + " " + ), + "c" + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "where", + Doc.Indent( + Doc.Line, + Doc.Group( + "d", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "join", + " " + ), + Doc.Null, + Doc.Concat( + "c1", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers", + Doc.Indent( + Doc.Line, + Doc.Concat( + "on", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c1", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c1" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + " ", + Doc.Concat( + "equals", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + Doc.Null + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "join", + " " + ), + Doc.Null, + Doc.Concat( + "c1", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers", + Doc.Indent( + Doc.Line, + Doc.Concat( + "on", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c1", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c1" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + " ", + Doc.Concat( + "equals", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + "into", + " " + ), + "e" + ) + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "group", + " " + ), + "c", + " ", + Doc.Concat( + "by", + " " + ), + Doc.Group( + "c", + Doc.Concat( + ".", + "Country" + ) + ) + ), + " ", + Doc.Concat( + Doc.Concat( + "into", + " " + ), + Doc.Concat( + "g", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + "orderby", + Doc.Concat( + " ", + Doc.ConditionalGroup( + Doc.Concat( + "g", + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "g" + ), + Doc.Concat( + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + " ", + "ascending" + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + "orderby", + Doc.Concat( + " ", + Doc.Group( + "g", + Doc.Concat( + ".", + "Key" + ) + ), + " ", + "descending" + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + Doc.Group( + Doc.Concat( + "new", + Doc.Line + ), + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "Country", + " " + ), + Doc.Concat( + "=", + " " + ), + Doc.Group( + "g", + Doc.Concat( + ".", + "Key" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "CustCount", + " " + ), + Doc.Concat( + "=", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "g", + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "g" + ), + Doc.Concat( + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ) + ) + ) + ), + Doc.Line, + "}" + ) + ) + ) + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "query", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "from", + " " + ), + Doc.Null, + Doc.Concat( + "c", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers" + ), + Doc.Line, + Doc.Concat( + Doc.Concat( + ), + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + "c" + ), + " ", + Doc.Concat( + Doc.Concat( + "into", + " " + ), + Doc.Concat( + "d", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + ), + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + "d" + ) + ) + ) + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Concat( + "~", + "A" + ), + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "private", + " ", + "readonly" + ), + " " + ), + Doc.Group( + "int", + " ", + "f1", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "NonExisting", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + Doc.Group( + Doc.Concat( + "Foo", + "::", + "NonExisting" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "var" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + "5" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + Doc.Group( + "CLSCompliant", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "false" + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "Obsolete", + ",", + Doc.Line, + Doc.Concat( + "System", + ".", + "NonSerialized" + ), + ",", + Doc.Line, + "NonSerialized", + ",", + Doc.Line, + Doc.Group( + "CLSCompliant", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "true", + Doc.Indent( + Doc.Line, + "||", + " ", + Doc.Group( + "false", + Doc.Indent( + Doc.Group( + Doc.Line, + "&", + " ", + "true" + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + Doc.HardLine + ), + Doc.Group( + Doc.Concat( + "private", + " ", + "volatile" + ), + " " + ), + Doc.Group( + "int", + " ", + "f2", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "return", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "method", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Handler", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "object", + " ", + "value" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "int", + " ", + "m", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "t" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Concat( + "class", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "new", + "(", + ")" + ) + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "base", + Doc.Concat( + ".", + "m" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "t" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "base" + ), + Doc.Concat( + Doc.Concat( + ".", + "m" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "t" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "1", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + "get", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "\"A\"", + ";" + ) + ), + Doc.Line + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "int", + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + "int", + " ", + "index" + ), + "]" + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Group( + Doc.Concat( + "protected", + " ", + "internal" + ), + " " + ), + "get", + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Group( + Doc.Concat( + "internal", + " ", + "protected" + ), + " " + ), + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "method", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "field", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "event", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Group( + Doc.Concat( + "public", + " ", + "readonly" + ), + " " + ), + Doc.Concat( + "event", + " " + ), + Doc.Group( + "Event", + " ", + "E", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Group( + "[", + "event", + Doc.Concat( + ":", + " " + ), + "Test", + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Group( + "public", + " " + ), + Doc.Concat( + "event", + " " + ), + "Action", + " ", + Doc.Null, + "E1", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Concat( + Doc.Group( + "[", + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Null, + "add", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "value", + " " + ), + "=", + Doc.GroupWithId( + "4466cd36-5e88-4dd0-accb-90214e527700", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "value", + "4466cd36-5e88-4dd0-accb-90214e527700" + ) + ), + ";" + ) + ), + Doc.Line + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "return", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Null, + "remove", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "E", + " " + ), + "+=", + Doc.GroupWithId( + "3aee4cb5-f329-457c-8977-e1ebe96b16b6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "Handler", + "3aee4cb5-f329-457c-8977-e1ebe96b16b6" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "E", + " " + ), + "-=", + Doc.GroupWithId( + "2ec19bd5-586f-4d0d-b046-5868af3ab64e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "Handler", + "2ec19bd5-586f-4d0d-b046-5868af3ab64e" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "A", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "A", + " ", + "first" + ), + ",", + Doc.Line, + Doc.Concat( + "A", + " ", + "second" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Delegate", + " ", + "handler", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "fcd47dd7-9305-4837-8798-02168a91792b", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Delegate", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "Handler" + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "fcd47dd7-9305-4837-8798-02168a91792b" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + "first", + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "second" + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "method", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "return", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "bool", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "true", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + " ", + "a" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "true", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "bool", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "false", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + " ", + "a" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "false", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "C", + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "struct", + " " + ), + "S", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "I", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "S", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "private", + " " + ), + Doc.Group( + "int", + " ", + "f1", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + Doc.Group( + "Obsolete", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "\"Use Script instead\"" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "error", + Doc.Concat( + ":", + " " + ) + ), + "false" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Group( + Doc.Concat( + "private", + " ", + "volatile" + ), + " " + ), + Doc.Group( + "int", + " ", + "f2", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "abstract", + " " + ) + ) + ), + "int", + " ", + "m", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "t" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "struct", + Doc.Null + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "1", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + "get", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "value", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "\"A\"", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "int", + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + "int", + " ", + "index" + ), + "]" + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Group( + Doc.Concat( + "internal", + " ", + "protected" + ), + " " + ), + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Concat( + "event", + " " + ), + Doc.Group( + "Event", + " ", + "E", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "A", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "A", + " ", + "first" + ), + ",", + Doc.Line, + Doc.Concat( + "A", + " ", + "second" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + "first", + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "second" + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " " + ), + Doc.Group( + "int", + " ", + "field", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "10" + ), + Doc.SoftLine, + "]" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "C", + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "interface", + " " + ), + "I", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "A", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "value" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Null, + "string", + " ", + Doc.Null, + "Value", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + " ", + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "unsafe", + " ", + Doc.Null + ), + "void", + " ", + "UpdateSignatureByHashingContent", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.GroupWithId( + "48bc2011-44bf-437b-853a-54dd419bb6a7", + Doc.Group( + "[", + "In", + Doc.Null, + "]" + ), + Doc.IndentIfBreak( + Doc.Line, + "48bc2011-44bf-437b-853a-54dd419bb6a7" + ), + Doc.Concat( + "byte", + "*" + ), + " ", + "buffer" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "size" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "type", + Doc.Concat( + ":", + " " + ), + "Flags", + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Group( + "public", + " " + ), + Doc.Concat( + "enum", + " " + ), + "E", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "A" + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "B", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "A" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "C", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Group( + "2", + Doc.Group( + Doc.Line, + "+", + " ", + "A" + ) + ) + ) + ) + ), + ",", + Doc.Null, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if DEBUG"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "D" + ) + ), + "," + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#else"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.Trim, + " E, } - public struct S : I - { - public S() { } - private int f1; - [Obsolete("Use Script instead", error: false)] - private volatile int f2; - public abstract int m(T t) - where T : struct - { - return 1; - } - public string P - { - get - { - int value = 0; - return "A"; - } - set; - } - public abstract string P { get; } - - public abstract int this[int index] - { - get; - internal protected set; - } - public event Event E; - public static A operator +(A first, A second) - { - return first.Add(second); - } - fixed int field[10]; - class C { } - } - public interface I - { - void A(int value); - string Value { get; set; } - unsafe void UpdateSignatureByHashingContent([In]byte* buffer, int size); - } - [type: Flags] - public enum E - { - A, - B = A, - C = 2 + A, -#if DEBUG - D, - } -#else - E, - } -#endif - - - public delegate void Delegate(object P); - namespace Test - { - using System; - using System.Collections; - public class Список - { - public static IEnumerable Power(int number, int exponent) - { - Список Список = new Список(); - Список.Main(); - int counter = (0 + 0); - int אתר = 0; - while (++counter++ < --exponent--) - { - result = result * number + +number+++++number; - yield return result; - } - } - static void Main() - { - foreach (int i in Power(2, 8)) - { - Console.Write("{0} ", i); - } - } - async void Wait() - { - await System.Threading.Tasks.Task.Delay(0); - } - void AsyncAnonymous() // C # 5 feature - { - var task = Task.Factory.StartNew( - async () => - { - return await new WebClient().DownloadStringTaskAsync( - "http://example.com" - ); - } - ); - } - } - } -} - -namespace ConsoleApplication1 -{ - namespace RecursiveGenericBaseType - { - class A : B, A> - where T : A - { - protected virtual A M() { } - protected abstract B, A> N() { } - static B, A> O() { } - } - - sealed class B : A> - { - protected override A M() { } - protected sealed override B, A> N() { } - new static A O() { } - } - } - - namespace Boo - { - public class Bar - where T : IComparable - { - public T f; - public class Foo : IEnumerable - { - public void Method(K k, T t, U u) - where K : IList, IList, IList - where V : IList - { - A a; - M(A(5)); - } - } - } - } - - class Test - { - void Bar3() - { - var x = new Boo.Bar.Foo(); - x.Method(" ", 5, new object()); - - var q = from i in new int[] { 1, 2, 3, 4 } where i > 5 select i; - } - - public static implicit operator Test(string s) - { - return new ConsoleApplication1.Test(); - } - public static explicit operator Test(string s = "") - { - return new Test(); - } - - public int foo = 5; - void Bar2() - { - foo = 6; - this.Foo = 5.GetType(); - Test t = "sss"; - } - - public event EventHandler MyEvent = delegate { }; - - void Blah() - { - int i = 5; - int? j = 6; - - Expression> e = () => i; - Expression> e2 = b => () => - { - return; - }; - Func f = async delegate(bool a) - { - return await !a; - }; - Func f2 = (a, b) => 0; - f2 = (int a, int b) => 1; - Action a = Blah; - f2 = () => { }; - f2 = () => - { - ; - }; - } - - delegate Recursive Recursive(Recursive r); - delegate Recursive Recursive(Recursive r); - - public Type Foo - { - [Obsolete("Name", error = false)] - get - { - var result = typeof(IEnumerable); - var t = typeof(int?) == typeof(Nullable); - t = typeof(IEnumerable); - return typeof(IEnumerable<>); - } - set - { - var t = typeof(System.Int32); - t.ToString(); - t = value; - } - } - - public void Constants() - { - int i = 1 + 2 + 3 + 5; - global::System.String s = - "a" + (System.String)"a" + "a" + "a" + "a" + "A"; - } - - public void ConstructedType() - { - List i = null; - int c = i.Count; - } - } -} - -namespace Comments.XmlComments.UndocumentedKeywords -{ - /// +", + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "public" + ), + " " + ), + Doc.Concat( + "delegate", + " " + ), + "void", + " ", + "Delegate", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "object", + " ", + "P" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "Test", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + "System", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Collections" + ), + ";" + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "class", + " " + ), + "Список", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "IEnumerable", + " ", + "Power", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "number" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "exponent" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Список", + " ", + "Список", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "d976fcb8-d892-40e7-82bb-2501e5bbead8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Список", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "d976fcb8-d892-40e7-82bb-2501e5bbead8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "Список", + Doc.Concat( + ".", + "Main" + ), + Doc.Group( + "(", + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "counter", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "d2651588-94b5-4cdd-9cc9-ad098fdbd4fb", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "0", + Doc.Group( + Doc.Line, + "+", + " ", + "0" + ) + ) + ), + Doc.SoftLine, + ")" + ), + "d2651588-94b5-4cdd-9cc9-ad098fdbd4fb" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "אתר", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "while", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Concat( + "++", + Doc.Concat( + "counter", + "++" + ) + ), + Doc.Group( + Doc.Line, + "<", + " ", + Doc.Concat( + "--", + Doc.Concat( + "exponent", + "--" + ) + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "result", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "result", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "number" + ) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "+", + Doc.Concat( + Doc.Concat( + "number", + "++" + ), + "++" + ) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "number" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "yield", + " " + ), + "return", + Doc.Concat( + " ", + "result" + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Null + ), + "void", + " ", + "Main", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "foreach", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "i" + ), + " ", + "in", + " ", + Doc.ConditionalGroup( + Doc.Concat( + "Power", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + ",", + Doc.Line, + "8" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Power", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + ",", + Doc.Line, + "8" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "Console", + Doc.Concat( + ".", + "Write" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "\"{0} \"", + ",", + Doc.Line, + "i" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + "void", + " ", + "Wait", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + "System", + Doc.Concat( + ".", + "Threading" + ), + Doc.Concat( + ".", + "Tasks" + ), + Doc.Concat( + ".", + "Task" + ), + Doc.Concat( + ".", + "Delay" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + ")" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "AsyncAnonymous", + "(", + Doc.Concat( + ")", + Doc.TrailingComment("// C # 5 feature", CommentType.SingleLine) + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "task", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "394c76a2-c6f9-4ea2-8edc-a55690e3726a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "Task", + Doc.Concat( + ".", + "Factory" + ), + Doc.Concat( + ".", + "StartNew" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Null, + Doc.Group( + "async", + " " + ), + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "WebClient", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + Doc.Concat( + ".", + "DownloadStringTaskAsync" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"http://example.com\"" + ), + Doc.SoftLine, + ")" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + ")" + ) + ), + "394c76a2-c6f9-4ea2-8edc-a55690e3726a" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "ConsoleApplication1", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "RecursiveGenericBaseType", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "A", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null + ) + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ) + ) + ), + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "virtual", + " " + ) + ) + ), + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "abstract", + " " + ) + ) + ), + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "N", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Null + ), + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "O", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "sealed", + " " + ), + Doc.Concat( + "class", + " " + ), + "B", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T1" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T2" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T1", + ",", + Doc.Line, + "T2" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "override", + " " + ) + ) + ), + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "sealed", + " " + ), + Doc.Concat( + "override", + " " + ) + ) + ), + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "N", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "new", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "O", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "Boo", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "class", + " " + ), + "Bar", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "IComparable" + ) + ) + ) + ), + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + "T", + " ", + "f", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "class", + " " + ), + "Foo", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "U" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Method", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "K" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "V" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "K", + " ", + "k" + ), + ",", + Doc.Line, + Doc.Concat( + "T", + " ", + "t" + ), + ",", + Doc.Line, + Doc.Concat( + "U", + " ", + "u" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + "where", + " " + ), + "K", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "V" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "U" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "V", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "K" + ), + Doc.Null, + ">" + ) + ) + ) + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "M", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "M", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "Test", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Bar3", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "x", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "7c75d05b-fbfd-49d8-96cd-7a2199b83f5a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + Doc.Concat( + "Boo", + ".", + Doc.Group( + "Bar", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + ".", + Doc.Group( + "Foo", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "object" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "7c75d05b-fbfd-49d8-96cd-7a2199b83f5a" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "x", + Doc.Concat( + ".", + Doc.Group( + "Method", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "\" \"", + ",", + Doc.Line, + "5", + ",", + Doc.Line, + Doc.Group( + Doc.Concat( + "new", + " " + ), + "object", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "x" + ), + Doc.Concat( + Doc.Concat( + ".", + Doc.Group( + "Method", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "\" \"", + ",", + Doc.Line, + "5", + ",", + Doc.Line, + Doc.Group( + Doc.Concat( + "new", + " " + ), + "object", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "q", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "from", + " " + ), + Doc.Null, + Doc.Concat( + "i", + " " + ), + Doc.Concat( + "in", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3", + ",", + Doc.Line, + "4" + ) + ), + Doc.Line, + "}" + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "where", + Doc.Indent( + Doc.Line, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + ">", + " ", + "5" + ) + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + "i" + ) + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Concat( + "implicit", + " " + ), + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "Test", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + " ", + "s" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "ConsoleApplication1", + ".", + "Test" + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Concat( + "explicit", + " " + ), + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "Test", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + " ", + "s", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"\"" + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Test", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "foo", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Bar2", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "foo", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "6" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Group( + "this", + Doc.Concat( + ".", + "Foo" + ) + ), + " " + ), + "=", + Doc.GroupWithId( + "8c6f7dd1-61a7-42e5-b23d-2eb55b23d00c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "5", + Doc.Concat( + ".", + "GetType" + ), + Doc.Group( + "(", + ")" + ) + ), + "8c6f7dd1-61a7-42e5-b23d-2eb55b23d00c" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Test", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"sss\"" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Concat( + "event", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "EventHandler", + " ", + "MyEvent", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "7109991a-a8a6-4220-8c1a-b9b0cacd2f52", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + "delegate", + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ), + "7109991a-a8a6-4220-8c1a-b9b0cacd2f52" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Blah", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "j", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "6" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Expression", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "e", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "ae042541-1157-42f8-a84f-4349c16e9757", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "i" + ) + ) + ), + "ae042541-1157-42f8-a84f-4349c16e9757" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Expression", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "bool", + ",", + Doc.Line, + "Action" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "e2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c2dc7e10-940b-4ecb-8b57-0514eee2a3c1", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Null, + "b", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + "c2dc7e10-940b-4ecb-8b57-0514eee2a3c1" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "bool", + ",", + Doc.Line, + "bool" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "f", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b567e969-dbef-4664-be32-617802ee415d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Group( + "async", + " " + ), + "delegate", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "bool", + " ", + "a" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Concat( + "!", + "a" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + "b567e969-dbef-4664-be32-617802ee415d" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "int", + ",", + Doc.Line, + "int" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "f2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "0fa4acd9-2022-4b8b-b7fc-73acc5f40be1", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "a", + ",", + Doc.Line, + "b" + ) + ), + Doc.SoftLine + ), + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + "0fa4acd9-2022-4b8b-b7fc-73acc5f40be1" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "f2", + " " + ), + "=", + Doc.GroupWithId( + "01ab9e1e-40be-468c-9b45-ec3331fef7c9", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "b" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + "01ab9e1e-40be-468c-9b45-ec3331fef7c9" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Action", + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f61601ff-1086-4258-aff0-8ac1eb1dcef5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "Blah", + "f61601ff-1086-4258-aff0-8ac1eb1dcef5" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "f2", + " " + ), + "=", + Doc.GroupWithId( + "2f98beb9-6858-445d-ac10-37214c98084b", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + " ", + Doc.Group( + Doc.Null, + "{", + " ", + "}" + ) + ), + "2f98beb9-6858-445d-ac10-37214c98084b" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "f2", + " " + ), + "=", + Doc.GroupWithId( + "f154c797-f561-4af3-9957-103b0376f5df", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + ";" + ), + Doc.HardLine + ), + "}" + ) + ), + "f154c797-f561-4af3-9957-103b0376f5df" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "delegate", + " " + ), + "Recursive", + " ", + "Recursive", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "Recursive", + " ", + "r" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "delegate", + " " + ), + "Recursive", + " ", + "Recursive", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "A" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "R" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "Recursive", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + ",", + Doc.Line, + "R" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "r" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "Type", + " ", + Doc.Null, + "Foo", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Concat( + Doc.Group( + "[", + Doc.Group( + "Obsolete", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "\"Name\"" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "error", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Null, + "false" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Null, + "get", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "result", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "11a903b7-fdbe-4b1e-bfc9-96396b40c707", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "typeof", + "(", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + ")" + ), + "11a903b7-fdbe-4b1e-bfc9-96396b40c707" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "typeof", + "(", + Doc.Concat( + "int", + "?" + ), + ")" + ), + Doc.Group( + Doc.Line, + "==", + " ", + Doc.Concat( + "typeof", + "(", + Doc.Group( + "Nullable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + ")" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "t", + " " + ), + "=", + Doc.GroupWithId( + "42e70894-b5a2-4aa9-a400-23898870dfa2", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "typeof", + "(", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ) + ), + Doc.Null, + ">" + ) + ), + ")" + ), + "42e70894-b5a2-4aa9-a400-23898870dfa2" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + "typeof", + "(", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + Doc.Null + ), + Doc.Null, + ">" + ) + ), + ")" + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + "set", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "2cb92b95-d778-48bf-9507-fbb28caa3177", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "typeof", + "(", + Doc.Concat( + "System", + ".", + "Int32" + ), + ")" + ), + "2cb92b95-d778-48bf-9507-fbb28caa3177" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "t", + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "t" + ), + Doc.Concat( + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "t", + " " + ), + "=", + Doc.GroupWithId( + "5bd85272-3f4a-4436-9ee8-c12f205ffb95", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "value", + "5bd85272-3f4a-4436-9ee8-c12f205ffb95" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Constants", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "1", + Doc.Concat( + Doc.Line, + "+", + " ", + "2" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "3" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "5" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "global", + "::", + "System" + ), + ".", + "String" + ), + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "\"a\"", + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Group( + "(", + Doc.Concat( + "System", + ".", + "String" + ), + ")", + Doc.Indent( + Doc.SoftLine, + "\"a\"" + ) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"a\"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"a\"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"a\"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"A\"" + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ConstructedType", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "List", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "c", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "58114982-0278-4aac-a39b-835208b97390", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "i", + Doc.Concat( + ".", + "Count" + ) + ), + "58114982-0278-4aac-a39b-835208b97390" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + Doc.Concat( + Doc.Concat( + "Comments", + ".", + "XmlComments" + ), + ".", + "UndocumentedKeywords" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("/// /// Whatever /// /// @@ -632,523 +12139,11834 @@ namespace Comments.XmlComments.UndocumentedKeywords /// /// /// - /// - class /*///*/C - { - void M(T t, U u) - { - // comment - /* *** / */ - /* // - */ - /*s*///comment - // /***/ - /*s*/int /*s*/intValue = 0; - intValue = intValue /*s*/+ 1; - string strValue = /*s*/"hello"; - /*s*/MyClass c = new MyClass(); - string verbatimStr = /*s*/@"\\\\"; - } - } - - //General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324) - class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/*Scen8*/{ } - - class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22/*Scen9*/{ } - - class yield - { - void Foo(__arglist) - { - C c = null; - c.M(5, default(U)); - TypedReference tr = __makeref(c); - Type t = __reftype(tr); - int j = __refvalue(tr, int); - Params(a: t, b: t); - Params(ref c, out c); - } - void Params(ref dynamic a, out dynamic b, params dynamic[] c) { } - void Params( - out dynamic a = 2, - ref dynamic c = default(dynamic), - params dynamic[][] c) { } - - public override string ToString() - { - return base.ToString(); - } - - public partial void OnError(); - - public partial void method() - { - int?[] a = new int?[5]; /*[] bug*/ // YES [] - int[] var = { 1, 2, 3, 4, 5 }; /*,;*/ - int i = a[i]; /*[]*/ - Foo f = new Foo(); /*<> ()*/ - f.method(); /*().*/ - i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ - bool b = true & false | true ^ false; /*& | ^*/ - b = !b; /*!*/ - i = ~i; /*~i*/ - b = i < i && i > i; /*< && >*/ - int? ii = 5; /*? bug*/ // NO ? - int f = true ? 1 : 0; /*? :*/ // YES : - i++; /*++*/ - i--; /*--*/ - b = true && false || true; /*&& ||*/ - i << 5; /*<<*/ - i >> 5; /*>>*/ - b = i == i && i != i && i <= i && i >= i; /*= == && != <= >=*/ - i += 5.0; /*+=*/ - i -= i; /*-=*/ - i *= i; /* *=*/ - i /= i; /*/=*/ - i %= i; /*%=*/ - i &= i; /*&=*/ - i |= i; /*|=*/ - i ^= i; /*^=*/ - i <<= i; /*<<=*/ - i >>= i; /*>>=*/ - object s = x => x + 1; /*=>*/ - double d = .3; - Point point; - unsafe - { - Point* p = &point; /* * &*/ - p->x = 10; /*->*/ - } - IO::BinaryReader br = null; - x[i: 1] = 3; - x[i: 1, j: 5] = "str"; - } - - struct Point - { - public int X; - public int Y; - public void ThisAccess() - { - this = this; - } - } - } - - // From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6 - class CSharp6Features - { - // Initializers for auto-properties - public string First { get; set; } = "Jane"; - public string Last { get; set; } = "Doe"; - - // Getter-only auto-properties - public string Third { get; } = "Jane"; - public string Fourth { get; } = "Doe"; - - // Expression bodies on method-like members - public Point Move(int dx, int dy) => new Point(x + dx, y + dy); - public static Complex operator +(Complex a, Complex b) => a.Add(b); - public static implicit operator string(Person p) => - p.First + " " + p.Last; - public void Print() => Console.WriteLine(First + " " + Last); - - // Expression bodies on property-like function members - public string Name => First + " " + Last; - public int this[long id] => id; - - async void Test() - { - // Using static - WriteLine(Sqrt(3 * 3 + 4 * 4)); - WriteLine(Friday - Monday); - var range = Range(5, 17); // Ok: not extension - var even = range.Where(i => i % 2 == 0); // Ok - - // Null-conditional operators - int? length = customers?.Length; // null if customers is null - Customer first = customers?[0]; // null if customers is null - int length = customers?.Length ?? 0; // 0 if customers is null - int? first = customers?[0]?.Orders?.Count(); - PropertyChanged?.Invoke(this, args); - - // String interpolation - string s = $"{p.Name, 20} is {p.Age:D3} year{{s}} old #"; - s = $"{p.Name} is \"{p.Age} year{(p.Age == 1 ? "" : "s")} old"; - s = $"{(p.Age == 2 ? $"{new Person { }}" : "")}"; - s = $@"\{p.Name} - ""\"; - s = $"Color [ R={func(b: 3):#0.##}, G={G:#0.##}, B={B:#0.##}, A={A:#0.##} ]"; - - // nameof expressions - if (x == null) - { - throw new ArgumentNullException(nameof(x)); - } - - WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode" - - // Index initializers - var numbers = new Dictionary - { - [7] = "seven", - [9] = "nine", - [13] = "thirteen" - }; - - // Exception filters - try { } - catch (MyException e) when (myfilter(e)) { } - - // Await in catch and finally blocks - Resource res = null; - try - { - res = await Resource.OpenAsync(); // You could do this. - } - catch (ResourceException e) - { - await Resource.LogAsync(res, e); // Now you can do this … - } - finally - { - if (res != null) - { - await res.CloseAsync(); // … and this. - } - } - } - } -} -#line 6 -#line 2 "test.cs" -#line default -#line hidden - -class CSharp70 -{ - void PatternMatching(string arg, int b) - { - switch (arg) - { - case "A" when b > 50: - case "B" when b < 50: - default: - break; - } - - (A D, E H) = e; - - if (x?.y?.z is Type value2) - { - // code using value - } - - if (expr is Type v) - { - Hello(); - } - } - - public static async Task LocalFunctions(string[] args) - { - string Hello2(int i) - { - return args[i]; - } - - async Task Hello(T i) => await Task.FromResult(args[i]); - await Hello(1); - } - - public static void OutVar(string[] args) - { - int.TryParse(Hello(1), out var item); - int.TryParse(Hello(1), out int item); - } - - public void ThrowExpression() - { - var result = nullableResult ?? throw new NullReferenceException(); - } - - public void BinaryLiterals() - { - int nineteen = 0b10011; - } - - public void DigitSeparators() - { - int bin = 0b1001_1010_0001_0100; - int hex = 0x1b_a0_44_fe; - int dec = 33_554_432; - int weird = 1_2__3___4____5_____6______7_______8________9; - double real = 1_000.111_1e-1_000; - } -} - -class CSharp71 -{ - void DefaultWithoutTypeName(string content = default) - { - DefaultWithoutTypeName(default); - } - - void TupleRecognize(int a, (int, int) b, (int, int, int)? c) - { - var result = list.Select(c => (c.f1, f3: c.f2)).Where(t => t.f2 == 1); - } -} - -class CSharp72 -{ - readonly struct ReadonlyRef1 - { - Func s = (in int x) => x; - ref TValue this[in TKey index] => null; - public static Vector3 operator +(in Vector3 x, in Vector3 y) => null; - - static readonly ref Vector3 M1_Trace() - { - // OK - ref readonly var r1 = ref M1(); - - // Not valid. Need an LValue - ref readonly Vector3 r2 = ref default(Vector3); - - // Not valid. r1 is readonly. - Mutate(ref r1); - - // OK. - Print(in r1); - - // OK. - return ref r1; - } - } - - ref struct ReadonlyRef2 - { - ref readonly Guid Test(in Vector3 v1, in Vector3 v2) - { - // not OK!! - v1 = default(Vector3); - - // not OK!! - v1.X = 0; - - // not OK!! - foo(ref v1.X); - - return ref (arr != null ? ref arr[0] : ref otherArr[0]); - - Span span = stackalloc int[1]; - - // OK - return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); - } - - ref T Choice(bool condition, ref T consequence, ref T alternative) - { - if (condition) - { - return ref consequence; - } - else - { - return ref alternative; - } - } - } - - public void DoSomething(bool isEmployed, string personName, int personAge) - { } - - public void NonTrailingNamedArguments() - { - DoSomething(isEmployed: true, name, age); // currently CS1738, but would become legal - DoSomething(true, personName: name, age); // currently CS1738, but would become legal - DoSomething(name, isEmployed: true, age); // remains illegal - DoSomething(name, age, isEmployed: true); // remains illegal - DoSomething(true, personAge: age, personName: name); // already legal - } - - public void ConditionalRef() - { - ref var r = ref (arr != null ? ref arr[0] : ref otherArr[0]); - } - - public void LeadingSeparator() - { - var res = 0 - + 123 // permitted in C# 1.0 and later - + 1_2_3 // permitted in C# 7.0 and later - + 0x1_2_3 // permitted in C# 7.0 and later - + 0b101 // binary literals added in C# 7.0 - + 0b1_0_1 // permitted in C# 7.0 and later - - // in C# 7.2, _ is permitted after the `0x` or `0b` - + 0x_1_2 // permitted in C# 7.2 and later - + 0b_1_0_1 // permitted in C# 7.2 and later - ; - } -} - -class CSharp73 -{ - void Blittable(T value) - where T : unmanaged - { - var unmanaged = 666; - } - - unsafe struct IndexingMovableFixed - { - public fixed int myFixedField[10]; - } - - static IndexingMovableFixed s; - - public unsafe void IndexingMovableFixedFields() - { - int* ptr = s.myFixedField; - int t = s.myFixedField[5]; - } - - public void PatternBasedFixed() - { - fixed (byte* ptr = byteArray) - { - // ptr is a native pointer to the first element of the array - // byteArray is protected from being moved/collected by the GC for the duration of this block - } - } - - public void StackallocArrayInitializer() - { - Span a = stackalloc int[3]; // currently allowed - Span a = stackalloc int[3] { 1, 2, 3 }; - Span a = stackalloc int[] { 1, 2, 3 }; - Span a = stackalloc[] { 1, 2, 3 }; - } - - public void TupleEquality() - { - (int, (int, int)) t1, t2; - var res = t1 == (1, (2, 3)); - } -} - -namespace CSharp80 -{ - class CSharp80ExceptInterfaceDefaultImplement - { - void ReferenceNullable() - { - var? x = E; - x!.ToString(); - string? wtf = null; - int?[]? hello; - } - - void Patterns() - { - if (o is string { Length: 5 } s) - { - Do(); - } - - return lang.CountOfTokens switch - { - 1 => 100, - 2 => 200, - _ => throw new global::System.Exception() - }; - - var newState = (GetState(), action, hasKey) switch - { - (DoorState.Closed, Action.Open, _) => DoorState.Opened, - (DoorState.Opened, Action.Close, _) => DoorState.Closed, - (DoorState.Closed, Action.Lock, true) => DoorState.Locked, - (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, - (var state, _, _) => state - }; - } - - async Task AsyncStreams() - { - await foreach (var item in asyncEnumerables) { } - } - - void Ranges() - { - var thirdItem = list[2]; // list[2] - var lastItem = list[^1]; // list[Index.CreateFromEnd(1)] - var multiDimensional = list[3, ^2]; // list[3, Index.CreateFromEnd(2)] - - var slice1 = list[2..^3]; // list[Range.Create(2, Index.CreateFromEnd(3))] - var slice2 = list[..^3]; // list[Range.ToEnd(Index.CreateFromEnd(3))] - var slice3 = list[2..]; // list[Range.FromStart(2)] - var slice4 = list[..]; // list[Range.All] - var multiDimensional = list[1..2, ..]; // list[Range.Create(1, 2), Range.All] - } - - void UsingDeclarators() - { - using var item = new FileStream("./.f"); - fixed (char* ch = "hell"); - item.Dispose(); - } - - void StaticLocalFunction() - { - static unsafe void Func1() { } - static unsafe void Func1() { } - async static void Func2() { } - static async void Func2() { } - } - - void NullCoalescingAssignment() - { - var item = a ??= b ??= c ??= d ??= throw new Exception(); - } - - public readonly float Hello() - { - return 0.1f; - } - } - - interface IA - { - void M() - { - WriteLine("IA.M"); - } - } - - interface IA - { - void M() - { - WriteLine("IA.M"); - } - } - - interface IB : IA - { - override void IA.M() // explicitly named - { - WriteLine("IB.M"); - } - } - - interface IC : IA - { - override void M() // implicitly named - { - WriteLine("IC.M"); - } - } -} - + /// ", CommentType.SingleLine), + Doc.HardLineSkipBreakIfFirstInGroup + ), + "class", + Doc.Concat( + " ", + Doc.TrailingComment("/*///*/", CommentType.MultiLine) + ), + " " + ), + "C", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "M", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "U" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "T", + " ", + "t" + ), + ",", + Doc.Line, + Doc.Concat( + "U", + " ", + "u" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// comment", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /* *** / */", CommentType.MultiLine), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /* // + */", CommentType.MultiLine), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /*s*/", CommentType.MultiLine), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment("//comment", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment("// /***/", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /*s*/", CommentType.MultiLine) + ), + "int", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + " ", + "intValue", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "intValue", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "intValue", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + Doc.Group( + Doc.Line, + "+", + " ", + "1" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "strValue", + Doc.Null + ), + " " + ), + Doc.Concat( + "=", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + Doc.Group( + Doc.Indent( + Doc.Line, + "\"hello\"" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment(" /*s*/", CommentType.MultiLine), + "MyClass" + ), + " ", + "c", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8b658bde-1b9e-453b-aede-f77f35b2d67c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyClass", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "8b658bde-1b9e-453b-aede-f77f35b2d67c" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "verbatimStr", + Doc.Null + ), + " " + ), + Doc.Concat( + "=", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + Doc.Group( + Doc.Indent( + Doc.Line, + "@\"\\\\\"" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("//General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324)", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "class", + " " + ), + Doc.Concat( + "TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + Doc.Concat( + " ", + Doc.TrailingComment("/*Scen8*/", CommentType.MultiLine) + ) + ), + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + Doc.Concat( + "TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22", + Doc.Concat( + " ", + Doc.TrailingComment("/*Scen9*/", CommentType.MultiLine) + ) + ), + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "yield", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Foo", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "U" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "__arglist" + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "C", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "U" + ), + Doc.Null, + ">" + ) + ), + " ", + "c", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "c", + Doc.Concat( + ".", + Doc.Group( + "M", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + Doc.Concat( + "default", + "(", + "U", + ")" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c" + ), + Doc.Concat( + Doc.Concat( + ".", + Doc.Group( + "M", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + Doc.Concat( + "default", + "(", + "U", + ")" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "TypedReference", + " ", + "tr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "4b0db837-fb22-469b-99af-75b2f041b343", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "__makeref", + "(", + "c", + ")" + ), + "4b0db837-fb22-469b-99af-75b2f041b343" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Type", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "e4af2869-262f-4067-b2c4-9e8687d18d9e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "__reftype", + "(", + "tr", + ")" + ), + "e4af2869-262f-4067-b2c4-9e8687d18d9e" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "j", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "ae971dc4-60c8-45a0-a5e2-aa7cb949035d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "__refvalue", + "(", + "tr", + Doc.Concat( + ",", + " " + ), + "int", + ")" + ), + "ae971dc4-60c8-45a0-a5e2-aa7cb949035d" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "a", + Doc.Concat( + ":", + " " + ) + ), + "t" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "t" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "a", + Doc.Concat( + ":", + " " + ) + ), + "t" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "t" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "c" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + "c" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "c" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + "c" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Params", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "dynamic", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "out", + " " + ), + "dynamic", + " ", + "b" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "params", + " " + ), + Doc.Concat( + "dynamic", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "c" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Params", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "out", + " " + ), + "dynamic", + " ", + "a", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "2" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "dynamic", + " ", + "c", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + "default", + "(", + "dynamic", + ")" + ) + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "params", + " " + ), + Doc.Concat( + "dynamic", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "c" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "override", + " " + ) + ) + ), + "string", + " ", + "ToString", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "base", + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "base" + ), + Doc.Concat( + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "partial", + " " + ) + ) + ), + "void", + " ", + "OnError", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "partial", + " " + ) + ) + ), + "void", + " ", + "method", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "edfa4869-8cc0-43f4-b070-4b1486dacaea", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + Doc.Null + ), + "edfa4869-8cc0-43f4-b070-4b1486dacaea" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*[] bug*/", CommentType.MultiLine), + Doc.TrailingComment("// YES []", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "var", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3", + ",", + Doc.Line, + "4", + ",", + Doc.Line, + "5" + ) + ), + Doc.Line, + "}" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*,;*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "e578ae16-adb7-497c-bb6e-e89f48015e93", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "a", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ), + "e578ae16-adb7-497c-bb6e-e89f48015e93" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*[]*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Foo", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "f", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Group( + "Foo", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*<> ()*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "f", + Doc.Concat( + ".", + "method" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "f" + ), + Doc.Concat( + Doc.Concat( + ".", + "method" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*().*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Concat( + Doc.Line, + "+", + " ", + "i" + ), + Doc.Concat( + Doc.Line, + "-", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Concat( + Doc.Line, + "*", + " ", + "i" + ), + Doc.Concat( + Doc.Line, + "/", + " ", + "i" + ), + Doc.Concat( + Doc.Line, + "%", + " ", + "i" + ) + ) + ) + ) + ) + ), + Doc.Indent( + Doc.Line, + "&", + " ", + "i" + ) + ), + Doc.Concat( + Doc.Line, + "|", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "^", + " ", + "i" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*+ - * / % & | ^*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "bool", + " ", + "b", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "true", + Doc.Indent( + Doc.Group( + Doc.Line, + "&", + " ", + "false" + ) + ) + ), + Doc.Concat( + Doc.Line, + "|", + " ", + Doc.Group( + "true", + Doc.Indent( + Doc.Group( + Doc.Line, + "^", + " ", + "false" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*& | ^*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.GroupWithId( + "d406edfe-e349-416b-8cc2-7ab3dd7b7d58", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "!", + "b" + ), + "d406edfe-e349-416b-8cc2-7ab3dd7b7d58" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*!*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "=", + Doc.GroupWithId( + "644e57c9-adb6-4301-a1aa-165925d70413", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "~", + "i" + ), + "644e57c9-adb6-4301-a1aa-165925d70413" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*~i*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "i" + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + ">", + " ", + "i" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*< && >*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "ii", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*? bug*/", CommentType.MultiLine), + Doc.TrailingComment("// NO ?", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "f", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8880990e-cc2c-45bb-a034-31e568c5ee9a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Null, + "true", + Doc.Indent( + Doc.Line, + Doc.Concat( + "?", + " " + ), + "1", + Doc.Line, + Doc.Concat( + ":", + " " + ), + "0" + ) + ), + "8880990e-cc2c-45bb-a034-31e568c5ee9a" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*? :*/", CommentType.MultiLine), + Doc.TrailingComment("// YES :", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "i", + "++" + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*++*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "i", + "--" + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*--*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "true", + Doc.Indent( + Doc.Group( + Doc.Line, + "&&", + " ", + "false" + ) + ) + ), + Doc.Concat( + Doc.Line, + "||", + " ", + "true" + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*&& ||*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<<", + " ", + "5" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*<<*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + ">>", + " ", + "5" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*>>*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "==", + " ", + "i" + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "!=", + " ", + "i" + ) + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<=", + " ", + "i" + ) + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + ">=", + " ", + "i" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*= == && != <= >=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "+=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5.0" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*+=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "-=", + Doc.GroupWithId( + "becba704-5ea6-452f-9568-a4d0d720b538", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "becba704-5ea6-452f-9568-a4d0d720b538" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*-=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "*=", + Doc.GroupWithId( + "274067fa-e379-4036-a130-2b7ede2cbc08", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "274067fa-e379-4036-a130-2b7ede2cbc08" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/* *=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "/=", + Doc.GroupWithId( + "1bfced1d-8edb-4fb8-bd74-35252de81e33", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "1bfced1d-8edb-4fb8-bd74-35252de81e33" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*/=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "%=", + Doc.GroupWithId( + "30b0d10d-9db5-4f12-9ea7-28542f111ab5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "30b0d10d-9db5-4f12-9ea7-28542f111ab5" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*%=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "&=", + Doc.GroupWithId( + "35f90cbb-523e-4227-9838-8ad9dd5f4945", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "35f90cbb-523e-4227-9838-8ad9dd5f4945" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*&=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "|=", + Doc.GroupWithId( + "0e9fe4e1-8e59-417c-b5d3-370551c8b4e7", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "0e9fe4e1-8e59-417c-b5d3-370551c8b4e7" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*|=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "^=", + Doc.GroupWithId( + "18d88905-6458-4325-824b-599c496c4dd4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "18d88905-6458-4325-824b-599c496c4dd4" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*^=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "<<=", + Doc.GroupWithId( + "0d38349a-02a4-4028-a11f-493343f5100e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "0d38349a-02a4-4028-a11f-493343f5100e" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*<<=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + ">>=", + Doc.GroupWithId( + "a98afdec-03b7-4f4e-bb23-76f31d633e0e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "a98afdec-03b7-4f4e-bb23-76f31d633e0e" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*>>=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "object", + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b9e03904-ed44-42eb-aed9-6d152a2f0def", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Null, + "x", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + "x", + Doc.Group( + Doc.Line, + "+", + " ", + "1" + ) + ) + ) + ), + "b9e03904-ed44-42eb-aed9-6d152a2f0def" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*=>*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "double", + " ", + "d", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + ".3" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "Point", + " ", + "point", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + "unsafe", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "Point", + "*" + ), + " ", + "p", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "6ef52daf-5aec-406f-b158-04a1a107db0e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "&", + "point" + ), + "6ef52daf-5aec-406f-b158-04a1a107db0e" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/* * &*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + "->", + "x" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "10" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*->*/", CommentType.MultiLine) + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "IO", + "::", + "BinaryReader" + ), + " ", + "br", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "x", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "i", + Doc.Concat( + ":", + " " + ) + ), + "1" + ) + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "3" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "x", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "i", + Doc.Concat( + ":", + " " + ) + ), + "1" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "j", + Doc.Concat( + ":", + " " + ) + ), + "5" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"str\"" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "struct", + " " + ), + "Point", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + "int", + " ", + "X", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + "int", + " ", + "Y", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ThisAccess", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "this", + " " + ), + "=", + Doc.GroupWithId( + "c07ade19-82b4-4e54-a36d-5b2512c1cd51", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "this", + "c07ade19-82b4-4e54-a36d-5b2512c1cd51" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "class", + " " + ), + "CSharp6Features", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Initializers for auto-properties", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "public" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "First", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Jane\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Last", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Doe\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Getter-only auto-properties", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "public" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Third", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Jane\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Fourth", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Doe\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.LeadingComment("// Expression bodies on method-like members", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "Point", + " ", + "Move", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "dx" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "dy" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Point", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "x", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "dx" + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + "y", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "dy" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "Complex", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "Complex", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + "Complex", + " ", + "b" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.ConditionalGroup( + Doc.Concat( + "a", + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "b" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "a" + ), + Doc.Concat( + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "b" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Concat( + "implicit", + " " + ), + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "string", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "Person", + " ", + "p" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + ".", + "First" + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\" \"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Group( + "p", + Doc.Concat( + ".", + "Last" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Print", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + "Console", + Doc.Concat( + ".", + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "First", + Doc.Indent( + Doc.Concat( + Doc.Line, + "+", + " ", + "\" \"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "Last" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Expression bodies on property-like function members", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "public" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Name", + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + "First", + Doc.Concat( + Doc.Line, + "+", + " ", + "\" \"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "Last" + ) + ) + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "int", + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + "long", + " ", + "id" + ), + "]" + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + "id" + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + "void", + " ", + "Test", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Using static", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Using static", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Friday", + Doc.Indent( + Doc.Group( + Doc.Line, + "-", + " ", + "Monday" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Friday", + Doc.Indent( + Doc.Group( + Doc.Line, + "-", + " ", + "Monday" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "range", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "0db9b134-9720-4b8e-b29a-9cc510b61400", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.ConditionalGroup( + Doc.Concat( + "Range", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + "17" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Range", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + "17" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + "0db9b134-9720-4b8e-b29a-9cc510b61400" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// Ok: not extension", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "even", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "a215466b-65aa-4344-843d-a16a9e8f8165", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "range", + Doc.Concat( + ".", + "Where" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "i", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "%", + " ", + "2" + ) + ) + ), + Doc.Concat( + Doc.Line, + "==", + " ", + "0" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + "a215466b-65aa-4344-843d-a16a9e8f8165" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// Ok", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Null-conditional operators", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "int" + ), + "?" + ), + " ", + "length", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "d8175282-8074-4a03-8763-9ae7a0f373ed", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "customers", + "?", + Doc.Concat( + ".", + "Length" + ) + ), + "d8175282-8074-4a03-8763-9ae7a0f373ed" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// null if customers is null", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Customer", + " ", + "first", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "4d22206d-c335-47eb-8ab9-d159b0e39b0e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "customers", + "?", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ), + "4d22206d-c335-47eb-8ab9-d159b0e39b0e" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// null if customers is null", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "length", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "customers", + "?", + Doc.Concat( + ".", + "Length" + ) + ), + Doc.Group( + Doc.Line, + "??", + " ", + "0" + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// 0 if customers is null", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "first", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "6c8cfd2b-60e3-41d1-be8b-c95be0ebc673", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "customers", + "?", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ), + "?", + Doc.Concat( + ".", + "Orders" + ), + "?", + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + "6c8cfd2b-60e3-41d1-be8b-c95be0ebc673" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "PropertyChanged", + "?", + Doc.Concat( + ".", + "Invoke" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "this", + ",", + Doc.Line, + "args" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// String interpolation", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "string" + ), + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Name" + ) + ), + Doc.Concat( + ",", + " " + ), + "20", + "}" + ), + " is ", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + ":", + "D3", + "}" + ), + " year{{s}} old #", + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Name" + ) + ), + "}" + ), + " is \\"", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + "}" + ), + " year", + Doc.Concat( + "{", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + Doc.Group( + " ", + "==", + " ", + "1" + ) + ), + Doc.Indent( + " ", + Doc.Concat( + "?", + " " + ), + "\"\"", + " ", + Doc.Concat( + ":", + " " + ), + "\"s\"" + ) + ) + ), + "", + ")" + ), + "}" + ), + " old", + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + Doc.Group( + " ", + "==", + " ", + "2" + ) + ), + Doc.Indent( + " ", + Doc.Concat( + "?", + " " + ), + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Person", + Doc.Null, + Doc.Concat( + " ", + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + " ", + Doc.Null + ), + Doc.Null, + "}" + ) + ) + ), + "}" + ), + "\"" + ) + ), + " ", + Doc.Concat( + ":", + " " + ), + "\"\"" + ) + ) + ), + "", + ")" + ), + "}" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$@\"", + "\", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Name" + ) + ), + "}" + ), + Doc.Concat( + "", + Doc.LiteralLine, + " \"\"\" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + "Color [ R=", + Doc.Concat( + "{", + Doc.ConditionalGroup( + Doc.Concat( + "func", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "3" + ) + ), + "", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "func", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "3" + ) + ), + "", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ":", + "#0.##", + "}" + ), + ", G=", + Doc.Concat( + "{", + "G", + ":", + "#0.##", + "}" + ), + ", B=", + Doc.Concat( + "{", + "B", + ":", + "#0.##", + "}" + ), + ", A=", + Doc.Concat( + "{", + "A", + ":", + "#0.##", + "}" + ), + " ]", + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// nameof expressions", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "if" + ), + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "x", + Doc.Group( + Doc.Line, + "==", + " ", + "null" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + Doc.Group( + Doc.Concat( + "new", + " " + ), + "ArgumentNullException", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "x" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "x" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// prints "ZipCode"", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Index initializers", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "var" + ), + " ", + "numbers", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f2403c6d-27b2-4808-8f58-90c75370f95d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Group( + "Dictionary", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null, + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Group( + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "7" + ), + Doc.SoftLine, + "]" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"seven\"" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "9" + ), + Doc.SoftLine, + "]" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"nine\"" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "13" + ), + Doc.SoftLine, + "]" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"thirteen\"" + ) + ) + ) + ) + ), + Doc.HardLine, + "}" + ) + ) + ), + "f2403c6d-27b2-4808-8f58-90c75370f95d" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Exception filters", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "try" + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + "MyException", + " ", + "e", + ")" + ), + Doc.Indent( + Doc.Line, + Doc.Concat( + "when", + " " + ), + "(", + Doc.Group( + Doc.Indent( + Doc.ConditionalGroup( + Doc.Concat( + "myfilter", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "e" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "myfilter", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "e" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Await in catch and finally blocks", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Resource" + ), + " ", + "res", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "try", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "res", + " " + ), + "=", + Doc.GroupWithId( + "b7f21849-6b08-47a9-8990-b72920ed4257", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + "Resource", + Doc.Concat( + ".", + "OpenAsync" + ), + Doc.Group( + "(", + ")" + ) + ) + ), + "b7f21849-6b08-47a9-8990-b72920ed4257" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// You could do this.", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + "ResourceException", + " ", + "e", + ")" + ), + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + "Resource", + Doc.Concat( + ".", + "LogAsync" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "res", + ",", + Doc.Line, + "e" + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// Now you can do this …", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "finally", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "res", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "res", + Doc.Concat( + ".", + "CloseAsync" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "res" + ), + Doc.Concat( + Doc.Concat( + ".", + "CloseAsync" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// … and this.", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line 6"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line 2 \"test.cs\""), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line default"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line hidden"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "class", + " " + ), + "CSharp70", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "PatternMatching", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + " ", + "arg" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "b" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "switch", + " ", + "(", + Doc.GroupWithId( + "8af19237-49a9-472d-93e9-1eaf4545a61e", + Doc.Indent( + Doc.SoftLine, + "arg" + ), + Doc.SoftLine + ), + ")", + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + "\"A\"", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + "when", + " " + ), + Doc.Group( + "b", + Doc.Indent( + Doc.Group( + Doc.Line, + ">", + " ", + "50" + ) + ) + ) + ) + ), + ":" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + "\"B\"", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + "when", + " " + ), + Doc.Group( + "b", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "50" + ) + ) + ) + ) + ), + ":" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "default", + ":" + ) + ), + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "D" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "E", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "F", + ",", + Doc.Line, + "G" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "H" + ) + ) + ), + Doc.SoftLine, + ")" + ), + " " + ), + "=", + Doc.GroupWithId( + "15eac235-74a3-499a-8e8e-a103a0b0c953", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "e", + "15eac235-74a3-499a-8e8e-a103a0b0c953" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "x", + "?", + Doc.Concat( + ".", + "y" + ), + "?", + Doc.Concat( + ".", + "z" + ) + ), + Doc.Line, + "is", + " ", + Doc.Concat( + "Type", + " ", + "value2" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + " ", + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Indent( + Doc.LeadingComment("// code using value", CommentType.SingleLine), + Doc.Null + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "expr", + Doc.Line, + "is", + " ", + Doc.Concat( + "Type", + " ", + "v" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ), + Doc.Concat( + "async", + " " + ) + ) + ), + "Task", + " ", + "LocalFunctions", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "args" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + "string", + " ", + "Hello2", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "i" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + "args", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + Doc.Group( + "Task", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "string" + ), + Doc.Null, + ">" + ) + ), + " ", + "Hello", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "i" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "Task", + Doc.Concat( + ".", + "FromResult" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "args", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Task" + ), + Doc.Concat( + Doc.Concat( + ".", + "FromResult" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "args", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "void", + " ", + "OutVar", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "args" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "int", + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "var", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "int" + ), + Doc.Concat( + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "var", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "int", + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "int", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "int" + ), + Doc.Concat( + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "int", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ThrowExpression", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "result", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "nullableResult", + Doc.Group( + Doc.Line, + "??", + " ", + Doc.Concat( + Doc.Concat( + "throw", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "NullReferenceException", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "BinaryLiterals", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "nineteen", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0b10011" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "DigitSeparators", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "bin", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0b1001_1010_0001_0100" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "hex", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0x1b_a0_44_fe" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "dec", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "33_554_432" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "weird", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1_2__3___4____5_____6______7_______8________9" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "double", + " ", + "real", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1_000.111_1e-1_000" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp71", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "DefaultWithoutTypeName", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + " ", + "content", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "default" + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DefaultWithoutTypeName", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "default" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DefaultWithoutTypeName", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "default" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "TupleRecognize", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + " ", + "b" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + "?" + ), + " ", + "c" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "result", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "e381c2c4-b465-4c37-b487-f9102a7adea8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.ConditionalGroup( + Doc.Concat( + "list", + Doc.Concat( + ".", + "Select" + ), + Doc.Group( + Doc.Indent( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "c", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "c", + Doc.Concat( + ".", + "f1" + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "f3", + Doc.Concat( + ":", + " " + ) + ), + Doc.Group( + "c", + Doc.Concat( + ".", + "f2" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + ".", + "Where" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "t", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "t", + Doc.Concat( + ".", + "f2" + ) + ), + Doc.Group( + Doc.Line, + "==", + " ", + "1" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "list" + ), + Doc.Concat( + Doc.Concat( + ".", + "Select" + ), + Doc.Group( + Doc.Indent( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "c", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "c", + Doc.Concat( + ".", + "f1" + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "f3", + Doc.Concat( + ":", + " " + ) + ), + Doc.Group( + "c", + Doc.Concat( + ".", + "f2" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "Where" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "t", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "t", + Doc.Concat( + ".", + "f2" + ) + ), + Doc.Group( + Doc.Line, + "==", + " ", + "1" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ) + ) + ), + "e381c2c4-b465-4c37-b487-f9102a7adea8" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp72", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + "readonly", + " " + ), + Doc.Concat( + "struct", + " " + ), + "ReadonlyRef1", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "int" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "4640105a-3e39-4fad-adf5-9cecb2fbfc56", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "in", + " " + ), + "int", + " ", + "x" + ) + ), + Doc.SoftLine + ), + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "x" + ) + ) + ), + "4640105a-3e39-4fad-adf5-9cecb2fbfc56" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "TValue" + ), + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + Doc.Group( + "in", + " " + ), + "TKey", + " ", + "index" + ), + "]" + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + "null" + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "Vector3", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "x" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "y" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + "null" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "readonly", + " " + ) + ) + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "Vector3" + ), + " ", + "M1_Trace", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "ref", + " " + ), + Doc.Concat( + "readonly", + " " + ), + "var" + ), + " ", + "r1", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "6c899e58-6ec4-4dea-9ab9-254d96e4470c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "M1", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "M1", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + "6c899e58-6ec4-4dea-9ab9-254d96e4470c" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Not valid. Need an LValue", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "ref", + " " + ), + Doc.Concat( + "readonly", + " " + ), + "Vector3" + ), + " ", + "r2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f65b4780-52b8-4121-89db-0ade054bc029", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "default", + "(", + "Vector3", + ")" + ) + ), + "f65b4780-52b8-4121-89db-0ade054bc029" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Not valid. r1 is readonly.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Mutate" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Not valid. r1 is readonly.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Mutate" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Print" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "in", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Print" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "in", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "r1" + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + Doc.Concat( + "struct", + " " + ), + "ReadonlyRef2", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "readonly", + " " + ), + "Guid" + ), + " ", + "Test", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "v1" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "v2" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "v1" + ), + " " + ), + "=", + Doc.GroupWithId( + "362cee1e-000a-4da1-9851-32f831378200", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "default", + "(", + "Vector3", + ")" + ), + "362cee1e-000a-4da1-9851-32f831378200" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "v1" + ), + Doc.Concat( + ".", + "X" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "foo" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "v1", + Doc.Concat( + ".", + "X" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "foo" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "v1", + Doc.Concat( + ".", + "X" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + Doc.Group( + "arr", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ), + Doc.Indent( + Doc.Line, + Doc.Concat( + "?", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.Line, + Doc.Concat( + ":", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "otherArr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "span", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "return", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Vector3", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + Doc.Group( + "v1", + Doc.Concat( + ".", + "X" + ) + ), + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + Doc.Group( + "v2", + Doc.Concat( + ".", + "X" + ) + ) + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "v1", + Doc.Concat( + ".", + "Y" + ) + ), + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + Doc.Group( + "v2", + Doc.Concat( + ".", + "Y" + ) + ) + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "v1", + Doc.Concat( + ".", + "Z" + ) + ), + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + Doc.Group( + "v2", + Doc.Concat( + ".", + "Z" + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "T" + ), + " ", + "Choice", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "bool", + " ", + "condition" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "T", + " ", + "consequence" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "T", + " ", + "alternative" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "condition" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "consequence" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "else", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "alternative" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "DoSomething", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "bool", + " ", + "isEmployed" + ), + ",", + Doc.Line, + Doc.Concat( + "string", + " ", + "personName" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "personAge" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "NonTrailingNamedArguments", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "name", + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "name", + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// currently CS1738, but would become legal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// currently CS1738, but would become legal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// remains illegal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + "age", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + "age", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// remains illegal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personAge", + Doc.Concat( + ":", + " " + ) + ), + "age" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personAge", + Doc.Concat( + ":", + " " + ) + ), + "age" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// already legal", CommentType.SingleLine) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ConditionalRef", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "var" + ), + " ", + "r", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "539e4a33-3e3e-4ee1-b05e-0e79da7fa0df", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + Doc.Group( + "arr", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ), + Doc.Indent( + Doc.Line, + Doc.Concat( + "?", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.Line, + Doc.Concat( + ":", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "otherArr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + "539e4a33-3e3e-4ee1-b05e-0e79da7fa0df" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "LeadingSeparator", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "res", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "0", + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "123", + Doc.TrailingComment("// permitted in C# 1.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "1_2_3", + Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0x1_2_3", + Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0b101", + Doc.TrailingComment("// binary literals added in C# 7.0", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0b1_0_1", + Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// in C# 7.2, _ is permitted after the `0x` or `0b`", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "+" + ), + " ", + Doc.Concat( + "0x_1_2", + Doc.TrailingComment("// permitted in C# 7.2 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0b_1_0_1", + Doc.TrailingComment("// permitted in C# 7.2 and later", CommentType.SingleLine) + ) + ) + ) + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp73", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Blittable", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "value" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "unmanaged" + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "unmanaged", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "666" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "unsafe", + " " + ), + Doc.Concat( + "struct", + " " + ), + "IndexingMovableFixed", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "fixed" + ), + " " + ), + Doc.Group( + "int", + " ", + "myFixedField", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "10" + ), + Doc.SoftLine, + "]" + ) + ), + ";" + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "static", + " " + ), + Doc.Group( + "IndexingMovableFixed", + " ", + "s", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "unsafe", + " " + ) + ) + ), + "void", + " ", + "IndexingMovableFixedFields", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + "ptr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "3cb4dcc7-28a5-4683-a6dd-c4aa15566537", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "s", + Doc.Concat( + ".", + "myFixedField" + ) + ), + "3cb4dcc7-28a5-4683-a6dd-c4aa15566537" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "e634d25b-1420-49b9-a607-24138c8159c1", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Group( + "s", + Doc.Concat( + ".", + "myFixedField" + ) + ), + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + "]" + ) + ), + "e634d25b-1420-49b9-a607-24138c8159c1" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "PatternBasedFixed", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "byte", + "*" + ), + " ", + "ptr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "ce1a487b-6150-41fd-9263-24720f871047", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "byteArray", + "ce1a487b-6150-41fd-9263-24720f871047" + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Indent( + Doc.LeadingComment("// ptr is a native pointer to the first element of the array", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment("// byteArray is protected from being moved/collected by the GC for the duration of this block", CommentType.SingleLine), + Doc.Null + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "StackallocArrayInitializer", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// currently allowed", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + Doc.Concat( + " ", + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.Line, + "}" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + Doc.Concat( + " ", + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.Line, + "}" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c4d44acc-e89e-4234-aa0f-88b3ea57bf34", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "stackalloc", + "[", + Doc.Concat( + "]", + " " + ), + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.Line, + "}" + ) + ), + "c4d44acc-e89e-4234-aa0f-88b3ea57bf34" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "TupleEquality", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + " ", + Doc.Indent( + "t1", + ",", + Doc.HardLine, + "t2" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "res", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "t1", + Doc.Group( + Doc.Line, + "==", + " ", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "1", + ",", + Doc.Line, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "CSharp80", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp80ExceptInterfaceDefaultImplement", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "ReferenceNullable", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "var", + "?" + ), + " ", + "x", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f9ca4d0b-aa78-4f50-a17c-c3f6d38caef8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "E", + "f9ca4d0b-aa78-4f50-a17c-c3f6d38caef8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "x", + "!" + ), + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "string", + "?" + ), + " ", + "wtf", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + "?" + ), + " ", + "hello", + Doc.Null + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Patterns", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "o", + Doc.Line, + "is", + " ", + "string" + ), + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "Length", + Doc.Concat( + ":", + " " + ) + ), + "5" + ) + ), + Doc.Line, + "}" + ), + " ", + "s" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Do", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Do", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Group( + "lang", + Doc.Concat( + ".", + "CountOfTokens" + ) + ), + " ", + "switch", + Doc.HardLine, + "{", + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "1", + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + "100" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "2", + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + "200" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "_", + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Concat( + Doc.Concat( + "throw", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + Doc.Concat( + "global", + "::", + "System" + ), + ".", + "Exception" + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "newState", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "49fcb8f0-a71c-47b8-9ff4-344e1a609062", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "GetState", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "GetState", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + "action", + ",", + Doc.Line, + "hasKey" + ) + ), + Doc.SoftLine, + ")" + ), + " ", + "switch", + Doc.HardLine, + "{", + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Open" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Opened" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Opened" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Close" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Lock" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Locked" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Locked" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Unlock" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + Doc.Concat( + "var", + " " + ), + "state" + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + "state" + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + "49fcb8f0-a71c-47b8-9ff4-344e1a609062" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + "Task", + " ", + "AsyncStreams", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "await", + " ", + "foreach", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "var", + " ", + "item" + ), + " ", + "in", + " ", + "asyncEnumerables" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Ranges", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "thirdItem", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "63a52d35-e3a0-4e48-b35f-c96d91506af2", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "2" + ), + Doc.SoftLine, + "]" + ) + ), + "63a52d35-e3a0-4e48-b35f-c96d91506af2" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[2]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "lastItem", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "e5242dff-eb88-41d7-8232-e8701aaba2f4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "^", + "1" + ) + ), + Doc.SoftLine, + "]" + ) + ), + "e5242dff-eb88-41d7-8232-e8701aaba2f4" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Index.CreateFromEnd(1)]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "multiDimensional", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "96d5d3e5-b67a-4cc3-b566-2296fdec88b3", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "3", + ",", + Doc.Line, + Doc.Concat( + "^", + "2" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "96d5d3e5-b67a-4cc3-b566-2296fdec88b3" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[3, Index.CreateFromEnd(2)]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice1", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8b4754f0-f95f-411f-9a20-065ea29d998e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + "..", + Doc.Concat( + "^", + "3" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "8b4754f0-f95f-411f-9a20-065ea29d998e" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.Create(2, Index.CreateFromEnd(3))]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "80e34739-6da4-49b0-8995-ac57e7bcffbf", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + "..", + Doc.Concat( + "^", + "3" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "80e34739-6da4-49b0-8995-ac57e7bcffbf" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.ToEnd(Index.CreateFromEnd(3))]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice3", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c6c8c496-1fe7-4389-9baf-45d2ca225ad4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + "..", + Doc.Null + ) + ), + Doc.SoftLine, + "]" + ) + ), + "c6c8c496-1fe7-4389-9baf-45d2ca225ad4" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.FromStart(2)]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice4", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "68df8c5b-c150-4ffa-96c2-ed214143920c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + "..", + Doc.Null + ) + ), + Doc.SoftLine, + "]" + ) + ), + "68df8c5b-c150-4ffa-96c2-ed214143920c" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.All]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "multiDimensional", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "723b0604-f95d-4461-8c58-770fed82cdbd", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "1", + "..", + "2" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "..", + Doc.Null + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "723b0604-f95d-4461-8c58-770fed82cdbd" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.Create(1, 2), Range.All]", CommentType.SingleLine) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "UsingDeclarators", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "item", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8c56a9f1-1279-4572-8d26-0b10e18d16da", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "FileStream", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"./.f\"" + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "8c56a9f1-1279-4572-8d26-0b10e18d16da" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "char", + "*" + ), + " ", + "ch", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"hell\"" + ) + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Indent( + Doc.HardLine, + ";" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "item", + Doc.Concat( + ".", + "Dispose" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "item" + ), + Doc.Concat( + Doc.Concat( + ".", + "Dispose" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "StaticLocalFunction", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "unsafe", + " " + ) + ) + ), + "void", + " ", + "Func1", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "unsafe", + " " + ) + ) + ), + "void", + " ", + "Func1", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "void", + " ", + "Func2", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "async", + " " + ) + ) + ), + "void", + " ", + "Func2", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "NullCoalescingAssignment", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "item", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Group( + "a", + " " + ), + "??=", + Doc.Line, + Doc.Concat( + Doc.Group( + "b", + " " + ), + "??=", + Doc.Line, + Doc.Concat( + Doc.Group( + "c", + " " + ), + "??=", + Doc.Line, + Doc.Concat( + Doc.Group( + "d", + " " + ), + "??=", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "throw", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Exception", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "readonly", + " " + ) + ) + ), + "float", + " ", + "Hello", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "0.1f", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IA", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IA", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IB", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "IA", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "override", + " ", + Doc.Null + ), + "void", + " ", + "IA", + ".", + "M", + "(", + Doc.Concat( + ")", + Doc.TrailingComment("// explicitly named", CommentType.SingleLine) + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IB.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IB.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IC", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "IA", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "override", + " ", + Doc.Null + ), + "void", + " ", + "M", + "(", + Doc.Concat( + ")", + Doc.TrailingComment("// implicitly named", CommentType.SingleLine) + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IC.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IC.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLineIfNoPreviousLine +) \ No newline at end of file diff --git a/Src/CSharpier.Tests/Samples/Scratch.test b/Src/CSharpier.Tests/Samples/Scratch.test index e69de29bb..1d8ef2950 100644 --- a/Src/CSharpier.Tests/Samples/Scratch.test +++ b/Src/CSharpier.Tests/Samples/Scratch.test @@ -0,0 +1 @@ +Doc.HardLineIfNoPreviousLine \ No newline at end of file diff --git a/Src/CSharpier/CSharpFormatter.cs b/Src/CSharpier/CSharpFormatter.cs index 58571087d..1592e6af9 100644 --- a/Src/CSharpier/CSharpFormatter.cs +++ b/Src/CSharpier/CSharpFormatter.cs @@ -4,19 +4,10 @@ namespace CSharpier; using System.Text.Json; using CSharpier.SyntaxPrinter; -internal class CSharpFormatter : IFormatter +internal static class CSharpFormatter { internal static readonly LanguageVersion LanguageVersion = LanguageVersion.Preview; - Task IFormatter.FormatAsync( - string code, - PrinterOptions printerOptions, - CancellationToken cancellationToken - ) - { - return FormatAsync(code, printerOptions, cancellationToken); - } - internal static Task FormatAsync( string code, PrinterOptions printerOptions diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index e78802a60..261328ef5 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -1,7 +1,3 @@ -using System.Text; -using CSharpier.SyntaxPrinter; -using System.Text.Json; - namespace CSharpier; public static class CodeFormatter @@ -48,4 +44,26 @@ public static Task FormatAsync( cancellationToken ); } + + internal static Task FormatAsync( + string fileContents, + string fileExtension, + PrinterOptions options, + CancellationToken cancellationToken + ) + { + var loweredExtension = fileExtension.ToLower(); + + if (loweredExtension is "cs") + { + return CSharpFormatter.FormatAsync(fileContents, options, cancellationToken); + } + + if (loweredExtension is "csproj" or "props" or "targets" or "xml") + { + return XmlFormatter.FormatAsync(fileContents, options, cancellationToken); + } + + throw new Exception("Cannot format file with extension " + fileExtension); + } } diff --git a/Src/CSharpier/IFormatter.cs b/Src/CSharpier/IFormatter.cs deleted file mode 100644 index 5b0e4fa7d..000000000 --- a/Src/CSharpier/IFormatter.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace CSharpier; - -internal interface IFormatter -{ - Task FormatAsync( - string code, - PrinterOptions printerOptions, - CancellationToken cancellationToken - ); -} diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs index f40076234..29e9d6a05 100644 --- a/Src/CSharpier/XmlFormatter.cs +++ b/Src/CSharpier/XmlFormatter.cs @@ -1,13 +1,13 @@ namespace CSharpier; -internal class XmlFormatter : IFormatter +internal static class XmlFormatter { - public Task FormatAsync( + internal static async Task FormatAsync( string code, PrinterOptions printerOptions, CancellationToken cancellationToken ) { - throw new NotImplementedException(); + return new CodeFormatterResult { Code = code }; } } From 57395fded1f9a451f30880d60918ac768c17ed1e Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 20 Mar 2023 13:15:29 -0500 Subject: [PATCH 07/21] Getting basics working --- .../NodePrinterGenerator.cs | 7 +- .../FormattingTestsGenerator.cs | 10 +- .../FormattingTestsGenerator.sbntxt | 4 +- .../TestFiles/csproj/BasicProject.test | 4 - Src/CSharpier.Tests/Samples/AllInOne.test | 23973 +--------------- Src/CSharpier/XmlFormatter.cs | 37 +- 6 files changed, 50 insertions(+), 23985 deletions(-) diff --git a/Src/CSharpier.Generators/NodePrinterGenerator.cs b/Src/CSharpier.Generators/NodePrinterGenerator.cs index 097ecd22a..9484acc78 100644 --- a/Src/CSharpier.Generators/NodePrinterGenerator.cs +++ b/Src/CSharpier.Generators/NodePrinterGenerator.cs @@ -1,11 +1,12 @@ -using Microsoft.CodeAnalysis; - -namespace CSharpier.Generators; +namespace CSharpier.Generators; using System.Text; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; using Scriban; +// the magic command to get source generators to actually regenerate when they get stuck with old code +// dotnet build-server shutdown [Generator] public class NodePrinterGenerator : ISourceGenerator { diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs index a48ecfa78..566d24f51 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs @@ -6,6 +6,8 @@ namespace CSharpier.Tests.Generators; using Microsoft.CodeAnalysis.Text; using Scriban; +// the magic command to get source generators to actually regenerate when they get stuck with old code +// dotnet build-server shutdown [Generator] public class FormattingTestsGenerator : ISourceGenerator { @@ -15,7 +17,8 @@ public void Execute(GeneratorExecutionContext context) { var template = Template.Parse(this.GetContent(this.GetType().Name + ".sbntxt")); - foreach (var extension in this.GetExtensions(context)) + var extensions = this.GetExtensions(context).ToList(); + foreach (var extension in extensions) { var renderedSource = template.Render( this.GetModel(context, extension), @@ -37,7 +40,8 @@ private IEnumerable GetExtensions(GeneratorExecutionContext context) && !o.Path.EndsWith(".actual.test") && !o.Path.EndsWith(".expected.test") ) - .Select(o => new FileInfo(o.Path).DirectoryName!); + .Select(o => new FileInfo(o.Path).Directory!.Name) + .Distinct(); } protected object GetModel(GeneratorExecutionContext context, string extension) @@ -48,7 +52,7 @@ protected object GetModel(GeneratorExecutionContext context, string extension) o.Path.EndsWith(".test") && !o.Path.EndsWith(".actual.test") && !o.Path.EndsWith(".expected.test") - && new FileInfo(o.Path).DirectoryName == extension + && new FileInfo(o.Path).Directory!.Name == extension ) .Select( o => diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt index e67f14be6..80f39280b 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.sbntxt @@ -1,10 +1,10 @@ using NUnit.Framework; -namespace CSharpier.Tests.FormattingTests.{{ FileExtension }} +namespace CSharpier.Tests.FormattingTests { [TestFixture] [Parallelizable(ParallelScope.All)] - public class FormattingTests : BaseTest + public class FormattingTests_{{ FileExtension }} : BaseTest { {{- for test in Tests }} [Test] diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test index f70c6324b..8c1a5dc4b 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test @@ -1,9 +1,5 @@ 4 - - - - diff --git a/Src/CSharpier.Tests/Samples/AllInOne.test b/Src/CSharpier.Tests/Samples/AllInOne.test index 178a4bda4..1d8ef2950 100644 --- a/Src/CSharpier.Tests/Samples/AllInOne.test +++ b/Src/CSharpier.Tests/Samples/AllInOne.test @@ -1,23972 +1 @@ -Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#error Error message"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#warning Warning message"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#pragma warning disable 414, 3021"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#pragma warning restore 3021"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#pragma checksum \"file.txt\" \"{00000000-0000-0000-0000-000000000000}\" \"2453\""), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#define foo // Comment in directive"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#if foo"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#else"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#endif"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#undef foo"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "extern", - " " - ), - Doc.Concat( - "alias", - " " - ), - "Foo", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - "System", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - "System", - ".", - "Collections" - ), - ".", - "Generic" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - "System", - ".", - "Linq" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - "System", - ".", - "Linq" - ), - ".", - "Expressions" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - "System", - ".", - "Text" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Concat( - "M", - " ", - Doc.Concat( - "=", - " " - ) - ), - Doc.Concat( - "System", - ".", - "Math" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#if DEBUG || TRACE"), - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - "System", - ".", - "Diagnostics" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.Trim, - "using System.Diagnostics; -", - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#else"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.Trim, - "using System.Diagnostics; -", - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#endif"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLine, - Doc.Trim, - Doc.BeginRegion("#region Region"), - Doc.HardLine, - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLine, - Doc.Trim, - Doc.BeginRegion("#region more"), - Doc.HardLine - ) - ), - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - "ConsoleApplication2", - ".", - "Test" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLine, - Doc.Trim, - Doc.EndRegion("#endregion"), - Doc.HardLine - ) - ), - "using", - " " - ), - Doc.Null, - Doc.Concat( - "X", - " ", - Doc.Concat( - "=", - " " - ) - ), - "int1", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Concat( - "Y", - " ", - Doc.Concat( - "=", - " " - ) - ), - Doc.Concat( - "ABC", - ".", - Doc.Group( - "X", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Concat( - "static", - " " - ), - Doc.Null, - Doc.Concat( - "System", - ".", - "Math" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Concat( - "static", - " " - ), - Doc.Null, - Doc.Concat( - "System", - ".", - "DayOfWeek" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Concat( - "static", - " " - ), - Doc.Null, - Doc.Concat( - Doc.Concat( - "System", - ".", - "Linq" - ), - ".", - "Enumerable" - ), - ";" - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLine, - Doc.Trim, - Doc.EndRegion("#endregion"), - Doc.HardLine, - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "[" - ), - "assembly", - Doc.Concat( - ":", - " " - ), - Doc.Group( - Doc.Concat( - "System", - ".", - "Copyright" - ), - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "@\"(C)\"\"", - Doc.LiteralLine, - "", - Doc.LiteralLine, - "2009\"" - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - "[", - "module", - Doc.Concat( - ":", - " " - ), - Doc.Group( - Doc.Concat( - "System", - ".", - "Copyright" - ), - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "\"\n\t\u0123(C) \\"2009\"", - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - "\"\u0123\"" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ) - ), - Doc.HardLine - ), - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "TopLevelType", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - "IDisposable", - Doc.Null - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "IDisposable", - ".", - "Dispose", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - "My", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - "A", - ".", - "B" - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "interface", - " " - ), - "CoContra", - Doc.Group( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "out", - " " - ), - "T" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "in", - " " - ), - "K" - ) - ) - ), - Doc.SoftLine, - ">" - ), - Doc.Null, - " ", - "{", - " ", - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "delegate", - " " - ), - "void", - " ", - "CoContra2", - Doc.Group( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.GroupWithId( - "7b3c97da-ed9e-48ad-84ac-43f4cacce838", - Doc.Group( - "[", - Doc.Group( - Doc.Concat( - "System", - ".", - "Obsolete" - ), - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Null - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.IndentIfBreak( - Doc.Line, - "7b3c97da-ed9e-48ad-84ac-43f4cacce838" - ), - Doc.Concat( - "out", - " " - ), - "T" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "in", - " " - ), - "K" - ) - ) - ), - Doc.SoftLine, - ">" - ), - Doc.Group( - "(", - Doc.Null, - ")" - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "T", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - "struct", - Doc.Null - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - "public", - " ", - "unsafe", - " ", - "partial" - ), - " " - ), - Doc.Concat( - "class", - " " - ), - "A", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - "C", - Doc.Indent( - ",", - Doc.Line, - "I" - ) - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.Group( - "[", - Doc.Group( - "DllImport", - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - "\"kernel32\"" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "SetLastError", - " ", - Doc.Concat( - "=", - " " - ) - ), - Doc.Null, - "true" - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.HardLine - ), - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Concat( - Doc.Concat( - "extern", - " " - ) - ) - ), - "bool", - " ", - "CreateDirectory", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "string", - " ", - "name" - ), - ",", - Doc.Line, - Doc.Concat( - "SecurityAttribute", - " ", - "sa" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - "private", - " ", - "const" - ), - " " - ), - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "global", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "int", - Doc.Concat( - ".", - "MinValue" - ) - ), - Doc.Group( - Doc.Line, - "-", - " ", - "1" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Null - ), - "A", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "A", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - " ", - "foo" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - "L", - ":", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "i", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "287971df-90e0-45db-9c38-423108431296", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "sizeof", - "(", - "int", - ")" - ), - "287971df-90e0-45db-9c38-423108431296" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "++", - "i" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "s1", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$\"", - "x ", - Doc.Concat( - "{", - "1", - Doc.Concat( - ",", - " " - ), - Doc.Concat( - "-", - "2" - ), - ":", - "d", - "}" - ), - "\"" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "s2", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$@\"", - "x ", - Doc.Concat( - "{", - "1", - Doc.Concat( - ",", - " " - ), - Doc.Concat( - "-", - "2" - ), - ":", - "d", - "}" - ), - "\"" - ) - ) - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#if DEBUG"), - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "Console" - ), - Doc.Concat( - ".", - "WriteLine" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "export", - Doc.Concat( - ".", - "iefSupplied" - ), - Doc.Concat( - ".", - "command" - ) - ), - Doc.Concat( - Doc.Concat( - "export" - ), - Doc.Null, - Doc.Indent( - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - ".", - "iefSupplied" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Concat( - ".", - "command" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#endif"), - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "const" - ), - " " - ), - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - " ", - "local", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "1bd4281e-555c-4563-b87b-4b1193ca3774", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "int", - Doc.Concat( - ".", - "MaxValue" - ) - ), - "1bd4281e-555c-4563-b87b-4b1193ca3774" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "const", - " " - ), - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "Guid", - "?" - ), - " ", - "local0", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "1ee4c78a-9cb1-469a-b2da-cdcf12b2ad62", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Guid", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "r", - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "r" - ), - Doc.Concat( - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ), - "1ee4c78a-9cb1-469a-b2da-cdcf12b2ad62" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "привет", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "99692793-7f4e-4819-8cf2-41afa230494d", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "local", - "99692793-7f4e-4819-8cf2-41afa230494d" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "мир", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "867f226a-2bd3-4492-8412-082a3d0b8631", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "local", - "867f226a-2bd3-4492-8412-082a3d0b8631" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - "var", - " ", - Doc.Indent( - Doc.Concat( - "local3", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "0" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "local4", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "local3", - " " - ), - "=", - Doc.GroupWithId( - "ffa3aefa-1fde-4aa9-93b1-2c3cc0143412", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Group( - "local4", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1" - ) - ) - ), - "ffa3aefa-1fde-4aa9-93b1-2c3cc0143412" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "local5", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "null", - Doc.Indent( - Doc.Group( - Doc.Line, - "as", - " ", - "Action" - ) - ) - ), - Doc.Line, - "??", - " ", - "null" - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "local6", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "local5", - Doc.Group( - Doc.Line, - "is", - " ", - "Action" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "u", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1u" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "U", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1U" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - "long", - " ", - Doc.Indent( - Doc.Concat( - "hex", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "0xBADC0DE" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "Hex", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "0XDEADBEEF" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "l", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - Doc.Concat( - "-", - "1L" - ) - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "L", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1L" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "l2", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "2l" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - "ulong", - " ", - Doc.Indent( - Doc.Concat( - "ul", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1ul" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "Ul", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1Ul" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "uL", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1uL" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "UL", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1UL" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "lu", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1lu" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "Lu", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1Lu" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "lU", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1lU" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "LU", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "1LU" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "minInt32Value", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "fe0580a9-db93-4a79-a122-3b66f07b1cdc", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "-", - "2147483648" - ), - "fe0580a9-db93-4a79-a122-3b66f07b1cdc" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "minInt64Value", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "11626f7d-fa68-48b0-8768-3fd29c3105f5", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "-", - "9223372036854775808L" - ), - "11626f7d-fa68-48b0-8768-3fd29c3105f5" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "bool", - " ", - "@bool", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "byte", - " ", - "@byte", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - "char", - " ", - Doc.Indent( - Doc.Concat( - "@char", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "'c'" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "\u0066", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "'\u0066'" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "hexchar", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "'\x0130'" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "hexchar2", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - Doc.Group( - "(", - "char", - ")", - Doc.Indent( - Doc.SoftLine, - "0xBAD" - ) - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "string", - " ", - "\U00000065", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"\U00000065\"" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "decimal", - " ", - "@decimal", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1.44M" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "@decimal", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1.2m" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "dynamic", - " ", - "@dynamic", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "double", - " ", - "@double", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "14d7fad1-2297-46ec-9e08-d5a5fe3f7bd5", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "M", - Doc.Concat( - ".", - "PI" - ) - ), - "14d7fad1-2297-46ec-9e08-d5a5fe3f7bd5" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "@double", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1d" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "@double", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1D" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "@double", - " " - ), - "=", - Doc.GroupWithId( - "20e8e628-9adc-4d49-b9e3-6219f250c0f9", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "-", - "1.2e3" - ), - "20e8e628-9adc-4d49-b9e3-6219f250c0f9" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "float", - " ", - "@float", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1.2f" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "@float", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1.44F" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "@int", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "local", - Doc.Group( - Doc.Line, - "??", - " ", - Doc.Concat( - "-", - "1" - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "long", - " ", - "@long", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "object", - " ", - "@object", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "sbyte", - " ", - "@sbyte", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "short", - " ", - "@short", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "string", - " ", - "@string", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "@\"\"\"/*\"" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "uint", - " ", - "@uint", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "ulong", - " ", - "@ulong", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "ushort", - " ", - "@ushort", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "dynamic", - " ", - "dynamic", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "8124b7fd-aa3b-4d09-840a-8a44bfae95cd", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "local5", - "8124b7fd-aa3b-4d09-840a-8a44bfae95cd" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "add", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "alias", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "arglist", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "ascending", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "async", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "await", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "by", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "descending", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "dynamic", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "equals", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "from", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "get", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "group", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "into", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "join", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "let", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "nameof", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "on", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "orderby", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "partial", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "remove", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "select", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "set", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "when", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "where", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "yield", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "__", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "where", - " " - ), - "=", - Doc.GroupWithId( - "a584e616-fa17-4ad9-ad80-43d1ae3acec4", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Group( - "yield", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - "a584e616-fa17-4ad9-ad80-43d1ae3acec4" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "i", - Doc.Group( - Doc.Line, - ">", - " ", - "0" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - Doc.Null - ), - Doc.Null, - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.HardLine, - Doc.Concat( - "else", - Doc.Concat( - " ", - Doc.Concat( - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "i", - Doc.Group( - Doc.Line, - "==", - " ", - "0" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "throw", - Doc.Concat( - " ", - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Exception", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "o1", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "59ef7887-cabf-415e-9de0-0bcd820f0430", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "MyObject", - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - "59ef7887-cabf-415e-9de0-0bcd820f0430" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "o2", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "059d38c1-9c3b-45bc-aa6a-432c45473e83", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "MyObject", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "var" - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ), - "059d38c1-9c3b-45bc-aa6a-432c45473e83" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "o3", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "83a788f7-1e0a-4db7-b9ed-531b740023fd", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "MyObject", - Doc.Null, - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "A", - " " - ), - "=", - Doc.GroupWithId( - "5eee871b-9d0c-4289-8616-a27c83c87ee8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "5eee871b-9d0c-4289-8616-a27c83c87ee8" - ) - ) - ), - Doc.Line, - "}" - ) - ) - ), - "83a788f7-1e0a-4db7-b9ed-531b740023fd" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "o4", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "11d7e43e-cdf0-480c-9e83-7dc85ce1b385", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "MyObject", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "@dynamic" - ), - Doc.SoftLine, - ")" - ), - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Group( - "A", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Group( - "B", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Group( - "C", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ) - ) - ), - Doc.HardLine, - "}" - ) - ) - ), - "11d7e43e-cdf0-480c-9e83-7dc85ce1b385" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "o5", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "76767dc7-7314-4dfc-a5c9-6a1e2b7dbaf8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - Doc.Line - ), - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "A", - " " - ), - Doc.Concat( - "=", - " " - ), - "0" - ) - ), - Doc.Line, - "}" - ), - "76767dc7-7314-4dfc-a5c9-6a1e2b7dbaf8" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "dictionaryInitializer", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "06de45a6-6f29-4bdc-9352-283e935164c8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Group( - "Dictionary", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - ",", - Doc.Line, - "string" - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Null, - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "1", - ",", - Doc.Line, - "\"\"" - ) - ), - Doc.Line, - "}" - ), - ",", - Doc.Line, - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "2", - ",", - Doc.Line, - "\"a\"" - ) - ), - Doc.Line, - "}" - ) - ) - ), - Doc.Line, - "}" - ) - ) - ), - "06de45a6-6f29-4bdc-9352-283e935164c8" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "float", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "9faf569f-e120-4277-ba5e-86164bfec4a0", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - "float", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "0f", - ",", - Doc.Line, - "1.1f" - ) - ), - Doc.Line, - "}" - ) - ) - ), - "9faf569f-e120-4277-ba5e-86164bfec4a0" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Concat( - Doc.Null, - ",", - Doc.Null, - Doc.Null, - ",", - Doc.Null, - Doc.Null - ), - "]" - ) - ) - ), - " ", - "cube", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "111", - ",", - Doc.Line, - "112" - ) - ), - Doc.Line, - "}" - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "121", - ",", - Doc.Line, - "122" - ) - ), - Doc.Line, - "}" - ) - ) - ), - Doc.HardLine, - "}" - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "211", - ",", - Doc.Line, - "212" - ) - ), - Doc.Line, - "}" - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "221", - ",", - Doc.Line, - "222" - ) - ), - Doc.Line, - "}" - ) - ) - ), - Doc.HardLine, - "}" - ) - ) - ), - Doc.HardLine, - "}" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ), - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "jagged", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - "111" - ), - Doc.Line, - "}" - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "121", - ",", - Doc.Line, - "122" - ) - ), - Doc.Line, - "}" - ) - ) - ), - Doc.HardLine, - "}" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ), - Doc.Concat( - "[", - Doc.Concat( - Doc.Null, - ",", - Doc.Null, - Doc.Null - ), - "]" - ) - ) - ), - " ", - "arr", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "0f0abac0-6097-4ba0-ae2e-2f634b8a9add", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine - ), - "]" - ), - Doc.Concat( - "[", - Doc.Concat( - Doc.Null, - ",", - Doc.Null, - Doc.Null - ), - "]" - ) - ) - ), - Doc.Null - ), - "0f0abac0-6097-4ba0-ae2e-2f634b8a9add" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// as opposed to new int[][5,5]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "arr", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ), - " " - ), - "=", - Doc.GroupWithId( - "61a5707a-01ae-44f8-b6b0-315943e70fe5", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "5", - ",", - Doc.Line, - "5" - ) - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - Doc.Null - ), - "61a5707a-01ae-44f8-b6b0-315943e70fe5" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// as opposed to arr[0,0] = new int[5];", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "arr", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ), - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "0", - ",", - Doc.Line, - "0" - ) - ), - Doc.SoftLine, - "]" - ) - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "47" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "arrayTypeInference", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "84c73b93-8865-4d94-b9ed-885d76ca96e8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "new", - "[", - Doc.Concat( - ), - "]", - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "0", - ",", - Doc.Line, - "1" - ) - ), - Doc.Line, - "}" - ) - ), - "84c73b93-8865-4d94-b9ed-885d76ca96e8" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "switch", - " ", - "(", - Doc.GroupWithId( - "71007e25-26cc-4105-8a8d-054bceed800b", - Doc.Indent( - Doc.SoftLine, - "3" - ), - Doc.SoftLine - ), - ")", - " ", - "{", - " ", - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "switch", - " ", - "(", - Doc.GroupWithId( - "b280d6a4-7b14-4ad0-8fdc-dd42b5fe48d7", - Doc.Indent( - Doc.SoftLine, - "i" - ), - Doc.SoftLine - ), - ")", - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Concat( - "case", - " " - ), - Doc.Group( - "0" - ), - ":" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "case", - " " - ), - Doc.Group( - "1" - ), - ":" - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "goto", - " ", - "case", - Doc.Concat( - " ", - "2" - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Concat( - "case", - " " - ), - Doc.Group( - Doc.Group( - "2", - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - "3" - ) - ) - ) - ), - ":" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - "goto", - " ", - "default", - "", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - "break", - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - "default", - ":" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - Doc.Null - ), - Doc.Null, - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "while", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "i", - Doc.Group( - Doc.Line, - "<", - " ", - "10" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Concat( - "++", - "i" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - "true" - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "continue", - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - "break", - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "do", - Doc.Null - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Concat( - "++", - "i" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - "true" - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "continue", - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - "break", - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - " ", - Doc.Concat( - "while", - " " - ), - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "i", - Doc.Group( - Doc.Line, - "<", - " ", - "10" - ) - ) - ), - Doc.SoftLine - ), - ")", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "for", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "j", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - Doc.Null, - ";" - ), - Doc.Concat( - Doc.Line, - Doc.Group( - "j", - Doc.Indent( - Doc.Group( - Doc.Line, - "<", - " ", - "100" - ) - ) - ) - ), - ";", - Doc.Line, - Doc.Group( - Doc.Indent( - "++", - "j" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "for", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - Doc.Null, - ";" - ), - Doc.Line, - ";", - Doc.Line, - Doc.Group( - Doc.Indent( - Doc.Null - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "for", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Concat( - "int", - " ", - Doc.Indent( - Doc.Concat( - "i", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "0" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - "j", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "0" - ) - ) - ) - ) - ), - Doc.Null, - ";" - ), - Doc.Concat( - Doc.Line, - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "<", - " ", - "length" - ) - ) - ) - ), - ";", - Doc.Line, - Doc.Group( - Doc.Indent( - Doc.Concat( - "i", - "++" - ), - ",", - Doc.Line, - Doc.Concat( - "j", - "++" - ) - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - "true" - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "continue", - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - "break", - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "label", - ":", - Doc.HardLine, - Doc.Concat( - Doc.Null, - "goto", - Doc.Null, - Doc.Null, - Doc.Concat( - " ", - "label" - ), - ";" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "label2", - ":", - Doc.HardLine, - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Null, - Doc.Null, - "foreach", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "var", - " ", - "i" - ), - " ", - "in", - " ", - Doc.ConditionalGroup( - Doc.Concat( - "Items", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Items", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "i", - Doc.Group( - Doc.Line, - "==", - " ", - "7" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - Doc.Null - ), - Doc.Null, - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.HardLine, - Doc.Concat( - "else", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "continue", - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - "checked", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "checked", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "++", - "i" - ) - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - "unchecked", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "unchecked", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "++", - "i" - ) - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "lock", - " " - ), - "(", - "sync", - ")", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "process", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "process", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Null, - Doc.Null, - "using", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "v", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "d27eb205-8165-4962-ab8c-8e394da6e812", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.ConditionalGroup( - Doc.Concat( - "BeginScope", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "BeginScope", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - "d27eb205-8165-4962-ab8c-8e394da6e812" - ) - ), - Doc.Null - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Null, - Doc.Null, - "using", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - Doc.Concat( - "A", - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "c4cfc74c-284f-4e78-869f-fcadbc203cd3", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "A", - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - "c4cfc74c-284f-4e78-869f-fcadbc203cd3" - ) - ), - Doc.Null - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Null, - Doc.Null, - "using", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "A", - " ", - Doc.Indent( - Doc.Concat( - "a", - Doc.Group( - " ", - Doc.Concat( - "=", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "A", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "b", - Doc.Group( - " ", - Doc.Concat( - "=", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "A", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ) - ) - ), - Doc.Null - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Null, - Doc.Null, - "using", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "BeginScope", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "BeginScope", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - Doc.Null - ), - Doc.Null, - ";" - ) - ) - ) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "yield", - " " - ), - "return", - Doc.Concat( - " ", - Doc.Concat( - Doc.Group( - "this", - Doc.Concat( - ".", - "items" - ) - ), - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "3" - ), - Doc.SoftLine, - "]" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "yield", - " " - ), - "break", - "", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "fixed", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - "*" - ), - " ", - Doc.Indent( - Doc.Concat( - "p", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - Doc.Concat( - Doc.Concat( - "stackalloc", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "100" - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - "" - ) - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - "q", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - Doc.Concat( - "&", - "y" - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "*", - "intref" - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "fixed", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "*" - ), - " ", - "p", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "stackalloc", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "100" - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - "" - ) - ) - ) - ) - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "*", - "intref" - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - "unsafe", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "*" - ), - " ", - "p", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "null" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "try", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "throw", - Doc.Concat( - " ", - "null" - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "catch", - Doc.Group( - Doc.Concat( - " ", - "(", - Doc.Concat( - "System", - ".", - "AccessViolationException" - ), - " ", - "av", - ")" - ), - Doc.Null - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "throw", - Doc.Concat( - " ", - "av" - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - "catch", - Doc.Group( - Doc.Concat( - " ", - "(", - "Exception", - Doc.Null, - Doc.Null, - ")" - ), - Doc.Null - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "throw", - "", - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ), - Doc.HardLine, - Doc.Concat( - "finally", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "try", - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.HardLine, - Doc.Concat( - "catch", - Doc.Group( - Doc.Null, - Doc.Null - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "var", - " ", - "anonymous", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Group( - Doc.Group( - "A", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1" - ) - ) - ), - ",", - Doc.Line, - Doc.Group( - Doc.Group( - "B", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "2" - ) - ) - ), - ",", - Doc.Line, - Doc.Group( - Doc.Group( - "C", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "3" - ) - ) - ) - ) - ), - Doc.Line, - "}" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "query", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "from", - " " - ), - Doc.Null, - Doc.Concat( - "c", - " " - ), - Doc.Concat( - "in", - " " - ), - "customers" - ), - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Concat( - "let", - " " - ), - Doc.Concat( - "d", - " " - ), - Doc.Concat( - "=", - " " - ), - "c" - ), - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - "where", - Doc.Indent( - Doc.Line, - Doc.Group( - "d", - Doc.Group( - Doc.Line, - "!=", - " ", - "null" - ) - ) - ) - ) - ), - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - "join", - " " - ), - Doc.Null, - Doc.Concat( - "c1", - " " - ), - Doc.Concat( - "in", - " " - ), - "customers", - Doc.Indent( - Doc.Line, - Doc.Concat( - "on", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "c1", - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "c1" - ), - Doc.Concat( - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - " ", - Doc.Concat( - "equals", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "c", - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "c" - ), - Doc.Concat( - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - Doc.Null - ) - ) - ), - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - "join", - " " - ), - Doc.Null, - Doc.Concat( - "c1", - " " - ), - Doc.Concat( - "in", - " " - ), - "customers", - Doc.Indent( - Doc.Line, - Doc.Concat( - "on", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "c1", - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "c1" - ), - Doc.Concat( - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - " ", - Doc.Concat( - "equals", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "c", - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "c" - ), - Doc.Concat( - Doc.Concat( - ".", - "GetHashCode" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - Doc.Concat( - Doc.Line, - Doc.Concat( - "into", - " " - ), - "e" - ) - ) - ) - ) - ), - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Concat( - "group", - " " - ), - "c", - " ", - Doc.Concat( - "by", - " " - ), - Doc.Group( - "c", - Doc.Concat( - ".", - "Country" - ) - ) - ), - " ", - Doc.Concat( - Doc.Concat( - "into", - " " - ), - Doc.Concat( - "g", - Doc.Line - ), - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Null, - "orderby", - Doc.Concat( - " ", - Doc.ConditionalGroup( - Doc.Concat( - "g", - Doc.Concat( - ".", - "Count" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "g" - ), - Doc.Concat( - Doc.Concat( - ".", - "Count" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - " ", - "ascending" - ) - ), - Doc.Line, - Doc.Concat( - Doc.Null, - "orderby", - Doc.Concat( - " ", - Doc.Group( - "g", - Doc.Concat( - ".", - "Key" - ) - ), - " ", - "descending" - ) - ) - ), - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Concat( - "select", - " " - ), - Doc.Group( - Doc.Concat( - "new", - Doc.Line - ), - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "Country", - " " - ), - Doc.Concat( - "=", - " " - ), - Doc.Group( - "g", - Doc.Concat( - ".", - "Key" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "CustCount", - " " - ), - Doc.Concat( - "=", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "g", - Doc.Concat( - ".", - "Count" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "g" - ), - Doc.Concat( - Doc.Concat( - ".", - "Count" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ) - ) - ) - ), - Doc.Line, - "}" - ) - ) - ) - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "query", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "from", - " " - ), - Doc.Null, - Doc.Concat( - "c", - " " - ), - Doc.Concat( - "in", - " " - ), - "customers" - ), - Doc.Line, - Doc.Concat( - Doc.Concat( - ), - Doc.Concat( - Doc.Null, - Doc.Concat( - "select", - " " - ), - "c" - ), - " ", - Doc.Concat( - Doc.Concat( - "into", - " " - ), - Doc.Concat( - "d", - Doc.Line - ), - Doc.Concat( - Doc.Concat( - ), - Doc.Concat( - Doc.Null, - Doc.Concat( - "select", - " " - ), - "d" - ) - ) - ) - ) - ) - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Group( - Doc.Concat( - "~", - "A" - ), - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - "private", - " ", - "readonly" - ), - " " - ), - Doc.Group( - "int", - " ", - "f1", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - "NonExisting", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - Doc.Group( - Doc.Concat( - "Foo", - "::", - "NonExisting" - ), - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - "var" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - "5" - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - Doc.Group( - "CLSCompliant", - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "false" - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "Obsolete", - ",", - Doc.Line, - Doc.Concat( - "System", - ".", - "NonSerialized" - ), - ",", - Doc.Line, - "NonSerialized", - ",", - Doc.Line, - Doc.Group( - "CLSCompliant", - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "true", - Doc.Indent( - Doc.Line, - "||", - " ", - Doc.Group( - "false", - Doc.Indent( - Doc.Group( - Doc.Line, - "&", - " ", - "true" - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ), - Doc.SoftLine, - "]" - ) - ), - Doc.HardLine - ), - Doc.Group( - Doc.Concat( - "private", - " ", - "volatile" - ), - " " - ), - Doc.Group( - "int", - " ", - "f2", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - "return", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - "method", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ) - ), - Doc.HardLine - ), - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "Handler", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "object", - " ", - "value" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "int", - " ", - "m", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "T", - " ", - "t" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "T", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - Doc.Concat( - "class", - Doc.Null - ), - ",", - Doc.Line, - Doc.Concat( - "new", - "(", - ")" - ) - ) - ) - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "base", - Doc.Concat( - ".", - "m" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "t" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "base" - ), - Doc.Concat( - Doc.Concat( - ".", - "m" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "t" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "1", - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "P", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - "get", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "\"A\"", - ";" - ) - ), - Doc.Line - ), - "}" - ), - Doc.Null - ), - Doc.Concat( - Doc.Line, - Doc.Null, - Doc.Null, - "set", - ";" - ) - ), - Doc.Line, - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - "public", - " ", - "abstract" - ), - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "P", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ) - ), - " ", - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - "public", - " ", - "abstract" - ), - " " - ), - Doc.Null, - "int", - " ", - Doc.Null, - Doc.Concat( - "this", - Doc.Concat( - "[", - Doc.Concat( - "int", - " ", - "index" - ), - "]" - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Concat( - Doc.Line, - Doc.Null, - Doc.Group( - Doc.Concat( - "protected", - " ", - "internal" - ), - " " - ), - "get", - ";" - ), - Doc.Concat( - Doc.Line, - Doc.Null, - Doc.Group( - Doc.Concat( - "internal", - " ", - "protected" - ), - " " - ), - "set", - ";" - ) - ), - Doc.Line, - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - "method", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - "field", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - "event", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ) - ), - Doc.HardLine - ), - Doc.Group( - Doc.Concat( - "public", - " ", - "readonly" - ), - " " - ), - Doc.Concat( - "event", - " " - ), - Doc.Group( - "Event", - " ", - "E", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.Group( - "[", - "event", - Doc.Concat( - ":", - " " - ), - "Test", - Doc.Null, - "]" - ), - Doc.HardLine - ), - Doc.Group( - "public", - " " - ), - Doc.Concat( - "event", - " " - ), - "Action", - " ", - Doc.Null, - "E1", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Concat( - Doc.HardLine, - Doc.Concat( - Doc.Group( - "[", - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine - ), - Doc.Null, - "add", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "value", - " " - ), - "=", - Doc.GroupWithId( - "4466cd36-5e88-4dd0-accb-90214e527700", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "value", - "4466cd36-5e88-4dd0-accb-90214e527700" - ) - ), - ";" - ) - ), - Doc.Line - ), - "}" - ), - Doc.Null - ), - Doc.Concat( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - "return", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ) - ), - Doc.HardLine - ), - Doc.Null, - "remove", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "E", - " " - ), - "+=", - Doc.GroupWithId( - "3aee4cb5-f329-457c-8977-e1ebe96b16b6", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "Handler", - "3aee4cb5-f329-457c-8977-e1ebe96b16b6" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "E", - " " - ), - "-=", - Doc.GroupWithId( - "2ec19bd5-586f-4d0d-b046-5868af3ab64e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "Handler", - "2ec19bd5-586f-4d0d-b046-5868af3ab64e" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.Line, - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "A", - " ", - Doc.Null, - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "+", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "A", - " ", - "first" - ), - ",", - Doc.Line, - Doc.Concat( - "A", - " ", - "second" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "Delegate", - " ", - "handler", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "fcd47dd7-9305-4837-8798-02168a91792b", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Delegate", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "Handler" - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ), - "fcd47dd7-9305-4837-8798-02168a91792b" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Group( - "first", - Doc.Concat( - ".", - "Add" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "second" - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - "method", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ), - Doc.HardLine, - Doc.Group( - "[", - "return", - Doc.Concat( - ":", - " " - ), - "Obsolete", - Doc.Null, - "]" - ) - ), - Doc.HardLine - ), - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "bool", - " ", - Doc.Null, - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "true", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "A", - " ", - "a" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "true", - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "bool", - " ", - Doc.Null, - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "false", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "A", - " ", - "a" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "false", - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "C", - Doc.Null, - " ", - "{", - " ", - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "public", - " " - ), - Doc.Concat( - "struct", - " " - ), - "S", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - "I", - Doc.Null - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "S", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "private", - " " - ), - Doc.Group( - "int", - " ", - "f1", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - Doc.Group( - "Obsolete", - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - "\"Use Script instead\"" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Concat( - "error", - Doc.Concat( - ":", - " " - ) - ), - "false" - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.HardLine - ), - Doc.Group( - Doc.Concat( - "private", - " ", - "volatile" - ), - " " - ), - Doc.Group( - "int", - " ", - "f2", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "abstract", - " " - ) - ) - ), - "int", - " ", - "m", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "T", - " ", - "t" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "T", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - "struct", - Doc.Null - ) - ) - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "1", - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "P", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - "get", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "value", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "\"A\"", - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.Concat( - Doc.Line, - Doc.Null, - Doc.Null, - "set", - ";" - ) - ), - Doc.Line, - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - "public", - " ", - "abstract" - ), - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "P", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ) - ), - " ", - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - "public", - " ", - "abstract" - ), - " " - ), - Doc.Null, - "int", - " ", - Doc.Null, - Doc.Concat( - "this", - Doc.Concat( - "[", - Doc.Concat( - "int", - " ", - "index" - ), - "]" - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Concat( - Doc.Line, - Doc.Null, - Doc.Null, - "get", - ";" - ), - Doc.Concat( - Doc.Line, - Doc.Null, - Doc.Group( - Doc.Concat( - "internal", - " ", - "protected" - ), - " " - ), - "set", - ";" - ) - ), - Doc.Line, - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Concat( - "event", - " " - ), - Doc.Group( - "Event", - " ", - "E", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "A", - " ", - Doc.Null, - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "+", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "A", - " ", - "first" - ), - ",", - Doc.Line, - Doc.Concat( - "A", - " ", - "second" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Group( - "first", - Doc.Concat( - ".", - "Add" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "second" - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "fixed", - " " - ), - Doc.Group( - "int", - " ", - "field", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "10" - ), - Doc.SoftLine, - "]" - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "C", - Doc.Null, - " ", - "{", - " ", - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "public", - " " - ), - Doc.Concat( - "interface", - " " - ), - "I", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "A", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - " ", - "value" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Null, - "string", - " ", - Doc.Null, - "Value", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ), - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "set", - ";" - ) - ), - " ", - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "unsafe", - " ", - Doc.Null - ), - "void", - " ", - "UpdateSignatureByHashingContent", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.GroupWithId( - "48bc2011-44bf-437b-853a-54dd419bb6a7", - Doc.Group( - "[", - "In", - Doc.Null, - "]" - ), - Doc.IndentIfBreak( - Doc.Line, - "48bc2011-44bf-437b-853a-54dd419bb6a7" - ), - Doc.Concat( - "byte", - "*" - ), - " ", - "buffer" - ), - ",", - Doc.Line, - Doc.Concat( - "int", - " ", - "size" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - ";" - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "[", - "type", - Doc.Concat( - ":", - " " - ), - "Flags", - Doc.Null, - "]" - ), - Doc.HardLine - ), - Doc.Group( - "public", - " " - ), - Doc.Concat( - "enum", - " " - ), - "E", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "A" - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "B", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "A" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "C", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - Doc.Group( - "2", - Doc.Group( - Doc.Line, - "+", - " ", - "A" - ) - ) - ) - ) - ), - ",", - Doc.Null, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#if DEBUG"), - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "D" - ) - ), - "," - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#else"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.Trim, - " E, - } -", - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#endif"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "public" - ), - " " - ), - Doc.Concat( - "delegate", - " " - ), - "void", - " ", - "Delegate", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "object", - " ", - "P" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - "Test", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - "System", - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Null, - Doc.Concat( - "System", - ".", - "Collections" - ), - ";" - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "public", - " " - ), - Doc.Concat( - "class", - " " - ), - "Список", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "IEnumerable", - " ", - "Power", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - " ", - "number" - ), - ",", - Doc.Line, - Doc.Concat( - "int", - " ", - "exponent" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "Список", - " ", - "Список", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "d976fcb8-d892-40e7-82bb-2501e5bbead8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Список", - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - "d976fcb8-d892-40e7-82bb-2501e5bbead8" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "Список", - Doc.Concat( - ".", - "Main" - ), - Doc.Group( - "(", - ")" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "counter", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "d2651588-94b5-4cdd-9cc9-ad098fdbd4fb", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "0", - Doc.Group( - Doc.Line, - "+", - " ", - "0" - ) - ) - ), - Doc.SoftLine, - ")" - ), - "d2651588-94b5-4cdd-9cc9-ad098fdbd4fb" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "אתר", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "while", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Concat( - "++", - Doc.Concat( - "counter", - "++" - ) - ), - Doc.Group( - Doc.Line, - "<", - " ", - Doc.Concat( - "--", - Doc.Concat( - "exponent", - "--" - ) - ) - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "result", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "result", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "number" - ) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "+", - Doc.Concat( - Doc.Concat( - "number", - "++" - ), - "++" - ) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "number" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "yield", - " " - ), - "return", - Doc.Concat( - " ", - "result" - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Null - ), - "void", - " ", - "Main", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Null, - Doc.Null, - "foreach", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - " ", - "i" - ), - " ", - "in", - " ", - Doc.ConditionalGroup( - Doc.Concat( - "Power", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "2", - ",", - Doc.Line, - "8" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Power", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "2", - ",", - Doc.Line, - "8" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "Console", - Doc.Concat( - ".", - "Write" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "\"{0} \"", - ",", - Doc.Line, - "i" - ) - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "async", - " ", - Doc.Null - ), - "void", - " ", - "Wait", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.Group( - "System", - Doc.Concat( - ".", - "Threading" - ), - Doc.Concat( - ".", - "Tasks" - ), - Doc.Concat( - ".", - "Task" - ), - Doc.Concat( - ".", - "Delay" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - ")" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "AsyncAnonymous", - "(", - Doc.Concat( - ")", - Doc.TrailingComment("// C # 5 feature", CommentType.SingleLine) - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "task", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "394c76a2-c6f9-4ea2-8edc-a55690e3726a", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "Task", - Doc.Concat( - ".", - "Factory" - ), - Doc.Concat( - ".", - "StartNew" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Null, - Doc.Group( - "async", - " " - ), - Doc.Null, - Doc.Group( - "(", - Doc.Null, - ")" - ), - " ", - "=>", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.Group( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "WebClient", - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - Doc.Concat( - ".", - "DownloadStringTaskAsync" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"http://example.com\"" - ), - Doc.SoftLine, - ")" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - ")" - ) - ), - "394c76a2-c6f9-4ea2-8edc-a55690e3726a" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - "ConsoleApplication1", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - "RecursiveGenericBaseType", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "A", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - Doc.Group( - "B", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - ",", - Doc.Line, - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Null - ) - ) - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "T", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ) - ) - ) - ) - ), - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "protected", - " ", - Doc.Concat( - Doc.Concat( - "virtual", - " " - ) - ) - ), - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - " ", - "M", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "protected", - " ", - Doc.Concat( - Doc.Concat( - "abstract", - " " - ) - ) - ), - Doc.Group( - "B", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - ",", - Doc.Line, - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "N", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Null - ), - Doc.Group( - "B", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - ",", - Doc.Line, - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "O", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "sealed", - " " - ), - Doc.Concat( - "class", - " " - ), - "B", - Doc.Group( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T1" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T2" - ) - ) - ), - Doc.SoftLine, - ">" - ), - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "B", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "T1", - ",", - Doc.Line, - "T2" - ) - ), - Doc.SoftLine, - ">" - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Null - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "protected", - " ", - Doc.Concat( - Doc.Concat( - "override", - " " - ) - ) - ), - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - " ", - "M", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "protected", - " ", - Doc.Concat( - Doc.Concat( - "sealed", - " " - ), - Doc.Concat( - "override", - " " - ) - ) - ), - Doc.Group( - "B", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - ",", - Doc.Line, - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "N", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "new", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - " ", - "O", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - "Boo", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.Group( - "public", - " " - ), - Doc.Concat( - "class", - " " - ), - "Bar", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "T", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - "IComparable" - ) - ) - ) - ), - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Group( - "T", - " ", - "f", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "public", - " " - ), - Doc.Concat( - "class", - " " - ), - "Foo", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "U" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - Doc.Group( - "IEnumerable", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - Doc.Null - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "Method", - Doc.Group( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "K" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "V" - ) - ) - ), - Doc.SoftLine, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "K", - " ", - "k" - ), - ",", - Doc.Line, - Doc.Concat( - "T", - " ", - "t" - ), - ",", - Doc.Line, - Doc.Concat( - "U", - " ", - "u" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - "where", - " " - ), - "K", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - Doc.Group( - "IList", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "V" - ), - Doc.Null, - ">" - ) - ), - ",", - Doc.Line, - Doc.Group( - "IList", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - ",", - Doc.Line, - Doc.Group( - "IList", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "U" - ), - Doc.Null, - ">" - ) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "V", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - Doc.Group( - "IList", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "K" - ), - Doc.Null, - ">" - ) - ) - ) - ) - ) - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "a", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "M", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "B", - ",", - Doc.Line, - "C" - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "B", - ",", - Doc.Line, - "C" - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "M", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "B", - ",", - Doc.Line, - "C" - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "B", - ",", - Doc.Line, - "C" - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "Test", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Bar3", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "x", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "7c75d05b-fbfd-49d8-96cd-7a2199b83f5a", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - Doc.Concat( - "Boo", - ".", - Doc.Group( - "Bar", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ) - ), - ".", - Doc.Group( - "Foo", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "object" - ), - Doc.Null, - ">" - ) - ) - ), - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - "7c75d05b-fbfd-49d8-96cd-7a2199b83f5a" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "x", - Doc.Concat( - ".", - Doc.Group( - "Method", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "string", - ",", - Doc.Line, - "string" - ) - ), - Doc.SoftLine, - ">" - ) - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "\" \"", - ",", - Doc.Line, - "5", - ",", - Doc.Line, - Doc.Group( - Doc.Concat( - "new", - " " - ), - "object", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "x" - ), - Doc.Concat( - Doc.Concat( - ".", - Doc.Group( - "Method", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "string", - ",", - Doc.Line, - "string" - ) - ), - Doc.SoftLine, - ">" - ) - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "\" \"", - ",", - Doc.Line, - "5", - ",", - Doc.Line, - Doc.Group( - Doc.Concat( - "new", - " " - ), - "object", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "q", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "from", - " " - ), - Doc.Null, - Doc.Concat( - "i", - " " - ), - Doc.Concat( - "in", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "1", - ",", - Doc.Line, - "2", - ",", - Doc.Line, - "3", - ",", - Doc.Line, - "4" - ) - ), - Doc.Line, - "}" - ) - ) - ) - ), - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "where", - Doc.Indent( - Doc.Line, - Doc.Group( - "i", - Doc.Group( - Doc.Line, - ">", - " ", - "5" - ) - ) - ) - ) - ), - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Concat( - "select", - " " - ), - "i" - ) - ) - ) - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - Doc.Concat( - "implicit", - " " - ), - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "Test", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "string", - " ", - "s" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - "ConsoleApplication1", - ".", - "Test" - ), - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - Doc.Concat( - "explicit", - " " - ), - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "Test", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "string", - " ", - "s", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "\"\"" - ) - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Test", - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "foo", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "5" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Bar2", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "foo", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "6" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Group( - "this", - Doc.Concat( - ".", - "Foo" - ) - ), - " " - ), - "=", - Doc.GroupWithId( - "8c6f7dd1-61a7-42e5-b23d-2eb55b23d00c", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "5", - Doc.Concat( - ".", - "GetType" - ), - Doc.Group( - "(", - ")" - ) - ), - "8c6f7dd1-61a7-42e5-b23d-2eb55b23d00c" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "Test", - " ", - "t", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"sss\"" - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Concat( - "event", - " " - ), - Doc.Group( - Doc.Group( - Doc.Concat( - "EventHandler", - " ", - "MyEvent", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "7109991a-a8a6-4220-8c1a-b9b0cacd2f52", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - "delegate", - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ) - ), - "7109991a-a8a6-4220-8c1a-b9b0cacd2f52" - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Blah", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "i", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "5" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - " ", - "j", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "6" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Expression", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "Func", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "e", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "ae042541-1157-42f8-a84f-4349c16e9757", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Null, - ")" - ), - " ", - "=>", - Doc.Group( - Doc.Indent( - Doc.Line, - "i" - ) - ) - ), - "ae042541-1157-42f8-a84f-4349c16e9757" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Expression", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "Func", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "bool", - ",", - Doc.Line, - "Action" - ) - ), - Doc.SoftLine, - ">" - ) - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "e2", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "c2dc7e10-940b-4ecb-8b57-0514eee2a3c1", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Null, - "b", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Null, - ")" - ), - " ", - "=>", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - Doc.Null - ), - Doc.Null, - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - "c2dc7e10-940b-4ecb-8b57-0514eee2a3c1" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Func", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "bool", - ",", - Doc.Line, - "bool" - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "f", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "b567e969-dbef-4664-be32-617802ee415d", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Group( - "async", - " " - ), - "delegate", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "bool", - " ", - "a" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.Concat( - "!", - "a" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - "b567e969-dbef-4664-be32-617802ee415d" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Func", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - ",", - Doc.Line, - "int", - ",", - Doc.Line, - "int" - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "f2", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "0fa4acd9-2022-4b8b-b7fc-73acc5f40be1", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "a", - ",", - Doc.Line, - "b" - ) - ), - Doc.SoftLine - ), - ")" - ), - " ", - "=>", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - "0fa4acd9-2022-4b8b-b7fc-73acc5f40be1" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "f2", - " " - ), - "=", - Doc.GroupWithId( - "01ab9e1e-40be-468c-9b45-ec3331fef7c9", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - " ", - "a" - ), - ",", - Doc.Line, - Doc.Concat( - "int", - " ", - "b" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - " ", - "=>", - Doc.Group( - Doc.Indent( - Doc.Line, - "1" - ) - ) - ), - "01ab9e1e-40be-468c-9b45-ec3331fef7c9" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "Action", - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "f61601ff-1086-4258-aff0-8ac1eb1dcef5", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "Blah", - "f61601ff-1086-4258-aff0-8ac1eb1dcef5" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "f2", - " " - ), - "=", - Doc.GroupWithId( - "2f98beb9-6858-445d-ac10-37214c98084b", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Null, - ")" - ), - " ", - "=>", - " ", - Doc.Group( - Doc.Null, - "{", - " ", - "}" - ) - ), - "2f98beb9-6858-445d-ac10-37214c98084b" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "f2", - " " - ), - "=", - Doc.GroupWithId( - "f154c797-f561-4af3-9957-103b0376f5df", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Null, - ")" - ), - " ", - "=>", - Doc.HardLine, - Doc.Group( - Doc.Null, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - ";" - ), - Doc.HardLine - ), - "}" - ) - ), - "f154c797-f561-4af3-9957-103b0376f5df" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "delegate", - " " - ), - "Recursive", - " ", - "Recursive", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "Recursive", - " ", - "r" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "delegate", - " " - ), - "Recursive", - " ", - "Recursive", - Doc.Group( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "A" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "R" - ) - ) - ), - Doc.SoftLine, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "Recursive", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "A", - ",", - Doc.Line, - "R" - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "r" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Null, - "Type", - " ", - Doc.Null, - "Foo", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Concat( - Doc.HardLine, - Doc.Concat( - Doc.Group( - "[", - Doc.Group( - "Obsolete", - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - "\"Name\"" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "error", - " ", - Doc.Concat( - "=", - " " - ) - ), - Doc.Null, - "false" - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null, - "]" - ), - Doc.HardLine - ), - Doc.Null, - "get", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "result", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "11a903b7-fdbe-4b1e-bfc9-96396b40c707", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "typeof", - "(", - Doc.Group( - "IEnumerable", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - ")" - ), - "11a903b7-fdbe-4b1e-bfc9-96396b40c707" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "t", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Concat( - "typeof", - "(", - Doc.Concat( - "int", - "?" - ), - ")" - ), - Doc.Group( - Doc.Line, - "==", - " ", - Doc.Concat( - "typeof", - "(", - Doc.Group( - "Nullable", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - ")" - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "t", - " " - ), - "=", - Doc.GroupWithId( - "42e70894-b5a2-4aa9-a400-23898870dfa2", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "typeof", - "(", - Doc.Group( - "IEnumerable", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ), - Doc.Concat( - "[", - Doc.Null, - "]" - ), - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ) - ), - Doc.Null, - ">" - ) - ), - ")" - ), - "42e70894-b5a2-4aa9-a400-23898870dfa2" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - "typeof", - "(", - Doc.Group( - "IEnumerable", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - Doc.Null - ), - Doc.Null, - ">" - ) - ), - ")" - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - "set", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "t", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "2cb92b95-d778-48bf-9507-fbb28caa3177", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "typeof", - "(", - Doc.Concat( - "System", - ".", - "Int32" - ), - ")" - ), - "2cb92b95-d778-48bf-9507-fbb28caa3177" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "t", - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "t" - ), - Doc.Concat( - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "t", - " " - ), - "=", - Doc.GroupWithId( - "5bd85272-3f4a-4436-9ee8-c12f205ffb95", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "value", - "5bd85272-3f4a-4436-9ee8-c12f205ffb95" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.Line, - "}" - ), - Doc.Null, - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "Constants", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "i", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "1", - Doc.Concat( - Doc.Line, - "+", - " ", - "2" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "3" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "5" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "global", - "::", - "System" - ), - ".", - "String" - ), - " ", - "s", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "\"a\"", - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Group( - "(", - Doc.Concat( - "System", - ".", - "String" - ), - ")", - Doc.Indent( - Doc.SoftLine, - "\"a\"" - ) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "\"a\"" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "\"a\"" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "\"a\"" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "\"A\"" - ) - ) - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "ConstructedType", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "List", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "i", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "null" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "c", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "58114982-0278-4aac-a39b-835208b97390", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "i", - Doc.Concat( - ".", - "Count" - ) - ), - "58114982-0278-4aac-a39b-835208b97390" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - Doc.Concat( - Doc.Concat( - "Comments", - ".", - "XmlComments" - ), - ".", - "UndocumentedKeywords" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("/// - /// Whatever - /// - /// - /// // - /// /* */ - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// ", CommentType.SingleLine), - Doc.HardLineSkipBreakIfFirstInGroup - ), - "class", - Doc.Concat( - " ", - Doc.TrailingComment("/*///*/", CommentType.MultiLine) - ), - " " - ), - "C", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "M", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "U" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "T", - " ", - "t" - ), - ",", - Doc.Line, - Doc.Concat( - "U", - " ", - "u" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// comment", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment(" /* *** / */", CommentType.MultiLine), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment(" /* // - */", CommentType.MultiLine), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment(" /*s*/", CommentType.MultiLine), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment("//comment", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment("// /***/", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment(" /*s*/", CommentType.MultiLine) - ), - "int", - Doc.Concat( - " ", - Doc.TrailingComment("/*s*/", CommentType.MultiLine) - ) - ), - " ", - "intValue", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "intValue", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Concat( - "intValue", - Doc.Concat( - " ", - Doc.TrailingComment("/*s*/", CommentType.MultiLine) - ) - ), - Doc.Group( - Doc.Line, - "+", - " ", - "1" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "string", - " ", - "strValue", - Doc.Null - ), - " " - ), - Doc.Concat( - "=", - Doc.Concat( - " ", - Doc.TrailingComment("/*s*/", CommentType.MultiLine) - ) - ), - Doc.Group( - Doc.Indent( - Doc.Line, - "\"hello\"" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment(" /*s*/", CommentType.MultiLine), - "MyClass" - ), - " ", - "c", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "8b658bde-1b9e-453b-aede-f77f35b2d67c", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "MyClass", - Doc.Group( - "(", - ")" - ), - Doc.Null - ), - "8b658bde-1b9e-453b-aede-f77f35b2d67c" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "string", - " ", - "verbatimStr", - Doc.Null - ), - " " - ), - Doc.Concat( - "=", - Doc.Concat( - " ", - Doc.TrailingComment("/*s*/", CommentType.MultiLine) - ) - ), - Doc.Group( - Doc.Indent( - Doc.Line, - "@\"\\\\\"" - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("//General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324)", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "class", - " " - ), - Doc.Concat( - "TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - Doc.Concat( - " ", - Doc.TrailingComment("/*Scen8*/", CommentType.MultiLine) - ) - ), - Doc.Null, - " ", - "{", - " ", - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - Doc.Concat( - "TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22", - Doc.Concat( - " ", - Doc.TrailingComment("/*Scen9*/", CommentType.MultiLine) - ) - ), - Doc.Null, - " ", - "{", - " ", - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "yield", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Foo", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "U" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "__arglist" - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "C", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "U" - ), - Doc.Null, - ">" - ) - ), - " ", - "c", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "null" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "c", - Doc.Concat( - ".", - Doc.Group( - "M", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "5", - ",", - Doc.Line, - Doc.Concat( - "default", - "(", - "U", - ")" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "c" - ), - Doc.Concat( - Doc.Concat( - ".", - Doc.Group( - "M", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ) - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "5", - ",", - Doc.Line, - Doc.Concat( - "default", - "(", - "U", - ")" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "TypedReference", - " ", - "tr", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "4b0db837-fb22-469b-99af-75b2f041b343", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "__makeref", - "(", - "c", - ")" - ), - "4b0db837-fb22-469b-99af-75b2f041b343" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "Type", - " ", - "t", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "e4af2869-262f-4067-b2c4-9e8687d18d9e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "__reftype", - "(", - "tr", - ")" - ), - "e4af2869-262f-4067-b2c4-9e8687d18d9e" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "j", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "ae971dc4-60c8-45a0-a5e2-aa7cb949035d", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "__refvalue", - "(", - "tr", - Doc.Concat( - ",", - " " - ), - "int", - ")" - ), - "ae971dc4-60c8-45a0-a5e2-aa7cb949035d" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "Params", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "a", - Doc.Concat( - ":", - " " - ) - ), - "t" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "b", - Doc.Concat( - ":", - " " - ) - ), - "t" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Params", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "a", - Doc.Concat( - ":", - " " - ) - ), - "t" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "b", - Doc.Concat( - ":", - " " - ) - ), - "t" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "Params", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "c" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "out", - " " - ), - "c" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Params", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "c" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "out", - " " - ), - "c" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Params", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "ref", - " " - ), - "dynamic", - " ", - "a" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "out", - " " - ), - "dynamic", - " ", - "b" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "params", - " " - ), - Doc.Concat( - "dynamic", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "c" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Params", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "out", - " " - ), - "dynamic", - " ", - "a", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "2" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "ref", - " " - ), - "dynamic", - " ", - "c", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - Doc.Concat( - "default", - "(", - "dynamic", - ")" - ) - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "params", - " " - ), - Doc.Concat( - "dynamic", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ), - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "c" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "override", - " " - ) - ) - ), - "string", - " ", - "ToString", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "base", - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "base" - ), - Doc.Concat( - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "partial", - " " - ) - ) - ), - "void", - " ", - "OnError", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "partial", - " " - ) - ) - ), - "void", - " ", - "method", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "edfa4869-8cc0-43f4-b070-4b1486dacaea", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - Doc.Null - ), - "edfa4869-8cc0-43f4-b070-4b1486dacaea" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*[] bug*/", CommentType.MultiLine), - Doc.TrailingComment("// YES []", CommentType.SingleLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "var", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "1", - ",", - Doc.Line, - "2", - ",", - Doc.Line, - "3", - ",", - Doc.Line, - "4", - ",", - Doc.Line, - "5" - ) - ), - Doc.Line, - "}" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*,;*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "i", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "e578ae16-adb7-497c-bb6e-e89f48015e93", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "a", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "i" - ), - Doc.SoftLine, - "]" - ) - ), - "e578ae16-adb7-497c-bb6e-e89f48015e93" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*[]*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Foo", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "T" - ), - Doc.Null, - ">" - ) - ), - " ", - "f", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Group( - "Foo", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*<> ()*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "f", - Doc.Concat( - ".", - "method" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "f" - ), - Doc.Concat( - Doc.Concat( - ".", - "method" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*().*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - Doc.Group( - "i", - Doc.Indent( - Doc.Concat( - Doc.Line, - "+", - " ", - "i" - ), - Doc.Concat( - Doc.Line, - "-", - " ", - Doc.Group( - "i", - Doc.Indent( - Doc.Concat( - Doc.Line, - "*", - " ", - "i" - ), - Doc.Concat( - Doc.Line, - "/", - " ", - "i" - ), - Doc.Concat( - Doc.Line, - "%", - " ", - "i" - ) - ) - ) - ) - ) - ), - Doc.Indent( - Doc.Line, - "&", - " ", - "i" - ) - ), - Doc.Concat( - Doc.Line, - "|", - " ", - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "^", - " ", - "i" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*+ - * / % & | ^*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "bool", - " ", - "b", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "true", - Doc.Indent( - Doc.Group( - Doc.Line, - "&", - " ", - "false" - ) - ) - ), - Doc.Concat( - Doc.Line, - "|", - " ", - Doc.Group( - "true", - Doc.Indent( - Doc.Group( - Doc.Line, - "^", - " ", - "false" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*& | ^*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "b", - " " - ), - "=", - Doc.GroupWithId( - "d406edfe-e349-416b-8cc2-7ab3dd7b7d58", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "!", - "b" - ), - "d406edfe-e349-416b-8cc2-7ab3dd7b7d58" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*!*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "=", - Doc.GroupWithId( - "644e57c9-adb6-4301-a1aa-165925d70413", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "~", - "i" - ), - "644e57c9-adb6-4301-a1aa-165925d70413" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*~i*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "b", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "<", - " ", - "i" - ) - ) - ), - Doc.Concat( - Doc.Line, - "&&", - " ", - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - ">", - " ", - "i" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*< && >*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - " ", - "ii", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "5" - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*? bug*/", CommentType.MultiLine), - Doc.TrailingComment("// NO ?", CommentType.SingleLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "f", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "8880990e-cc2c-45bb-a034-31e568c5ee9a", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Null, - "true", - Doc.Indent( - Doc.Line, - Doc.Concat( - "?", - " " - ), - "1", - Doc.Line, - Doc.Concat( - ":", - " " - ), - "0" - ) - ), - "8880990e-cc2c-45bb-a034-31e568c5ee9a" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*? :*/", CommentType.MultiLine), - Doc.TrailingComment("// YES :", CommentType.SingleLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "i", - "++" - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*++*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "i", - "--" - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*--*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "b", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "true", - Doc.Indent( - Doc.Group( - Doc.Line, - "&&", - " ", - "false" - ) - ) - ), - Doc.Concat( - Doc.Line, - "||", - " ", - "true" - ) - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*&& ||*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "<<", - " ", - "5" - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*<<*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - ">>", - " ", - "5" - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*>>*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "b", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "==", - " ", - "i" - ) - ) - ), - Doc.Concat( - Doc.Line, - "&&", - " ", - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "!=", - " ", - "i" - ) - ) - ) - ), - Doc.Concat( - Doc.Line, - "&&", - " ", - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "<=", - " ", - "i" - ) - ) - ) - ), - Doc.Concat( - Doc.Line, - "&&", - " ", - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - ">=", - " ", - "i" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*= == && != <= >=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "+=", - Doc.Group( - Doc.Indent( - Doc.Line, - "5.0" - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*+=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "-=", - Doc.GroupWithId( - "becba704-5ea6-452f-9568-a4d0d720b538", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "becba704-5ea6-452f-9568-a4d0d720b538" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*-=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "*=", - Doc.GroupWithId( - "274067fa-e379-4036-a130-2b7ede2cbc08", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "274067fa-e379-4036-a130-2b7ede2cbc08" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/* *=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "/=", - Doc.GroupWithId( - "1bfced1d-8edb-4fb8-bd74-35252de81e33", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "1bfced1d-8edb-4fb8-bd74-35252de81e33" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*/=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "%=", - Doc.GroupWithId( - "30b0d10d-9db5-4f12-9ea7-28542f111ab5", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "30b0d10d-9db5-4f12-9ea7-28542f111ab5" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*%=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "&=", - Doc.GroupWithId( - "35f90cbb-523e-4227-9838-8ad9dd5f4945", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "35f90cbb-523e-4227-9838-8ad9dd5f4945" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*&=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "|=", - Doc.GroupWithId( - "0e9fe4e1-8e59-417c-b5d3-370551c8b4e7", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "0e9fe4e1-8e59-417c-b5d3-370551c8b4e7" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*|=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "^=", - Doc.GroupWithId( - "18d88905-6458-4325-824b-599c496c4dd4", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "18d88905-6458-4325-824b-599c496c4dd4" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*^=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - "<<=", - Doc.GroupWithId( - "0d38349a-02a4-4028-a11f-493343f5100e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "0d38349a-02a4-4028-a11f-493343f5100e" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*<<=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "i", - " " - ), - ">>=", - Doc.GroupWithId( - "a98afdec-03b7-4f4e-bb23-76f31d633e0e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "i", - "a98afdec-03b7-4f4e-bb23-76f31d633e0e" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*>>=*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "object", - " ", - "s", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "b9e03904-ed44-42eb-aed9-6d152a2f0def", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Null, - "x", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Group( - "x", - Doc.Group( - Doc.Line, - "+", - " ", - "1" - ) - ) - ) - ), - "b9e03904-ed44-42eb-aed9-6d152a2f0def" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*=>*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "double", - " ", - "d", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - ".3" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "Point", - " ", - "point", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - "unsafe", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "Point", - "*" - ), - " ", - "p", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "6ef52daf-5aec-406f-b158-04a1a107db0e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "&", - "point" - ), - "6ef52daf-5aec-406f-b158-04a1a107db0e" - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/* * &*/", CommentType.MultiLine) - ) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Group( - "p", - Doc.Concat( - "->", - "x" - ) - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "10" - ) - ) - ), - Doc.Concat( - ";", - Doc.Concat( - " ", - Doc.TrailingComment("/*->*/", CommentType.MultiLine) - ) - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "IO", - "::", - "BinaryReader" - ), - " ", - "br", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "null" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "x", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "i", - Doc.Concat( - ":", - " " - ) - ), - "1" - ) - ), - Doc.SoftLine, - "]" - ) - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "3" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "x", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "i", - Doc.Concat( - ":", - " " - ) - ), - "1" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "j", - Doc.Concat( - ":", - " " - ) - ), - "5" - ) - ) - ), - Doc.SoftLine, - "]" - ) - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"str\"" - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "struct", - " " - ), - "Point", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Group( - "int", - " ", - "X", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Group( - "int", - " ", - "Y", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "ThisAccess", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "this", - " " - ), - "=", - Doc.GroupWithId( - "c07ade19-82b4-4e54-a36d-5b2512c1cd51", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "this", - "c07ade19-82b4-4e54-a36d-5b2512c1cd51" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "class", - " " - ), - "CSharp6Features", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Initializers for auto-properties", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "public" - ), - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "First", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ), - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "set", - ";" - ) - ), - " ", - "}" - ), - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "\"Jane\"" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "Last", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ), - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "set", - ";" - ) - ), - " ", - "}" - ), - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "\"Doe\"" - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Getter-only auto-properties", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "public" - ), - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "Third", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ) - ), - " ", - "}" - ), - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "\"Jane\"" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "Fourth", - Doc.Group( - " ", - "{", - Doc.Indent( - Doc.Concat( - " ", - Doc.Null, - Doc.Null, - "get", - ";" - ) - ), - " ", - "}" - ), - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "\"Doe\"" - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.LeadingComment("// Expression bodies on method-like members", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "Point", - " ", - "Move", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - " ", - "dx" - ), - ",", - Doc.Line, - Doc.Concat( - "int", - " ", - "dy" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Point", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "x", - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - "dx" - ) - ) - ), - ",", - Doc.Line, - Doc.Group( - "y", - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - "dy" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "Complex", - " ", - Doc.Null, - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "+", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "Complex", - " ", - "a" - ), - ",", - Doc.Line, - Doc.Concat( - "Complex", - " ", - "b" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - Doc.ConditionalGroup( - Doc.Concat( - "a", - Doc.Concat( - ".", - "Add" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "b" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "a" - ), - Doc.Concat( - Doc.Concat( - ".", - "Add" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "b" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - Doc.Concat( - "implicit", - " " - ), - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "string", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "Person", - " ", - "p" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - Doc.Group( - Doc.Group( - "p", - Doc.Concat( - ".", - "First" - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "\" \"" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Group( - "p", - Doc.Concat( - ".", - "Last" - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "Print", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - Doc.Group( - "Console", - Doc.Concat( - ".", - "WriteLine" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "First", - Doc.Indent( - Doc.Concat( - Doc.Line, - "+", - " ", - "\" \"" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "Last" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Expression bodies on property-like function members", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "public" - ), - " " - ), - Doc.Null, - "string", - " ", - Doc.Null, - "Name", - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - Doc.Group( - "First", - Doc.Concat( - Doc.Line, - "+", - " ", - "\" \"" - ), - Doc.Concat( - Doc.Line, - "+", - " ", - "Last" - ) - ) - ) - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "public", - " " - ), - Doc.Null, - "int", - " ", - Doc.Null, - Doc.Concat( - "this", - Doc.Concat( - "[", - Doc.Concat( - "long", - " ", - "id" - ), - "]" - ) - ), - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - "id" - ) - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "async", - " ", - Doc.Null - ), - "void", - " ", - "Test", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Using static", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "WriteLine" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "Sqrt", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - "3", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "3" - ) - ) - ), - Doc.Indent( - Doc.Line, - "+", - " ", - Doc.Group( - "4", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "4" - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Sqrt", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - "3", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "3" - ) - ) - ), - Doc.Indent( - Doc.Line, - "+", - " ", - Doc.Group( - "4", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "4" - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Using static", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "WriteLine" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "Sqrt", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - "3", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "3" - ) - ) - ), - Doc.Indent( - Doc.Line, - "+", - " ", - Doc.Group( - "4", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "4" - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Sqrt", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - "3", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "3" - ) - ) - ), - Doc.Indent( - Doc.Line, - "+", - " ", - Doc.Group( - "4", - Doc.Indent( - Doc.Group( - Doc.Line, - "*", - " ", - "4" - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "Friday", - Doc.Indent( - Doc.Group( - Doc.Line, - "-", - " ", - "Monday" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "Friday", - Doc.Indent( - Doc.Group( - Doc.Line, - "-", - " ", - "Monday" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "range", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "0db9b134-9720-4b8e-b29a-9cc510b61400", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.ConditionalGroup( - Doc.Concat( - "Range", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "5", - ",", - Doc.Line, - "17" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Range", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "5", - ",", - Doc.Line, - "17" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - "0db9b134-9720-4b8e-b29a-9cc510b61400" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// Ok: not extension", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "even", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "a215466b-65aa-4344-843d-a16a9e8f8165", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "range", - Doc.Concat( - ".", - "Where" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - "i", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "i", - Doc.Indent( - Doc.Group( - Doc.Line, - "%", - " ", - "2" - ) - ) - ), - Doc.Concat( - Doc.Line, - "==", - " ", - "0" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - "a215466b-65aa-4344-843d-a16a9e8f8165" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// Ok", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Null-conditional operators", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "int" - ), - "?" - ), - " ", - "length", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "d8175282-8074-4a03-8763-9ae7a0f373ed", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "customers", - "?", - Doc.Concat( - ".", - "Length" - ) - ), - "d8175282-8074-4a03-8763-9ae7a0f373ed" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// null if customers is null", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "Customer", - " ", - "first", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "4d22206d-c335-47eb-8ab9-d159b0e39b0e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "customers", - "?", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ), - "4d22206d-c335-47eb-8ab9-d159b0e39b0e" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// null if customers is null", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "length", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "customers", - "?", - Doc.Concat( - ".", - "Length" - ) - ), - Doc.Group( - Doc.Line, - "??", - " ", - "0" - ) - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// 0 if customers is null", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - " ", - "first", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "6c8cfd2b-60e3-41d1-be8b-c95be0ebc673", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "customers", - "?", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ), - "?", - Doc.Concat( - ".", - "Orders" - ), - "?", - Doc.Concat( - ".", - "Count" - ), - Doc.Group( - "(", - ")" - ) - ), - "6c8cfd2b-60e3-41d1-be8b-c95be0ebc673" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "PropertyChanged", - "?", - Doc.Concat( - ".", - "Invoke" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "this", - ",", - Doc.Line, - "args" - ) - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// String interpolation", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "string" - ), - " ", - "s", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$\"", - Doc.Concat( - "{", - Doc.Group( - "p", - Doc.Concat( - ".", - "Name" - ) - ), - Doc.Concat( - ",", - " " - ), - "20", - "}" - ), - " is ", - Doc.Concat( - "{", - Doc.Group( - "p", - Doc.Concat( - ".", - "Age" - ) - ), - ":", - "D3", - "}" - ), - " year{{s}} old #", - "\"" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "s", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$\"", - Doc.Concat( - "{", - Doc.Group( - "p", - Doc.Concat( - ".", - "Name" - ) - ), - "}" - ), - " is \\"", - Doc.Concat( - "{", - Doc.Group( - "p", - Doc.Concat( - ".", - "Age" - ) - ), - "}" - ), - " year", - Doc.Concat( - "{", - Doc.Group( - "(", - Doc.Indent( - "", - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "p", - Doc.Concat( - ".", - "Age" - ) - ), - Doc.Group( - " ", - "==", - " ", - "1" - ) - ), - Doc.Indent( - " ", - Doc.Concat( - "?", - " " - ), - "\"\"", - " ", - Doc.Concat( - ":", - " " - ), - "\"s\"" - ) - ) - ), - "", - ")" - ), - "}" - ), - " old", - "\"" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "s", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$\"", - Doc.Concat( - "{", - Doc.Group( - "(", - Doc.Indent( - "", - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "p", - Doc.Concat( - ".", - "Age" - ) - ), - Doc.Group( - " ", - "==", - " ", - "2" - ) - ), - Doc.Indent( - " ", - Doc.Concat( - "?", - " " - ), - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$\"", - Doc.Concat( - "{", - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Person", - Doc.Null, - Doc.Concat( - " ", - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - " ", - Doc.Null - ), - Doc.Null, - "}" - ) - ) - ), - "}" - ), - "\"" - ) - ), - " ", - Doc.Concat( - ":", - " " - ), - "\"\"" - ) - ) - ), - "", - ")" - ), - "}" - ), - "\"" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "s", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$@\"", - "\", - Doc.Concat( - "{", - Doc.Group( - "p", - Doc.Concat( - ".", - "Name" - ) - ), - "}" - ), - Doc.Concat( - "", - Doc.LiteralLine, - " \"\"\" - ), - "\"" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "s", - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.ForceFlat( - "$\"", - "Color [ R=", - Doc.Concat( - "{", - Doc.ConditionalGroup( - Doc.Concat( - "func", - Doc.Group( - "(", - Doc.Indent( - "", - Doc.Concat( - Doc.Concat( - "b", - Doc.Concat( - ":", - " " - ) - ), - "3" - ) - ), - "", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "func", - Doc.Group( - "(", - Doc.Indent( - "", - Doc.Concat( - Doc.Concat( - "b", - Doc.Concat( - ":", - " " - ) - ), - "3" - ) - ), - "", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ":", - "#0.##", - "}" - ), - ", G=", - Doc.Concat( - "{", - "G", - ":", - "#0.##", - "}" - ), - ", B=", - Doc.Concat( - "{", - "B", - ":", - "#0.##", - "}" - ), - ", A=", - Doc.Concat( - "{", - "A", - ":", - "#0.##", - "}" - ), - " ]", - "\"" - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// nameof expressions", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "if" - ), - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "x", - Doc.Group( - Doc.Line, - "==", - " ", - "null" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "throw", - Doc.Concat( - " ", - Doc.Group( - Doc.Concat( - "new", - " " - ), - "ArgumentNullException", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "nameof", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "x" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "nameof", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "x" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.ConditionalGroup( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "nameof", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "person", - Doc.Concat( - ".", - "Address" - ), - Doc.Concat( - ".", - "ZipCode" - ) - ), - Doc.Concat( - Doc.Concat( - "person" - ), - Doc.Null, - Doc.Indent( - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - ".", - "Address" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Concat( - ".", - "ZipCode" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "nameof", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "person", - Doc.Concat( - ".", - "Address" - ), - Doc.Concat( - ".", - "ZipCode" - ) - ), - Doc.Concat( - Doc.Concat( - "person" - ), - Doc.Null, - Doc.Indent( - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - ".", - "Address" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Concat( - ".", - "ZipCode" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "nameof", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "person", - Doc.Concat( - ".", - "Address" - ), - Doc.Concat( - ".", - "ZipCode" - ) - ), - Doc.Concat( - Doc.Concat( - "person" - ), - Doc.Null, - Doc.Indent( - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - ".", - "Address" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Concat( - ".", - "ZipCode" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "nameof", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.ConditionalGroup( - Doc.Concat( - "person", - Doc.Concat( - ".", - "Address" - ), - Doc.Concat( - ".", - "ZipCode" - ) - ), - Doc.Concat( - Doc.Concat( - "person" - ), - Doc.Null, - Doc.Indent( - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Concat( - ".", - "Address" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Concat( - ".", - "ZipCode" - ) - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// prints "ZipCode"", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Index initializers", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "var" - ), - " ", - "numbers", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "f2403c6d-27b2-4808-8f58-90c75370f95d", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Group( - "Dictionary", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - ",", - Doc.Line, - "string" - ) - ), - Doc.SoftLine, - ">" - ) - ), - Doc.Null, - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Null, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Group( - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "7" - ), - Doc.SoftLine, - "]" - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"seven\"" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Group( - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "9" - ), - Doc.SoftLine, - "]" - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"nine\"" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Group( - Doc.Group( - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "13" - ), - Doc.SoftLine, - "]" - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"thirteen\"" - ) - ) - ) - ) - ), - Doc.HardLine, - "}" - ) - ) - ), - "f2403c6d-27b2-4808-8f58-90c75370f95d" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Exception filters", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "try" - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.HardLine, - Doc.Concat( - "catch", - Doc.Group( - Doc.Concat( - " ", - "(", - "MyException", - " ", - "e", - ")" - ), - Doc.Indent( - Doc.Line, - Doc.Concat( - "when", - " " - ), - "(", - Doc.Group( - Doc.Indent( - Doc.ConditionalGroup( - Doc.Concat( - "myfilter", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "e" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "myfilter", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "e" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - Doc.SoftLine - ), - ")" - ) - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Await in catch and finally blocks", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "Resource" - ), - " ", - "res", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "null" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "try", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "res", - " " - ), - "=", - Doc.GroupWithId( - "b7f21849-6b08-47a9-8990-b72920ed4257", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.Group( - "Resource", - Doc.Concat( - ".", - "OpenAsync" - ), - Doc.Group( - "(", - ")" - ) - ) - ), - "b7f21849-6b08-47a9-8990-b72920ed4257" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// You could do this.", CommentType.SingleLine) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.HardLine, - Doc.Concat( - "catch", - Doc.Group( - Doc.Concat( - " ", - "(", - "ResourceException", - " ", - "e", - ")" - ), - Doc.Null - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.Group( - "Resource", - Doc.Concat( - ".", - "LogAsync" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "res", - ",", - Doc.Line, - "e" - ) - ), - Doc.SoftLine, - ")" - ) - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// Now you can do this …", CommentType.SingleLine) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Concat( - "finally", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "res", - Doc.Group( - Doc.Line, - "!=", - " ", - "null" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "res", - Doc.Concat( - ".", - "CloseAsync" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "res" - ), - Doc.Concat( - Doc.Concat( - ".", - "CloseAsync" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// … and this.", CommentType.SingleLine) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.AlwaysFits( - Doc.Concat( - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#line 6"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#line 2 \"test.cs\""), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#line default"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, - Doc.Trim, - Doc.Directive("#line hidden"), - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.HardLineSkipBreakIfFirstInGroup - ) - ), - "class", - " " - ), - "CSharp70", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "PatternMatching", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "string", - " ", - "arg" - ), - ",", - Doc.Line, - Doc.Concat( - "int", - " ", - "b" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "switch", - " ", - "(", - Doc.GroupWithId( - "8af19237-49a9-472d-93e9-1eaf4545a61e", - Doc.Indent( - Doc.SoftLine, - "arg" - ), - Doc.SoftLine - ), - ")", - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Concat( - "case", - " " - ), - "\"A\"", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - "when", - " " - ), - Doc.Group( - "b", - Doc.Indent( - Doc.Group( - Doc.Line, - ">", - " ", - "50" - ) - ) - ) - ) - ), - ":" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Concat( - "case", - " " - ), - "\"B\"", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - "when", - " " - ), - Doc.Group( - "b", - Doc.Indent( - Doc.Group( - Doc.Line, - "<", - " ", - "50" - ) - ) - ) - ) - ), - ":" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - "default", - ":" - ) - ), - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - "break", - ";" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Group( - Doc.Group( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "A", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "B", - ",", - Doc.Line, - "C" - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "D" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "E", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "F", - ",", - Doc.Line, - "G" - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "H" - ) - ) - ), - Doc.SoftLine, - ")" - ), - " " - ), - "=", - Doc.GroupWithId( - "15eac235-74a3-499a-8e8e-a103a0b0c953", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "e", - "15eac235-74a3-499a-8e8e-a103a0b0c953" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - "x", - "?", - Doc.Concat( - ".", - "y" - ), - "?", - Doc.Concat( - ".", - "z" - ) - ), - Doc.Line, - "is", - " ", - Doc.Concat( - "Type", - " ", - "value2" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - " ", - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Indent( - Doc.LeadingComment("// code using value", CommentType.SingleLine), - Doc.Null - ), - Doc.HardLine - ), - "}" - ) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - "expr", - Doc.Line, - "is", - " ", - Doc.Concat( - "Type", - " ", - "v" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "Hello", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Hello", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ), - Doc.Concat( - "async", - " " - ) - ) - ), - "Task", - " ", - "LocalFunctions", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "string", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "args" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Group( - "string", - " ", - "Hello2", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - " ", - "i" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - "args", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "i" - ), - Doc.SoftLine, - "]" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Null, - Doc.Group( - Doc.Group( - "async", - " ", - Doc.Null - ), - Doc.Group( - "Task", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "string" - ), - Doc.Null, - ">" - ) - ), - " ", - "Hello", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "T", - " ", - "i" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "Task", - Doc.Concat( - ".", - "FromResult" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "args", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "i" - ), - Doc.SoftLine, - "]" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Task" - ), - Doc.Concat( - Doc.Concat( - ".", - "FromResult" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "args", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "i" - ), - Doc.SoftLine, - "]" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - Doc.Concat( - "await", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "void", - " ", - "OutVar", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "string", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - " ", - "args" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "int", - Doc.Concat( - ".", - "TryParse" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.ConditionalGroup( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "out", - " " - ), - Doc.Concat( - "var", - " ", - "item" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "int" - ), - Doc.Concat( - Doc.Concat( - ".", - "TryParse" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.ConditionalGroup( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "out", - " " - ), - Doc.Concat( - "var", - " ", - "item" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "int", - Doc.Concat( - ".", - "TryParse" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.ConditionalGroup( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "out", - " " - ), - Doc.Concat( - "int", - " ", - "item" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "int" - ), - Doc.Concat( - Doc.Concat( - ".", - "TryParse" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.ConditionalGroup( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Hello", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "out", - " " - ), - Doc.Concat( - "int", - " ", - "item" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "ThrowExpression", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "result", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "nullableResult", - Doc.Group( - Doc.Line, - "??", - " ", - Doc.Concat( - Doc.Concat( - "throw", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "NullReferenceException", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ) - ) - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "BinaryLiterals", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "nineteen", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0b10011" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "DigitSeparators", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "bin", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0b1001_1010_0001_0100" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "hex", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0x1b_a0_44_fe" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "dec", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "33_554_432" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "weird", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1_2__3___4____5_____6______7_______8________9" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "double", - " ", - "real", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "1_000.111_1e-1_000" - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "CSharp71", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "DefaultWithoutTypeName", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "string", - " ", - "content", - Doc.Indent( - Doc.Group( - " ", - Doc.Concat( - "=", - Doc.Line - ), - "default" - ) - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "DefaultWithoutTypeName", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "default" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "DefaultWithoutTypeName", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "default" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "TupleRecognize", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - " ", - "a" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - Doc.Null - ), - ",", - Doc.Line, - Doc.Concat( - "int", - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ), - " ", - "b" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - Doc.Null - ), - ",", - Doc.Line, - Doc.Concat( - "int", - Doc.Null - ), - ",", - Doc.Line, - Doc.Concat( - "int", - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ), - "?" - ), - " ", - "c" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "result", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "e381c2c4-b465-4c37-b487-f9102a7adea8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.ConditionalGroup( - Doc.Concat( - "list", - Doc.Concat( - ".", - "Select" - ), - Doc.Group( - Doc.Indent( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - "c", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "c", - Doc.Concat( - ".", - "f1" - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "f3", - Doc.Concat( - ":", - " " - ) - ), - Doc.Group( - "c", - Doc.Concat( - ".", - "f2" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - ".", - "Where" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - "t", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "t", - Doc.Concat( - ".", - "f2" - ) - ), - Doc.Group( - Doc.Line, - "==", - " ", - "1" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "list" - ), - Doc.Concat( - Doc.Concat( - ".", - "Select" - ), - Doc.Group( - Doc.Indent( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - "c", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "c", - Doc.Concat( - ".", - "f1" - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "f3", - Doc.Concat( - ":", - " " - ) - ), - Doc.Group( - "c", - Doc.Concat( - ".", - "f2" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ), - Doc.Indent( - Doc.Group( - Doc.HardLine, - Doc.Group( - Doc.Concat( - ".", - "Where" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - "t", - " ", - "=>", - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Group( - "t", - Doc.Concat( - ".", - "f2" - ) - ), - Doc.Group( - Doc.Line, - "==", - " ", - "1" - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ) - ) - ) - ), - "e381c2c4-b465-4c37-b487-f9102a7adea8" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "CSharp72", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - "readonly", - " " - ), - Doc.Concat( - "struct", - " " - ), - "ReadonlyRef1", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Func", - Doc.Concat( - "<", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "int", - ",", - Doc.Line, - "int" - ) - ), - Doc.SoftLine, - ">" - ) - ), - " ", - "s", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "4640105a-3e39-4fad-adf5-9cecb2fbfc56", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - "in", - " " - ), - "int", - " ", - "x" - ) - ), - Doc.SoftLine - ), - ")" - ), - " ", - "=>", - Doc.Group( - Doc.Indent( - Doc.Line, - "x" - ) - ) - ), - "4640105a-3e39-4fad-adf5-9cecb2fbfc56" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Null, - "TValue" - ), - " ", - Doc.Null, - Doc.Concat( - "this", - Doc.Concat( - "[", - Doc.Concat( - Doc.Group( - "in", - " " - ), - "TKey", - " ", - "index" - ), - "]" - ) - ), - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - "null" - ) - ), - Doc.Null, - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "Vector3", - " ", - Doc.Null, - Doc.Concat( - "operator", - " " - ), - Doc.Null, - "+", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "in", - " " - ), - "Vector3", - " ", - "x" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "in", - " " - ), - "Vector3", - " ", - "y" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - " ", - Doc.Concat( - "=>", - Doc.Line - ), - "null" - ) - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Concat( - Doc.Concat( - "readonly", - " " - ) - ) - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Null, - "Vector3" - ), - " ", - "M1_Trace", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// OK", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "ref", - " " - ), - Doc.Concat( - "readonly", - " " - ), - "var" - ), - " ", - "r1", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "6c899e58-6ec4-4dea-9ab9-254d96e4470c", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.ConditionalGroup( - Doc.Concat( - "M1", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "M1", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ) - ), - "6c899e58-6ec4-4dea-9ab9-254d96e4470c" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Not valid. Need an LValue", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "ref", - " " - ), - Doc.Concat( - "readonly", - " " - ), - "Vector3" - ), - " ", - "r2", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "f65b4780-52b8-4121-89db-0ade054bc029", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Concat( - "default", - "(", - "Vector3", - ")" - ) - ), - "f65b4780-52b8-4121-89db-0ade054bc029" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.ConditionalGroup( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Not valid. r1 is readonly.", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "Mutate" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "r1" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// Not valid. r1 is readonly.", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "Mutate" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "r1" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.ConditionalGroup( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// OK.", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "Print" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "in", - " " - ), - "r1" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// OK.", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "Print" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "in", - " " - ), - "r1" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// OK.", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "return", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "r1" - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "ref", - " " - ), - Doc.Concat( - "struct", - " " - ), - "ReadonlyRef2", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Concat( - "readonly", - " " - ), - "Guid" - ), - " ", - "Test", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Group( - "in", - " " - ), - "Vector3", - " ", - "v1" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "in", - " " - ), - "Vector3", - " ", - "v2" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// not OK!!", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "v1" - ), - " " - ), - "=", - Doc.GroupWithId( - "362cee1e-000a-4da1-9851-32f831378200", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "default", - "(", - "Vector3", - ")" - ), - "362cee1e-000a-4da1-9851-32f831378200" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Group( - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// not OK!!", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "v1" - ), - Doc.Concat( - ".", - "X" - ) - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "0" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.ConditionalGroup( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// not OK!!", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "foo" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Group( - "v1", - Doc.Concat( - ".", - "X" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// not OK!!", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "foo" - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Group( - "v1", - Doc.Concat( - ".", - "X" - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - Doc.Group( - "arr", - Doc.Group( - Doc.Line, - "!=", - " ", - "null" - ) - ), - Doc.Indent( - Doc.Line, - Doc.Concat( - "?", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Concat( - "arr", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ) - ), - Doc.Line, - Doc.Concat( - ":", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Concat( - "otherArr", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Span", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "span", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "stackalloc", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "1" - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - "" - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// OK", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "return", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Vector3", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Group( - Doc.Group( - "v1", - Doc.Concat( - ".", - "X" - ) - ), - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - Doc.Group( - "v2", - Doc.Concat( - ".", - "X" - ) - ) - ) - ) - ), - ",", - Doc.Line, - Doc.Group( - Doc.Group( - "v1", - Doc.Concat( - ".", - "Y" - ) - ), - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - Doc.Group( - "v2", - Doc.Concat( - ".", - "Y" - ) - ) - ) - ) - ), - ",", - Doc.Line, - Doc.Group( - Doc.Group( - "v1", - Doc.Concat( - ".", - "Z" - ) - ), - Doc.Indent( - Doc.Group( - Doc.Line, - "+", - " ", - Doc.Group( - "v2", - Doc.Concat( - ".", - "Z" - ) - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Null, - "T" - ), - " ", - "Choice", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "bool", - " ", - "condition" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "ref", - " " - ), - "T", - " ", - "consequence" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "ref", - " " - ), - "T", - " ", - "alternative" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - "condition" - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "consequence" - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.HardLine, - Doc.Concat( - "else", - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - "alternative" - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "DoSomething", - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "bool", - " ", - "isEmployed" - ), - ",", - Doc.Line, - Doc.Concat( - "string", - " ", - "personName" - ), - ",", - Doc.Line, - Doc.Concat( - "int", - " ", - "personAge" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Concat( - " ", - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "NonTrailingNamedArguments", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "isEmployed", - Doc.Concat( - ":", - " " - ) - ), - "true" - ), - ",", - Doc.Line, - "name", - ",", - Doc.Line, - "age" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Concat( - "isEmployed", - Doc.Concat( - ":", - " " - ) - ), - "true" - ), - ",", - Doc.Line, - "name", - ",", - Doc.Line, - "age" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// currently CS1738, but would become legal", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "true", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "personName", - Doc.Concat( - ":", - " " - ) - ), - "name" - ), - ",", - Doc.Line, - "age" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "true", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "personName", - Doc.Concat( - ":", - " " - ) - ), - "name" - ), - ",", - Doc.Line, - "age" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// currently CS1738, but would become legal", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "name", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "isEmployed", - Doc.Concat( - ":", - " " - ) - ), - "true" - ), - ",", - Doc.Line, - "age" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "name", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "isEmployed", - Doc.Concat( - ":", - " " - ) - ), - "true" - ), - ",", - Doc.Line, - "age" - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// remains illegal", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "name", - ",", - Doc.Line, - "age", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "isEmployed", - Doc.Concat( - ":", - " " - ) - ), - "true" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "name", - ",", - Doc.Line, - "age", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "isEmployed", - Doc.Concat( - ":", - " " - ) - ), - "true" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// remains illegal", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "true", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "personAge", - Doc.Concat( - ":", - " " - ) - ), - "age" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "personName", - Doc.Concat( - ":", - " " - ) - ), - "name" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "DoSomething", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "true", - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "personAge", - Doc.Concat( - ":", - " " - ) - ), - "age" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Concat( - "personName", - Doc.Concat( - ":", - " " - ) - ), - "name" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// already legal", CommentType.SingleLine) - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "ConditionalRef", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Null, - "var" - ), - " ", - "r", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "539e4a33-3e3e-4ee1-b05e-0e79da7fa0df", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Null, - Doc.Group( - "arr", - Doc.Group( - Doc.Line, - "!=", - " ", - "null" - ) - ), - Doc.Indent( - Doc.Line, - Doc.Concat( - "?", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Concat( - "arr", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ) - ), - Doc.Line, - Doc.Concat( - ":", - " " - ), - Doc.Concat( - Doc.Concat( - "ref", - " " - ), - Doc.Concat( - "otherArr", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "0" - ), - Doc.SoftLine, - "]" - ) - ) - ) - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - "539e4a33-3e3e-4ee1-b05e-0e79da7fa0df" - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "LeadingSeparator", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "res", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "0", - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "123", - Doc.TrailingComment("// permitted in C# 1.0 and later", CommentType.SingleLine) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "1_2_3", - Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "0x1_2_3", - Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "0b101", - Doc.TrailingComment("// binary literals added in C# 7.0", CommentType.SingleLine) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "0b1_0_1", - Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) - ) - ), - Doc.Concat( - Doc.Line, - Doc.Concat( - Doc.Concat( - Doc.LeadingComment("// in C# 7.2, _ is permitted after the `0x` or `0b`", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup - ), - "+" - ), - " ", - Doc.Concat( - "0x_1_2", - Doc.TrailingComment("// permitted in C# 7.2 and later", CommentType.SingleLine) - ) - ), - Doc.Concat( - Doc.Line, - "+", - " ", - Doc.Concat( - "0b_1_0_1", - Doc.TrailingComment("// permitted in C# 7.2 and later", CommentType.SingleLine) - ) - ) - ) - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "CSharp73", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Blittable", - Doc.Group( - "<", - Doc.Indent( - Doc.Null, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - "T" - ) - ), - Doc.Null, - ">" - ), - Doc.Group( - "(", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "T", - " ", - "value" - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Concat( - "where", - " " - ), - "T", - " ", - Doc.Concat( - ":", - " " - ), - Doc.Indent( - "unmanaged" - ) - ) - ) - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "unmanaged", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "666" - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Group( - "unsafe", - " " - ), - Doc.Concat( - "struct", - " " - ), - "IndexingMovableFixed", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - "public", - " ", - "fixed" - ), - " " - ), - Doc.Group( - "int", - " ", - "myFixedField", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "10" - ), - Doc.SoftLine, - "]" - ) - ), - ";" - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "static", - " " - ), - Doc.Group( - "IndexingMovableFixed", - " ", - "s", - Doc.Null - ), - ";" - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "unsafe", - " " - ) - ) - ), - "void", - " ", - "IndexingMovableFixedFields", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "int", - "*" - ), - " ", - "ptr", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "3cb4dcc7-28a5-4683-a6dd-c4aa15566537", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - "s", - Doc.Concat( - ".", - "myFixedField" - ) - ), - "3cb4dcc7-28a5-4683-a6dd-c4aa15566537" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "int", - " ", - "t", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "e634d25b-1420-49b9-a607-24138c8159c1", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Group( - "s", - Doc.Concat( - ".", - "myFixedField" - ) - ), - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "5" - ), - Doc.SoftLine, - "]" - ) - ), - "e634d25b-1420-49b9-a607-24138c8159c1" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "PatternBasedFixed", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "fixed", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "byte", - "*" - ), - " ", - "ptr", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "ce1a487b-6150-41fd-9263-24720f871047", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "byteArray", - "ce1a487b-6150-41fd-9263-24720f871047" - ) - ) - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Group( - Doc.Line, - "{", - " ", - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Indent( - Doc.LeadingComment("// ptr is a native pointer to the first element of the array", CommentType.SingleLine), - Doc.Null, - Doc.HardLineSkipBreakIfFirstInGroup, - Doc.LeadingComment("// byteArray is protected from being moved/collected by the GC for the duration of this block", CommentType.SingleLine), - Doc.Null - ), - Doc.HardLine - ), - "}" - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "StackallocArrayInitializer", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Span", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "stackalloc", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "3" - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - "" - ) - ) - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// currently allowed", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Span", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "stackalloc", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Group( - "[", - Doc.Concat( - Doc.Indent( - Doc.SoftLine, - "3" - ), - Doc.SoftLine - ), - "]" - ) - ) - ), - Doc.Concat( - " ", - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "1", - ",", - Doc.Line, - "2", - ",", - Doc.Line, - "3" - ) - ), - Doc.Line, - "}" - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Span", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "stackalloc", - " " - ), - Doc.Concat( - "int", - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - Doc.Concat( - " ", - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "1", - ",", - Doc.Line, - "2", - ",", - Doc.Line, - "3" - ) - ), - Doc.Line, - "}" - ) - ) - ) - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Group( - "Span", - Doc.Concat( - "<", - Doc.Concat( - Doc.Null, - "int" - ), - Doc.Null, - ">" - ) - ), - " ", - "a", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "c4d44acc-e89e-4234-aa0f-88b3ea57bf34", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "stackalloc", - "[", - Doc.Concat( - "]", - " " - ), - Doc.Group( - Doc.Null, - "{", - Doc.Indent( - Doc.Line, - Doc.Concat( - "1", - ",", - Doc.Line, - "2", - ",", - Doc.Line, - "3" - ) - ), - Doc.Line, - "}" - ) - ), - "c4d44acc-e89e-4234-aa0f-88b3ea57bf34" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Null - ), - "void", - " ", - "TupleEquality", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Concat( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - Doc.Null - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "int", - Doc.Null - ), - ",", - Doc.Line, - Doc.Concat( - "int", - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ) - ) - ), - Doc.SoftLine, - ")" - ), - " ", - Doc.Indent( - "t1", - ",", - Doc.HardLine, - "t2" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "res", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Group( - "t1", - Doc.Group( - Doc.Line, - "==", - " ", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "1", - ",", - Doc.Line, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "2", - ",", - Doc.Line, - "3" - ) - ), - Doc.SoftLine, - ")" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ) - ) - ) - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - "namespace", - " ", - "CSharp80", - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Null, - Doc.Concat( - Doc.Concat( - "class", - " " - ), - "CSharp80ExceptInterfaceDefaultImplement", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "ReferenceNullable", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "var", - "?" - ), - " ", - "x", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "f9ca4d0b-aa78-4f50-a17c-c3f6d38caef8", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - "E", - "f9ca4d0b-aa78-4f50-a17c-c3f6d38caef8" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Concat( - "x", - "!" - ), - Doc.Concat( - ".", - "ToString" - ), - Doc.Group( - "(", - ")" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "string", - "?" - ), - " ", - "wtf", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "null" - ) - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Concat( - Doc.Concat( - "int", - "?" - ), - Doc.Concat( - Doc.Concat( - "[", - Doc.Null, - "]" - ) - ) - ), - "?" - ), - " ", - "hello", - Doc.Null - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Patterns", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "if", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - "o", - Doc.Line, - "is", - " ", - "string" - ), - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Indent( - Doc.Line, - Doc.Group( - Doc.Concat( - "Length", - Doc.Concat( - ":", - " " - ) - ), - "5" - ) - ), - Doc.Line, - "}" - ), - " ", - "s" - ) - ) - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "Do", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "Do", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.HardLine, - Doc.Concat( - "return", - " " - ), - Doc.Concat( - Doc.Group( - "lang", - Doc.Concat( - ".", - "CountOfTokens" - ) - ), - " ", - "switch", - Doc.HardLine, - "{", - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "1", - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - "100" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "2", - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - "200" - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "_", - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - Doc.Concat( - Doc.Concat( - "throw", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - Doc.Concat( - Doc.Concat( - "global", - "::", - "System" - ), - ".", - "Exception" - ), - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ) - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "newState", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "49fcb8f0-a71c-47b8-9ff4-344e1a609062", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.ConditionalGroup( - Doc.Concat( - "GetState", - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "GetState", - Doc.Group( - "(", - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ",", - Doc.Line, - "action", - ",", - Doc.Line, - "hasKey" - ) - ), - Doc.SoftLine, - ")" - ), - " ", - "switch", - Doc.HardLine, - "{", - Doc.Group( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Closed" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - "Action", - Doc.Concat( - ".", - "Open" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "_" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Opened" - ) - ) - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Opened" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - "Action", - Doc.Concat( - ".", - "Close" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "_" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Closed" - ) - ) - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Closed" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - "Action", - Doc.Concat( - ".", - "Lock" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "true" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Locked" - ) - ) - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Locked" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - Doc.Group( - "Action", - Doc.Concat( - ".", - "Unlock" - ) - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "true" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - Doc.Group( - "DoorState", - Doc.Concat( - ".", - "Closed" - ) - ) - ) - ) - ), - ",", - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Concat( - Doc.Concat( - "var", - " " - ), - "state" - ) - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "_" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "_" - ) - ) - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Indent( - Doc.Line, - Doc.Concat( - "=>", - " " - ), - "state" - ) - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - "49fcb8f0-a71c-47b8-9ff4-344e1a609062" - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "async", - " ", - Doc.Null - ), - "Task", - " ", - "AsyncStreams", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "await", - " ", - "foreach", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "var", - " ", - "item" - ), - " ", - "in", - " ", - "asyncEnumerables" - ), - Doc.SoftLine - ), - ")" - ), - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "Ranges", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "thirdItem", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "63a52d35-e3a0-4e48-b35f-c96d91506af2", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - "2" - ), - Doc.SoftLine, - "]" - ) - ), - "63a52d35-e3a0-4e48-b35f-c96d91506af2" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[2]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "lastItem", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "e5242dff-eb88-41d7-8232-e8701aaba2f4", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "^", - "1" - ) - ), - Doc.SoftLine, - "]" - ) - ), - "e5242dff-eb88-41d7-8232-e8701aaba2f4" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[Index.CreateFromEnd(1)]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "multiDimensional", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "96d5d3e5-b67a-4cc3-b566-2296fdec88b3", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "3", - ",", - Doc.Line, - Doc.Concat( - "^", - "2" - ) - ) - ), - Doc.SoftLine, - "]" - ) - ), - "96d5d3e5-b67a-4cc3-b566-2296fdec88b3" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[3, Index.CreateFromEnd(2)]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.HardLine, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "slice1", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "8b4754f0-f95f-411f-9a20-065ea29d998e", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "2", - "..", - Doc.Concat( - "^", - "3" - ) - ) - ), - Doc.SoftLine, - "]" - ) - ), - "8b4754f0-f95f-411f-9a20-065ea29d998e" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[Range.Create(2, Index.CreateFromEnd(3))]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "slice2", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "80e34739-6da4-49b0-8995-ac57e7bcffbf", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Null, - "..", - Doc.Concat( - "^", - "3" - ) - ) - ), - Doc.SoftLine, - "]" - ) - ), - "80e34739-6da4-49b0-8995-ac57e7bcffbf" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[Range.ToEnd(Index.CreateFromEnd(3))]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "slice3", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "c6c8c496-1fe7-4389-9baf-45d2ca225ad4", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - "2", - "..", - Doc.Null - ) - ), - Doc.SoftLine, - "]" - ) - ), - "c6c8c496-1fe7-4389-9baf-45d2ca225ad4" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[Range.FromStart(2)]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "slice4", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "68df8c5b-c150-4ffa-96c2-ed214143920c", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Null, - "..", - Doc.Null - ) - ), - Doc.SoftLine, - "]" - ) - ), - "68df8c5b-c150-4ffa-96c2-ed214143920c" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[Range.All]", CommentType.SingleLine) - ) - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "multiDimensional", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "723b0604-f95d-4461-8c58-770fed82cdbd", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Concat( - "list", - Doc.Group( - "[", - Doc.Indent( - Doc.SoftLine, - Doc.Concat( - Doc.Concat( - "1", - "..", - "2" - ), - ",", - Doc.Line, - Doc.Concat( - Doc.Null, - "..", - Doc.Null - ) - ) - ), - Doc.SoftLine, - "]" - ) - ), - "723b0604-f95d-4461-8c58-770fed82cdbd" - ) - ), - Doc.Concat( - ";", - Doc.TrailingComment("// list[Range.Create(1, 2), Range.All]", CommentType.SingleLine) - ) - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "UsingDeclarators", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Concat( - "using", - " " - ), - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "item", - Doc.Null - ), - " " - ), - "=", - Doc.GroupWithId( - "8c56a9f1-1279-4572-8d26-0b10e18d16da", - Doc.Indent( - Doc.Line - ) - ), - Doc.IndentIfBreak( - Doc.Group( - Doc.Concat( - "new", - " " - ), - "FileStream", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"./.f\"" - ), - Doc.SoftLine, - ")" - ), - Doc.Null - ), - "8c56a9f1-1279-4572-8d26-0b10e18d16da" - ) - ), - ";" - ), - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Group( - "fixed", - " ", - "(", - Doc.Group( - Doc.Indent( - Doc.SoftLine, - Doc.Group( - Doc.Group( - Doc.Concat( - Doc.Concat( - "char", - "*" - ), - " ", - "ch", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - "\"hell\"" - ) - ) - ) - ), - Doc.SoftLine - ), - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Indent( - Doc.HardLine, - ";" - ) - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "item", - Doc.Concat( - ".", - "Dispose" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "item" - ), - Doc.Concat( - Doc.Concat( - ".", - "Dispose" - ), - Doc.Group( - "(", - ")" - ) - ), - Doc.Null - ) - ), - ";" - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "StaticLocalFunction", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Concat( - Doc.Concat( - "unsafe", - " " - ) - ) - ), - "void", - " ", - "Func1", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Concat( - Doc.Concat( - "unsafe", - " " - ) - ) - ), - "void", - " ", - "Func1", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - "async", - " ", - Doc.Concat( - Doc.Concat( - "static", - " " - ) - ) - ), - "void", - " ", - "Func2", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - "static", - " ", - Doc.Concat( - Doc.Concat( - "async", - " " - ) - ) - ), - "void", - " ", - "Func2", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - " ", - "}" - ), - Doc.Null - ) - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "NullCoalescingAssignment", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Concat( - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Null, - Doc.Group( - Doc.Group( - Doc.Concat( - "var", - " ", - "item", - Doc.Null - ), - " " - ), - "=", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Group( - "a", - " " - ), - "??=", - Doc.Line, - Doc.Concat( - Doc.Group( - "b", - " " - ), - "??=", - Doc.Line, - Doc.Concat( - Doc.Group( - "c", - " " - ), - "??=", - Doc.Line, - Doc.Concat( - Doc.Group( - "d", - " " - ), - "??=", - Doc.Indent( - Doc.Line, - Doc.Concat( - Doc.Concat( - "throw", - " " - ), - Doc.Group( - Doc.Concat( - "new", - " " - ), - "Exception", - Doc.Group( - "(", - ")" - ), - Doc.Null - ) - ) - ) - ) - ) - ) - ) - ) - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "public", - " ", - Doc.Concat( - Doc.Concat( - "readonly", - " " - ) - ) - ), - "float", - " ", - "Hello", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Concat( - "return", - " " - ), - "0.1f", - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "interface", - " " - ), - "IA", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "M", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IA.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IA.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "interface", - " " - ), - "IA", - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - "void", - " ", - "M", - "(", - ")", - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IA.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IA.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "interface", - " " - ), - "IB", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - "IA", - Doc.Null - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "override", - " ", - Doc.Null - ), - "void", - " ", - "IA", - ".", - "M", - "(", - Doc.Concat( - ")", - Doc.TrailingComment("// explicitly named", CommentType.SingleLine) - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IB.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IB.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ), - Doc.HardLine, - Doc.HardLine, - Doc.Concat( - Doc.Concat( - "interface", - " " - ), - "IC", - Doc.Group( - Doc.Indent( - Doc.Line, - Doc.Concat( - ":", - " ", - "IA", - Doc.Null - ) - ) - ), - Doc.Null, - Doc.HardLine, - "{", - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.Group( - Doc.Group( - "override", - " ", - Doc.Null - ), - "void", - " ", - "M", - "(", - Doc.Concat( - ")", - Doc.TrailingComment("// implicitly named", CommentType.SingleLine) - ), - Doc.IfBreak( - Doc.Null, - Doc.SoftLine - ) - ), - Doc.Null, - Doc.Group( - Doc.Line, - "{", - Doc.Concat( - Doc.Indent( - Doc.HardLine, - Doc.Group( - Doc.Null, - Doc.ConditionalGroup( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IC.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Concat( - Doc.Concat( - "WriteLine", - Doc.Group( - "(", - Doc.Indent( - Doc.SoftLine, - "\"IC.M\"" - ), - Doc.SoftLine, - ")" - ) - ), - Doc.Null, - Doc.Null - ) - ), - ";" - ) - ), - Doc.HardLine - ), - "}" - ), - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLine, - "}", - Doc.Null - ) - ), - Doc.HardLineIfNoPreviousLine -) \ No newline at end of file +Doc.HardLineIfNoPreviousLine \ No newline at end of file diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs index 29e9d6a05..65397d370 100644 --- a/Src/CSharpier/XmlFormatter.cs +++ b/Src/CSharpier/XmlFormatter.cs @@ -1,5 +1,8 @@ namespace CSharpier; +using System.Text; +using System.Xml; + internal static class XmlFormatter { internal static async Task FormatAsync( @@ -8,6 +11,38 @@ internal static async Task FormatAsync( CancellationToken cancellationToken ) { - return new CodeFormatterResult { Code = code }; + // TODO width + // TODO test other things + // TODO get this working from CLI + var stringBuilder = new StringWriter(); + + var settings = new XmlWriterSettings + { + Indent = true, + IndentChars = printerOptions.UseTabs ? "\t" : new string(' ', printerOptions.TabWidth), + NewLineChars = PrinterOptions.GetLineEnding(code, printerOptions), + OmitXmlDeclaration = true + }; + + var xmlTextWriter = XmlWriter.Create(stringBuilder, settings); + var xmlDocument = new XmlDocument(); + xmlDocument.LoadXml(code); + xmlDocument.Save(xmlTextWriter); + + return new CodeFormatterResult + { + Code = stringBuilder + PrinterOptions.GetLineEnding(code, printerOptions) + }; + } + + private class XmlFragmentWriter : XmlTextWriter + { + public XmlFragmentWriter(TextWriter textWriter) + : base(textWriter) { } + + public override void WriteStartDocument() + { + // Do nothing (omit the declaration) + } } } From e72b76db380ec909a100422edb1e5c681b45d7a1 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 27 Mar 2023 11:05:04 -0500 Subject: [PATCH 08/21] Adding csproj to playground. Switching to a sane state management pattern. --- .../CSharpier.Playground.csproj | 30 +-- .../ClientApp/.idea/prettier.xml | 6 + .../ClientApp/package-lock.json | 62 ++++++ .../ClientApp/package.json | 2 + .../ClientApp/src/App.tsx | 13 +- .../ClientApp/src/AppContext.ts | 197 ++++++++---------- .../ClientApp/src/CodeEditor.tsx | 7 +- .../ClientApp/src/Controls.css | 6 + .../ClientApp/src/Controls.tsx | 102 +++++---- .../ClientApp/src/DocTree.tsx | 7 +- .../ClientApp/src/FormatCode.ts | 4 +- .../ClientApp/src/FormattedCode.tsx | 7 +- .../ClientApp/src/Header.tsx | 7 +- .../ClientApp/src/Layout.tsx | 7 +- .../ClientApp/src/SyntaxTree.tsx | 7 +- .../Controllers/FormatController.cs | 65 +++--- 16 files changed, 316 insertions(+), 213 deletions(-) create mode 100644 Src/CSharpier.Playground/ClientApp/.idea/prettier.xml diff --git a/Src/CSharpier.Playground/CSharpier.Playground.csproj b/Src/CSharpier.Playground/CSharpier.Playground.csproj index d129e0778..19ed7f51a 100644 --- a/Src/CSharpier.Playground/CSharpier.Playground.csproj +++ b/Src/CSharpier.Playground/CSharpier.Playground.csproj @@ -9,37 +9,37 @@ $(DefaultItemExcludes);$(SpaRoot)node_modules\** - - + + - - - - - + + + + + - + - + - + - + - - - + + + - + %(BuildFiles.Identity) PreserveNewest diff --git a/Src/CSharpier.Playground/ClientApp/.idea/prettier.xml b/Src/CSharpier.Playground/ClientApp/.idea/prettier.xml new file mode 100644 index 000000000..b0ab31a95 --- /dev/null +++ b/Src/CSharpier.Playground/ClientApp/.idea/prettier.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Src/CSharpier.Playground/ClientApp/package-lock.json b/Src/CSharpier.Playground/ClientApp/package-lock.json index 22acf3ded..4f53168ce 100644 --- a/Src/CSharpier.Playground/ClientApp/package-lock.json +++ b/Src/CSharpier.Playground/ClientApp/package-lock.json @@ -15,6 +15,8 @@ "@types/react-router-dom": "5.1.7", "@vitejs/plugin-react": "1.3.2", "codemirror": "5.65.4", + "mobx": "6.9.0", + "mobx-react-lite": "4.0.2", "prettier": "2.2.1", "react": "16.14.0", "react-codemirror2": "7.2.1", @@ -2101,6 +2103,39 @@ "node": "*" } }, + "node_modules/mobx": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.9.0.tgz", + "integrity": "sha512-HdKewQEREEJgsWnErClfbFoVebze6rGazxFLU/XUyrII8dORfVszN1V0BMRnQSzcgsNNtkX8DHj3nC6cdWE9YQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + } + }, + "node_modules/mobx-react-lite": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-4.0.2.tgz", + "integrity": "sha512-5o7for7/5QLpgzKvA3ZjrO8TmfkZgVcSjwYalGlW6OkK/fCxmVlwbFeoWJQzWbkWSxlcaatTO0j4riAUvWoqMg==", + "dependencies": { + "use-sync-external-store": "^1.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + }, + "peerDependencies": { + "mobx": "^6.9.0", + "react": "^16.8.0 || ^17 || ^18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2649,6 +2684,14 @@ } } }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/value-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", @@ -4749,6 +4792,19 @@ "brace-expansion": "^1.1.7" } }, + "mobx": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.9.0.tgz", + "integrity": "sha512-HdKewQEREEJgsWnErClfbFoVebze6rGazxFLU/XUyrII8dORfVszN1V0BMRnQSzcgsNNtkX8DHj3nC6cdWE9YQ==" + }, + "mobx-react-lite": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-4.0.2.tgz", + "integrity": "sha512-5o7for7/5QLpgzKvA3ZjrO8TmfkZgVcSjwYalGlW6OkK/fCxmVlwbFeoWJQzWbkWSxlcaatTO0j4riAUvWoqMg==", + "requires": { + "use-sync-external-store": "^1.2.0" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -5151,6 +5207,12 @@ "use-isomorphic-layout-effect": "^1.0.0" } }, + "use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "requires": {} + }, "value-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", diff --git a/Src/CSharpier.Playground/ClientApp/package.json b/Src/CSharpier.Playground/ClientApp/package.json index c6904b43c..1387ec05f 100644 --- a/Src/CSharpier.Playground/ClientApp/package.json +++ b/Src/CSharpier.Playground/ClientApp/package.json @@ -10,6 +10,8 @@ "@types/react-router-dom": "5.1.7", "@vitejs/plugin-react": "1.3.2", "codemirror": "5.65.4", + "mobx": "6.9.0", + "mobx-react-lite": "4.0.2", "prettier": "2.2.1", "react": "16.14.0", "react-codemirror2": "7.2.1", diff --git a/Src/CSharpier.Playground/ClientApp/src/App.tsx b/Src/CSharpier.Playground/ClientApp/src/App.tsx index 04ac69544..5741f69d2 100644 --- a/Src/CSharpier.Playground/ClientApp/src/App.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/App.tsx @@ -1,11 +1,18 @@ -import { AppContext, useSetupAppContext } from "./AppContext"; import React from "react"; import { Layout } from "./Layout"; +import { AppState, AppStateContext } from "./AppContext"; +import { configure } from "mobx"; + +const appState = new AppState(); + +configure({ + enforceActions: "always", +}); export const App = () => { return ( - + - + ); }; diff --git a/Src/CSharpier.Playground/ClientApp/src/AppContext.ts b/Src/CSharpier.Playground/ClientApp/src/AppContext.ts index 226f999ed..7447a0c06 100644 --- a/Src/CSharpier.Playground/ClientApp/src/AppContext.ts +++ b/Src/CSharpier.Playground/ClientApp/src/AppContext.ts @@ -1,111 +1,95 @@ -import React, { useContext, useState } from "react"; +import { createContext, useContext } from "react"; +import { makeAutoObservable, runInAction } from "mobx"; import { formatCode, setFormattedCodeEditor } from "./FormatCode"; -export const AppContext = React.createContext({ - showAst: false, - setShowAst: (value: boolean) => {}, - showDoc: false, - setShowDoc: (value: boolean) => {}, - hideNull: false, - setHideNull: (value: boolean) => {}, - doc: "", - setDoc: (doc: string) => {}, - isLoading: false, - setIsLoading: (isLoading: boolean) => {}, - hasErrors: false, - setHasErrors: (hasErrors: boolean) => {}, - syntaxTree: undefined as object | undefined, - setSyntaxTree: (syntaxTree: undefined | object) => {}, - formattedCode: "", - setFormattedCode: (formattedCode: string) => {}, - enteredCode: "", - setEnteredCode: (enteredCode: string) => {}, - formatCode: () => {}, - setFormattedCodeEditor: (value: unknown) => {}, - setEmptyMethod: () => {}, - setEmptyClass: () => {}, - copyLeft: () => {}, -}); - -export const useAppContext = () => useContext(AppContext); - -// I regret trying out this approach to managing state.... -export const useSetupAppContext = () => { - const [doc, setDoc] = useState(""); - const [showAst, setShowAst] = useState(getInitialShowAst()); - const [showDoc, setShowDoc] = useState(getInitialShowDoc()); - const [hideNull, setHideNull] = useState(getInitialHideNull()); - const [formattedCode, setFormattedCode] = useState(""); - const [enteredCode, setEnteredCode] = useState(getInitialCode()); - const [isLoading, setIsLoading] = useState(false); - const [hasErrors, setHasErrors] = useState(false); - const [syntaxTree, setSyntaxTree] = useState(undefined); - - return { - doc, - showAst, - setShowAst: (value: boolean) => { - window.sessionStorage.setItem("showAst", value.toString()); - setShowAst(value); - }, - showDoc, - setShowDoc: (value: boolean) => { - window.sessionStorage.setItem("showDoc", value.toString()); - setShowDoc(value); - }, - hideNull, - setHideNull: (value: boolean) => { - window.sessionStorage.setItem("hideNull", value.toString()); - setHideNull(value); - }, - setDoc, - isLoading, - setIsLoading, - hasErrors, - setHasErrors, - syntaxTree, - setSyntaxTree, - formattedCode, - setFormattedCode, - enteredCode, - setEnteredCode: (value: string) => { - window.sessionStorage.setItem("enteredCode", value); - setEnteredCode(value); - }, - formatCode: async () => { - setIsLoading(true); - - const { syntaxTree, formattedCode, doc, hasErrors } = await formatCode(enteredCode); - - setIsLoading(false); - setSyntaxTree(syntaxTree); - setFormattedCode(formattedCode); - setDoc(doc); - setHasErrors(hasErrors); - }, - setFormattedCodeEditor: setFormattedCodeEditor, - setEmptyMethod: () => { - setEnteredCode(`class ClassName +class AppState { + fileExtension = window.sessionStorage.getItem("fileExtension") ?? "cs"; + showAst = window.sessionStorage.getItem("showAst") === "true"; + showDoc = window.sessionStorage.getItem("showDoc") === "true"; + hideNull = window.sessionStorage.getItem("hideNull") === "true"; + doc = ""; + isLoading = false; + hasErrors = false; + syntaxTree = undefined as object | undefined; + formattedCode = ""; + enteredCode = window.sessionStorage.getItem("enteredCode") ?? defaultCs; + + constructor() { + makeAutoObservable(this); + } + + setFileExtension = (value: string) => { + window.sessionStorage.setItem("fileExtension", value); + this.fileExtension = value; + if (value === "cs") { + this.setEnteredCode(defaultCs); + } else { + this.setEnteredCode(defaultCsProj); + } + this.formatCode(); + }; + + setShowAst = (value: boolean) => { + window.sessionStorage.setItem("showAst", value.toString()); + this.showAst = value; + }; + + setShowDoc = (value: boolean) => { + window.sessionStorage.setItem("showDoc", value.toString()); + this.showDoc = value; + }; + + setHideNull = (value: boolean) => { + window.sessionStorage.setItem("hideNull", value.toString()); + this.hideNull = value; + }; + + setEnteredCode = (value: string) => { + window.sessionStorage.setItem("enteredCode", value); + this.enteredCode = value; + }; + + setEmptyMethod = () => { + this.setEnteredCode(`class ClassName { void MethodName() { HERE } }`); - }, - setEmptyClass: () => { - setEnteredCode(`class ClassName + }; + + setEmptyClass = () => { + this.setEnteredCode(`class ClassName { HERE }`); - }, - copyLeft: () => { - setEnteredCode(formattedCode); - }, }; -}; -const defaultCode = `public class ClassName { + copyLeft = () => { + this.setEnteredCode(this.formattedCode); + }; + + formatCode = () => { + (async () => { + this.isLoading = true; + + const { syntaxTree, formattedCode, doc, hasErrors } = await formatCode(this.enteredCode, this.fileExtension); + + runInAction(() => { + this.isLoading = false; + this.syntaxTree = syntaxTree; + this.formattedCode = formattedCode; + this.doc = doc; + this.hasErrors = hasErrors; + }); + })(); + }; + + setFormattedCodeEditor = setFormattedCodeEditor; +} + +export const defaultCs = `public class ClassName { public string ShortPropertyName { get; set; @@ -116,15 +100,14 @@ const defaultCode = `public class ClassName { } }`; -const getInitialCode = () => { - return window.sessionStorage.getItem("enteredCode") ?? defaultCode; -}; -const getInitialShowAst = () => { - return window.sessionStorage.getItem("showAst") === "true"; -}; -const getInitialShowDoc = () => { - return window.sessionStorage.getItem("showDoc") === "true"; -}; -const getInitialHideNull = () => { - return window.sessionStorage.getItem("hideNull") === "true"; -}; +const defaultCsProj = ` + + 4 + +`; + +export { AppState }; + +export const AppStateContext = createContext({} as any); + +export const useAppContext = () => useContext(AppStateContext); diff --git a/Src/CSharpier.Playground/ClientApp/src/CodeEditor.tsx b/Src/CSharpier.Playground/ClientApp/src/CodeEditor.tsx index db8b2cec1..3c4d1a6d3 100644 --- a/Src/CSharpier.Playground/ClientApp/src/CodeEditor.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/CodeEditor.tsx @@ -2,10 +2,11 @@ import React, { useEffect } from "react"; import { Controlled as CodeMirror } from "react-codemirror2"; import "codemirror/lib/codemirror.css"; import "codemirror/mode/clike/clike"; -import { useAppContext } from "./AppContext"; import { useOptions } from "./Hooks"; +import { useAppContext } from "./AppContext"; +import { observer } from "mobx-react-lite"; -export const CodeEditor = () => { +export const CodeEditor = observer(() => { const { formatCode, enteredCode, setEnteredCode } = useAppContext(); useEffect(() => { formatCode(); @@ -23,4 +24,4 @@ export const CodeEditor = () => { onChange={() => {}} /> ); -}; +}); diff --git a/Src/CSharpier.Playground/ClientApp/src/Controls.css b/Src/CSharpier.Playground/ClientApp/src/Controls.css index 3417ce2a3..d1ac44dd5 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Controls.css +++ b/Src/CSharpier.Playground/ClientApp/src/Controls.css @@ -14,6 +14,12 @@ margin-top: 10px; } +.controlsWrapper select { + width: 100%; + margin-top: 10px; + padding: 3px 4px; +} + .smallButton { background-color: #ccc; border-radius: 4px; diff --git a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx index 5a6b997cd..55ead9d8c 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx @@ -1,9 +1,12 @@ import React from "react"; -import { useAppContext } from "./AppContext"; import "./Controls.css"; +import { observer } from "mobx-react-lite"; +import { useAppContext } from "./AppContext"; -export const Controls = () => { +export const Controls = observer(() => { const { + fileExtension, + setFileExtension, showDoc, setShowDoc, hideNull, @@ -14,49 +17,66 @@ export const Controls = () => { setEmptyClass, copyLeft, } = useAppContext(); + + const onChange = (event: React.ChangeEvent) => { + setFileExtension(event.currentTarget.value); + }; + return (
- - - - {showDoc && ( - + {fileExtension === "cs" && ( + <> +
+ + + + + {showDoc && ( + + )} + + )} -
); -}; +}); diff --git a/Src/CSharpier.Playground/ClientApp/src/DocTree.tsx b/Src/CSharpier.Playground/ClientApp/src/DocTree.tsx index 3b4466d78..c41b058ea 100644 --- a/Src/CSharpier.Playground/ClientApp/src/DocTree.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/DocTree.tsx @@ -1,6 +1,7 @@ -import React, { useEffect } from "react"; +import React from "react"; import { UnControlled as CodeMirror } from "react-codemirror2"; import { useAppContext } from "./AppContext"; +import { observer } from "mobx-react-lite"; const options = { mode: { @@ -14,9 +15,9 @@ const options = { const regex = /\s+Doc\.Null,/g; -export const DocTree = () => { +export const DocTree = observer(() => { const { doc, hideNull } = useAppContext(); const docToDisplay = hideNull ? doc.replaceAll(regex, "") : doc; return {}} onChange={() => {}} />; -}; +}); diff --git a/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts b/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts index f38347493..0940824e8 100644 --- a/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts +++ b/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts @@ -2,9 +2,9 @@ let gutters: any[] = []; let marks: any[] = []; let editor: any = undefined; -export const formatCode = async (code: string) => { +export const formatCode = async (code: string, fileExtension: string) => { const makeRequest = async () => { - const response = await fetch("/Format", { + const response = await fetch("/Format?fileExtension=" + fileExtension, { method: "POST", body: JSON.stringify(code), headers: { diff --git a/Src/CSharpier.Playground/ClientApp/src/FormattedCode.tsx b/Src/CSharpier.Playground/ClientApp/src/FormattedCode.tsx index 67ca93084..ccb28b501 100644 --- a/Src/CSharpier.Playground/ClientApp/src/FormattedCode.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/FormattedCode.tsx @@ -1,9 +1,10 @@ import { Controlled as CodeMirror } from "react-codemirror2"; import React from "react"; -import { useAppContext } from "./AppContext"; import { useOptions } from "./Hooks"; +import { useAppContext } from "./AppContext"; +import { observer } from "mobx-react-lite"; -export const FormattedCode = () => { +export const FormattedCode = observer(() => { const { formattedCode, setFormattedCodeEditor } = useAppContext(); const options = useOptions(); @@ -20,4 +21,4 @@ export const FormattedCode = () => { onChange={() => {}} /> ); -}; +}); diff --git a/Src/CSharpier.Playground/ClientApp/src/Header.tsx b/Src/CSharpier.Playground/ClientApp/src/Header.tsx index feca55a3e..e5383ae58 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Header.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/Header.tsx @@ -1,9 +1,10 @@ import React, { useEffect, useState } from "react"; import { Loading } from "./Icons/Loading"; -import { useAppContext } from "./AppContext"; import "./Header.css"; +import { useAppContext } from "./AppContext"; +import { observer } from "mobx-react-lite"; -export const Header = () => { +export const Header = observer(() => { const { isLoading, formatCode, showDoc, showAst } = useAppContext(); const width = showDoc && showAst ? 25 : showDoc || showAst ? 33 : 50; const [version, setVersion] = useState(); @@ -39,4 +40,4 @@ export const Header = () => { ); -}; +}); diff --git a/Src/CSharpier.Playground/ClientApp/src/Layout.tsx b/Src/CSharpier.Playground/ClientApp/src/Layout.tsx index 5bdc6ccb6..21e0ebf93 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Layout.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/Layout.tsx @@ -4,13 +4,14 @@ import "codemirror/mode/clike/clike"; import { SyntaxTree } from "./SyntaxTree"; import { DocTree } from "./DocTree"; import { Header } from "./Header"; -import { useAppContext } from "./AppContext"; import { CodeEditor } from "./CodeEditor"; import { FormattedCode } from "./FormattedCode"; import { Controls } from "./Controls"; import "./Layout.scss"; +import { useAppContext } from "./AppContext"; +import { observer } from "mobx-react-lite"; -export const Layout = () => { +export const Layout = observer(() => { const { showDoc, showAst } = useAppContext(); const width = showDoc && showAst ? 25 : showDoc || showAst ? 33 : 50; return ( @@ -32,4 +33,4 @@ export const Layout = () => {
); -}; +}); diff --git a/Src/CSharpier.Playground/ClientApp/src/SyntaxTree.tsx b/Src/CSharpier.Playground/ClientApp/src/SyntaxTree.tsx index 997d165fa..e53a682d6 100644 --- a/Src/CSharpier.Playground/ClientApp/src/SyntaxTree.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/SyntaxTree.tsx @@ -1,7 +1,8 @@ import React from "react"; import ReactJson, { CollapsedFieldProps } from "react-json-view"; -import { useAppContext } from "./AppContext"; import "./SyntaxTree.css"; +import { useAppContext } from "./AppContext"; +import { observer } from "mobx-react-lite"; const shouldCollapse = (field: CollapsedFieldProps) => { if ( @@ -15,7 +16,7 @@ const shouldCollapse = (field: CollapsedFieldProps) => { return false; }; -export const SyntaxTree = () => { +export const SyntaxTree = observer(() => { const { syntaxTree } = useAppContext(); if (!syntaxTree) { return null; @@ -34,4 +35,4 @@ export const SyntaxTree = () => { /> ); -}; +}); diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index e0903dbf0..87d21aa9a 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; -using Microsoft.Extensions.Logging; namespace CSharpier.Playground.Controllers; @@ -27,39 +22,55 @@ public class FormatError [Route("[controller]")] public class FormatController : ControllerBase { - private readonly IWebHostEnvironment webHostEnvironment; private readonly ILogger logger; - // ReSharper disable once SuggestBaseTypeForParameter - public FormatController( - IWebHostEnvironment webHostEnvironment, - ILogger logger - ) + public FormatController(ILogger logger) { - this.webHostEnvironment = webHostEnvironment; this.logger = logger; } [HttpPost] - public async Task Post([FromBody] string content) + public async Task Post([FromBody] string content, string fileExtension) { - var result = await CSharpFormatter.FormatAsync( - content, - new PrinterOptions + if (fileExtension == "cs") + { + var result = await CSharpFormatter.FormatAsync( + content, + new PrinterOptions + { + IncludeAST = true, + IncludeDocTree = true, + Width = PrinterOptions.WidthUsedByTests + } + ); + + return new FormatResult { - IncludeAST = true, - IncludeDocTree = true, - Width = PrinterOptions.WidthUsedByTests - } - ); + Code = result.Code, + Json = result.AST, + Doc = result.DocTree, + Errors = result.CompilationErrors.Select(this.ConvertError).ToList(), + }; + } - return new FormatResult + if (fileExtension == "csproj") { - Code = result.Code, - Json = result.AST, - Doc = result.DocTree, - Errors = result.CompilationErrors.Select(this.ConvertError).ToList(), - }; + var result = await XmlFormatter.FormatAsync( + content, + new PrinterOptions { Width = PrinterOptions.WidthUsedByTests }, + CancellationToken.None + ); + + return new FormatResult + { + Code = result.Code, + Json = "{}", + Doc = string.Empty, + Errors = new List() + }; + } + + throw new Exception("Cannot handle file extension " + fileExtension); } private FormatError ConvertError(Diagnostic diagnostic) From 5887f441446ef4ccd0b41ca9bc5459126f5b6b62 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 27 Mar 2023 12:26:29 -0500 Subject: [PATCH 09/21] Trying to format with the CLI --- Scripts/UpdateCSharpierRepos.ps1 | 7 +++-- Src/CSharpier.Cli/CommandLineFormatter.cs | 33 ++++++++++++++++++----- Src/CSharpier/XmlFormatter.cs | 5 ++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Scripts/UpdateCSharpierRepos.ps1 b/Scripts/UpdateCSharpierRepos.ps1 index 1753f8668..91a7713d9 100644 --- a/Scripts/UpdateCSharpierRepos.ps1 +++ b/Scripts/UpdateCSharpierRepos.ps1 @@ -39,14 +39,17 @@ $destination = "C:\projects\csharpier-repos\" Set-Location $destination & git checkout main -Get-ChildItem $tempLocation | Copy-Item -Destination $destination -Filter *.cs -Recurse -Force +Get-ChildItem $tempLocation | Copy-Item -Destination $destination -Recurse -Force + +$extensions = (".cs", ".csproj", ".props", ".targets") $items = Get-ChildItem -Recurse C:\projects\csharpier-repos -File foreach ($item in $items) { if ($item.Name -eq ".git") { Remove-Item -Force -Recurse $item.FullName } - if ($item.Extension -ne ".cs" -and $item.Name -ne ".csharpierignore") { + + if (-not ($extensions.Contains($item.Extension)) -and $item.Name -ne ".csharpierignore") { Remove-Item $item.FullName } } diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index d141ffef7..d0e300266 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -191,7 +191,14 @@ await FormatPhysicalFile( } var tasks = fileSystem.Directory - .EnumerateFiles(directoryOrFile, "*.cs", SearchOption.AllDirectories) + .EnumerateFiles(directoryOrFile, "*.*", SearchOption.AllDirectories) + .Where( + o => + o.EndsWith(".cs") + || o.EndsWith(".csproj") + || o.EndsWith(".props") + || o.EndsWith(".targets") + ) .Select(o => { var normalizedPath = o.Replace("\\", "/"); @@ -354,12 +361,24 @@ CancellationToken cancellationToken try { - // TODO xml find correct formatter - codeFormattingResult = await CSharpFormatter.FormatAsync( - fileToFormatInfo.FileContents, - printerOptions, - cancellationToken - ); + var extension = Path.GetExtension(fileToFormatInfo.Path).ToLower(); + codeFormattingResult = extension switch + { + "csproj" + or "props" + or "targets" + => await XmlFormatter.FormatAsync( + fileToFormatInfo.FileContents, + printerOptions, + cancellationToken + ), + _ + => await CSharpFormatter.FormatAsync( + fileToFormatInfo.FileContents, + printerOptions, + cancellationToken + ) + }; } catch (OperationCanceledException) { diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs index 65397d370..3c69162ee 100644 --- a/Src/CSharpier/XmlFormatter.cs +++ b/Src/CSharpier/XmlFormatter.cs @@ -11,9 +11,8 @@ internal static async Task FormatAsync( CancellationToken cancellationToken ) { - // TODO width - // TODO test other things - // TODO get this working from CLI + // TODO xml width? + // TODO xml test other things var stringBuilder = new StringWriter(); var settings = new XmlWriterSettings From 30f05a4020626d71b2b44dd078bbc806d044180a Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 27 Mar 2023 16:07:32 -0500 Subject: [PATCH 10/21] fixing warnings --- Src/CSharpier.Cli/CommandLineFormatter.cs | 6 +----- Src/CSharpier.Playground/Controllers/FormatController.cs | 5 ++--- Src/CSharpier/CodeFormatter.cs | 7 ++++--- Src/CSharpier/XmlFormatter.cs | 6 +----- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index d0e300266..ba302c68c 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -367,11 +367,7 @@ CancellationToken cancellationToken "csproj" or "props" or "targets" - => await XmlFormatter.FormatAsync( - fileToFormatInfo.FileContents, - printerOptions, - cancellationToken - ), + => XmlFormatter.Format(fileToFormatInfo.FileContents, printerOptions), _ => await CSharpFormatter.FormatAsync( fileToFormatInfo.FileContents, diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 87d21aa9a..0961b781a 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -55,10 +55,9 @@ public async Task Post([FromBody] string content, string fileExten if (fileExtension == "csproj") { - var result = await XmlFormatter.FormatAsync( + var result = XmlFormatter.Format( content, - new PrinterOptions { Width = PrinterOptions.WidthUsedByTests }, - CancellationToken.None + new PrinterOptions { Width = PrinterOptions.WidthUsedByTests } ); return new FormatResult diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index 261328ef5..2d5ecbced 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -45,7 +45,8 @@ public static Task FormatAsync( ); } - internal static Task FormatAsync( + // TODO XML make use of this? + internal static async Task FormatAsync( string fileContents, string fileExtension, PrinterOptions options, @@ -56,12 +57,12 @@ CancellationToken cancellationToken if (loweredExtension is "cs") { - return CSharpFormatter.FormatAsync(fileContents, options, cancellationToken); + return await CSharpFormatter.FormatAsync(fileContents, options, cancellationToken); } if (loweredExtension is "csproj" or "props" or "targets" or "xml") { - return XmlFormatter.FormatAsync(fileContents, options, cancellationToken); + return XmlFormatter.Format(fileContents, options); } throw new Exception("Cannot format file with extension " + fileExtension); diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs index 3c69162ee..4a27ce310 100644 --- a/Src/CSharpier/XmlFormatter.cs +++ b/Src/CSharpier/XmlFormatter.cs @@ -5,11 +5,7 @@ namespace CSharpier; internal static class XmlFormatter { - internal static async Task FormatAsync( - string code, - PrinterOptions printerOptions, - CancellationToken cancellationToken - ) + internal static CodeFormatterResult Format(string code, PrinterOptions printerOptions) { // TODO xml width? // TODO xml test other things From f5e8be4bef36349b010312e2a1fe263ca48081c6 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Tue, 28 Mar 2023 13:04:23 -0500 Subject: [PATCH 11/21] Some notes and fixes --- Src/CSharpier.Cli/CommandLineFormatter.cs | 40 ++++++++++------------- Src/CSharpier/CodeFormatter.cs | 6 ++-- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index ba302c68c..ad783472c 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -287,12 +287,6 @@ CancellationToken cancellationToken var fileIssueLogger = new FileIssueLogger(originalFilePath, logger); - if (!actualFilePath.EndsWithIgnoreCase(".cs") && !actualFilePath.EndsWithIgnoreCase(".cst")) - { - fileIssueLogger.WriteError("Is an unsupported file type."); - return; - } - await PerformFormattingSteps( fileToFormatInfo, writer, @@ -357,24 +351,16 @@ CancellationToken cancellationToken cancellationToken.ThrowIfCancellationRequested(); - CodeFormatterResult codeFormattingResult; + CodeFormatterResult? codeFormattingResult; try { - var extension = Path.GetExtension(fileToFormatInfo.Path).ToLower(); - codeFormattingResult = extension switch - { - "csproj" - or "props" - or "targets" - => XmlFormatter.Format(fileToFormatInfo.FileContents, printerOptions), - _ - => await CSharpFormatter.FormatAsync( - fileToFormatInfo.FileContents, - printerOptions, - cancellationToken - ) - }; + codeFormattingResult = await CodeFormatter.FormatAsync( + fileToFormatInfo.FileContents, + Path.GetExtension(fileToFormatInfo.Path), + printerOptions, + cancellationToken + ); } catch (OperationCanceledException) { @@ -406,7 +392,17 @@ CancellationToken cancellationToken return; } - if (!commandLineOptions.Fast) + // TODO xml the old style csproj is losing the Date: Mon, 17 Apr 2023 10:02:58 -0500 Subject: [PATCH 12/21] Adding some tests. Fixing + + v4.5.2 + + diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test new file mode 100644 index 000000000..9c620221e --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test @@ -0,0 +1,97 @@ + + + + + + + \ No newline at end of file diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test new file mode 100644 index 000000000..37ddb2139 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test @@ -0,0 +1,3 @@ + + + diff --git a/Src/CSharpier.Tests/Samples/AllInOne.test b/Src/CSharpier.Tests/Samples/AllInOne.test index 1d8ef2950..5f282702b 100644 --- a/Src/CSharpier.Tests/Samples/AllInOne.test +++ b/Src/CSharpier.Tests/Samples/AllInOne.test @@ -1 +1 @@ -Doc.HardLineIfNoPreviousLine \ No newline at end of file + \ No newline at end of file diff --git a/Src/CSharpier.Tests/Samples/Scratch.test b/Src/CSharpier.Tests/Samples/Scratch.test index 1d8ef2950..5f282702b 100644 --- a/Src/CSharpier.Tests/Samples/Scratch.test +++ b/Src/CSharpier.Tests/Samples/Scratch.test @@ -1 +1 @@ -Doc.HardLineIfNoPreviousLine \ No newline at end of file + \ No newline at end of file diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs index 4a27ce310..669788dc2 100644 --- a/Src/CSharpier/XmlFormatter.cs +++ b/Src/CSharpier/XmlFormatter.cs @@ -1,6 +1,5 @@ namespace CSharpier; -using System.Text; using System.Xml; internal static class XmlFormatter @@ -8,7 +7,6 @@ internal static class XmlFormatter internal static CodeFormatterResult Format(string code, PrinterOptions printerOptions) { // TODO xml width? - // TODO xml test other things var stringBuilder = new StringWriter(); var settings = new XmlWriterSettings @@ -16,7 +14,7 @@ internal static CodeFormatterResult Format(string code, PrinterOptions printerOp Indent = true, IndentChars = printerOptions.UseTabs ? "\t" : new string(' ', printerOptions.TabWidth), NewLineChars = PrinterOptions.GetLineEnding(code, printerOptions), - OmitXmlDeclaration = true + OmitXmlDeclaration = !code.Trim().StartsWith(" Date: Mon, 17 Apr 2023 11:03:40 -0500 Subject: [PATCH 13/21] Getting the basics of printing Xml with Doc going --- .../ClientApp/src/Controls.tsx | 6 ++- .../Controllers/FormatController.cs | 14 +++-- .../TestFiles/csproj/Elements.test | 4 ++ .../TestFiles/csproj/RetainXmlElement.test | 3 +- Src/CSharpier.Tests/Samples/AllInOne.test | 2 +- Src/CSharpier.Tests/Samples/Scratch.test | 2 +- Src/CSharpier/CSharpFormatter.cs | 10 ++-- Src/CSharpier/CodeFormatter.cs | 2 + Src/CSharpier/Formatters/Xml/XmlFormatter.cs | 39 ++++++++++++++ .../Formatters/Xml/XmlNodePrinters/Element.cs | 52 +++++++++++++++++++ .../Formatters/Xml/XmlNodePrinters/Node.cs | 39 ++++++++++++++ Src/CSharpier/XmlFormatter.cs | 41 --------------- 12 files changed, 159 insertions(+), 55 deletions(-) create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test create mode 100644 Src/CSharpier/Formatters/Xml/XmlFormatter.cs create mode 100644 Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs create mode 100644 Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs delete mode 100644 Src/CSharpier/XmlFormatter.cs diff --git a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx index 55ead9d8c..a4c6f5fd5 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx @@ -43,6 +43,8 @@ export const Controls = observer(() => { + + )} - - )} + + ); }); diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 0961b781a..6ceacc8da 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -4,6 +4,8 @@ namespace CSharpier.Playground.Controllers; +using CSharpier.Formatters.Xml; + public class FormatResult { public required string Code { get; set; } @@ -32,6 +34,7 @@ public FormatController(ILogger logger) [HttpPost] public async Task Post([FromBody] string content, string fileExtension) { + // TODO use the proper formatter class? if (fileExtension == "cs") { var result = await CSharpFormatter.FormatAsync( @@ -57,14 +60,19 @@ public async Task Post([FromBody] string content, string fileExten { var result = XmlFormatter.Format( content, - new PrinterOptions { Width = PrinterOptions.WidthUsedByTests } + new PrinterOptions + { + Width = PrinterOptions.WidthUsedByTests, + IncludeAST = true, + IncludeDocTree = true, + } ); return new FormatResult { Code = result.Code, - Json = "{}", - Doc = string.Empty, + Json = result.AST, + Doc = result.DocTree, Errors = new List() }; } diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test new file mode 100644 index 000000000..354eca1ac --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test @@ -0,0 +1,4 @@ + + + Text + diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test index 37ddb2139..14be65070 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test @@ -1,3 +1,2 @@ - - + diff --git a/Src/CSharpier.Tests/Samples/AllInOne.test b/Src/CSharpier.Tests/Samples/AllInOne.test index 5f282702b..1d8ef2950 100644 --- a/Src/CSharpier.Tests/Samples/AllInOne.test +++ b/Src/CSharpier.Tests/Samples/AllInOne.test @@ -1 +1 @@ - \ No newline at end of file +Doc.HardLineIfNoPreviousLine \ No newline at end of file diff --git a/Src/CSharpier.Tests/Samples/Scratch.test b/Src/CSharpier.Tests/Samples/Scratch.test index 5f282702b..1d8ef2950 100644 --- a/Src/CSharpier.Tests/Samples/Scratch.test +++ b/Src/CSharpier.Tests/Samples/Scratch.test @@ -1 +1 @@ - \ No newline at end of file +Doc.HardLineIfNoPreviousLine \ No newline at end of file diff --git a/Src/CSharpier/CSharpFormatter.cs b/Src/CSharpier/CSharpFormatter.cs index 1592e6af9..aa98b0775 100644 --- a/Src/CSharpier/CSharpFormatter.cs +++ b/Src/CSharpier/CSharpFormatter.cs @@ -110,8 +110,8 @@ bool TryGetCompilationFailure(out CodeFormatterResult compilationResult) } var lineEnding = PrinterOptions.GetLineEnding(syntaxTree.ToString(), printerOptions); - var document = Node.Print(rootNode, new FormattingContext { LineEnding = lineEnding }); - var formattedCode = DocPrinter.DocPrinter.Print(document, printerOptions, lineEnding); + var doc = Node.Print(rootNode, new FormattingContext { LineEnding = lineEnding }); + var formattedCode = DocPrinter.DocPrinter.Print(doc, printerOptions, lineEnding); PreprocessorSymbols.StopCollecting(); foreach (var symbolSet in PreprocessorSymbols.GetSymbolSets()) @@ -123,18 +123,18 @@ bool TryGetCompilationFailure(out CodeFormatterResult compilationResult) return result; } - document = Node.Print( + doc = Node.Print( await syntaxTree.GetRootAsync(cancellationToken), new FormattingContext() ); - formattedCode = DocPrinter.DocPrinter.Print(document, printerOptions, lineEnding); + formattedCode = DocPrinter.DocPrinter.Print(doc, printerOptions, lineEnding); } return new CodeFormatterResult { Code = formattedCode, DocTree = printerOptions.IncludeDocTree - ? DocSerializer.Serialize(document) + ? DocSerializer.Serialize(doc) : string.Empty, AST = printerOptions.IncludeAST ? PrintAST(rootNode) : string.Empty }; diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index e4580128d..b67fa3338 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -1,5 +1,7 @@ namespace CSharpier; +using CSharpier.Formatters.Xml; + public static class CodeFormatter { public static CodeFormatterResult Format(string code, CodeFormatterOptions? options = null) diff --git a/Src/CSharpier/Formatters/Xml/XmlFormatter.cs b/Src/CSharpier/Formatters/Xml/XmlFormatter.cs new file mode 100644 index 000000000..9a592ffb0 --- /dev/null +++ b/Src/CSharpier/Formatters/Xml/XmlFormatter.cs @@ -0,0 +1,39 @@ +namespace CSharpier.Formatters.Xml; + +using System.Text.Json; +using System.Xml; +using CSharpier.Formatters.Xml.XmlNodePrinters; + +internal static class XmlFormatter +{ + internal static CodeFormatterResult Format(string xml, PrinterOptions printerOptions) + { + // TODO xml width? + // var stringBuilder = new StringWriter(); + // + // var settings = new XmlWriterSettings + // { + // Indent = true, + // IndentChars = printerOptions.UseTabs ? "\t" : new string(' ', printerOptions.TabWidth), + // NewLineChars = PrinterOptions.GetLineEnding(code, printerOptions), + // OmitXmlDeclaration = !code.Trim().StartsWith("", + PrintChildren(element), + "" + ); + } + + private static Doc PrintAttributes(XmlElement element) + { + var result = new List(); + foreach (XmlAttribute attribute in element.Attributes) + { + result.Add(" "); + result.Add(attribute.OuterXml); + } + + return Doc.Concat(result); + } + + private static Doc PrintChildren(XmlElement element) + { + if (element.ChildNodes.Count == 0) + { + return Doc.Null; + } + + if (element.FirstChild is XmlText) + { + return Node.Print(element.FirstChild); + } + + var result = new List(); + + foreach (XmlNode xmlNode in element.ChildNodes) + { + result.Add(Doc.Line); + result.Add(Node.Print(xmlNode)); + } + + return Doc.Concat(Doc.BreakParent, Doc.Indent(result), Doc.Line); + } +} diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs new file mode 100644 index 000000000..e06ce27cf --- /dev/null +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs @@ -0,0 +1,39 @@ +namespace CSharpier.Formatters.Xml.XmlNodePrinters; + +using System.Xml; + +internal static class Node +{ + internal static Doc Print(XmlNode xmlNode) + { + if (xmlNode is XmlDocument xmlDocument) + { + var result = new List(); + foreach (XmlNode node in xmlDocument.ChildNodes) + { + result.Add(Print(node), Doc.HardLine); + } + + result.Add(Doc.HardLine); + + return Doc.Concat(result); + } + + if (xmlNode is XmlDeclaration xmlDeclaration) + { + return xmlDeclaration.OuterXml; + } + + if (xmlNode is XmlElement xmlElement) + { + return Element.Print(xmlElement); + } + + if (xmlNode is XmlText) + { + return xmlNode.OuterXml; + } + + throw new Exception("Need to handle + " + xmlNode); + } +} diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs deleted file mode 100644 index 669788dc2..000000000 --- a/Src/CSharpier/XmlFormatter.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace CSharpier; - -using System.Xml; - -internal static class XmlFormatter -{ - internal static CodeFormatterResult Format(string code, PrinterOptions printerOptions) - { - // TODO xml width? - var stringBuilder = new StringWriter(); - - var settings = new XmlWriterSettings - { - Indent = true, - IndentChars = printerOptions.UseTabs ? "\t" : new string(' ', printerOptions.TabWidth), - NewLineChars = PrinterOptions.GetLineEnding(code, printerOptions), - OmitXmlDeclaration = !code.Trim().StartsWith(" Date: Mon, 17 Apr 2023 11:12:56 -0500 Subject: [PATCH 14/21] Fixing thing --- Src/CSharpier.Cli/CommandLineFormatter.cs | 2 +- .../Controllers/FormatController.cs | 2 +- .../FormattingTests/BaseTest.cs | 6 +- Src/CSharpier.Tests/Samples/AllInOne.test | 25096 +++++++++++++++- Src/CSharpier.Tests/Samples/Scratch.test | 2 +- Src/CSharpier/XmlFormatter.cs | 13 - 6 files changed, 23965 insertions(+), 1156 deletions(-) delete mode 100644 Src/CSharpier/XmlFormatter.cs diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index 05bc6431c..423ac3f56 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -356,7 +356,7 @@ CancellationToken cancellationToken try { // TODO xml find correct formatter - codeFormattingResult = await CSharpFormatter.FormatAsync( + codeFormattingResult = await CodeFormatter.FormatAsync( fileToFormatInfo.FileContents, Path.GetExtension(fileToFormatInfo.Path), printerOptions, diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 6ceacc8da..64b7c2706 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -34,7 +34,7 @@ public FormatController(ILogger logger) [HttpPost] public async Task Post([FromBody] string content, string fileExtension) { - // TODO use the proper formatter class? + // TODO xml use the proper formatter class? if (fileExtension == "cs") { var result = await CSharpFormatter.FormatAsync( diff --git a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs index 16e7ccc67..aa59f9ec8 100644 --- a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs +++ b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs @@ -11,7 +11,11 @@ public class BaseTest { private readonly DirectoryInfo rootDirectory = DirectoryFinder.FindParent("CSharpier.Tests"); - protected async Task RunTest(string fileName, string fileExtensionWithoutDot, bool useTabs = false) + protected async Task RunTest( + string fileName, + string fileExtensionWithoutDot, + bool useTabs = false + ) { var filePath = Path.Combine( this.rootDirectory.FullName, diff --git a/Src/CSharpier.Tests/Samples/AllInOne.test b/Src/CSharpier.Tests/Samples/AllInOne.test index 30dffe258..399bbfdcc 100644 --- a/Src/CSharpier.Tests/Samples/AllInOne.test +++ b/Src/CSharpier.Tests/Samples/AllInOne.test @@ -1,623 +1,12130 @@ -#error Error message -#warning Warning message -#pragma warning disable 414, 3021 -#pragma warning restore 3021 -#pragma checksum "file.txt" "{00000000-0000-0000-0000-000000000000}" "2453" -#define foo // Comment in directive -#if foo -#else -#endif -#undef foo - -extern alias Foo; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using M = System.Math; - -#if DEBUG || TRACE -using System.Diagnostics; -#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false -using System.Diagnostics; -#else -using System.Diagnostics; -#endif - -#region Region - - #region more -using ConsoleApplication2.Test; - #endregion -using X = int1; -using Y = ABC.X; - -using static System.Math; -using static System.DayOfWeek; -using static System.Linq.Enumerable; - -#endregion - -[assembly: System.Copyright(@"(C)"" - -2009")] -[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] - -class TopLevelType : IDisposable -{ - void IDisposable.Dispose() { } -} - -namespace My -{ - using A.B; - - interface CoContra { } - delegate void CoContra2<[System.Obsolete()] out T, in K>() - where T : struct; - - public unsafe partial class A : C, I - { - [DllImport("kernel32", SetLastError = true)] - static extern bool CreateDirectory(string name, SecurityAttribute sa); - - private const int global = int.MinValue - 1; - - static A() { } - - public A(int foo) - { - L: - { - int i = sizeof(int); - ++i; - var s1 = $"x {1, -2:d}"; - var s2 = $@"x {1, -2:d}"; - } - -#if DEBUG - Console.WriteLine(export.iefSupplied.command); -#endif - const int? local = int.MaxValue; - const Guid? local0 = new Guid(r.ToString()); - - var привет = local; - var мир = local; - var local3 = 0, - local4 = 1; - local3 = local4 = 1; - var local5 = null as Action ?? null; - var local6 = local5 is Action; - - var u = 1u; - var U = 1U; - long hex = 0xBADC0DE, - Hex = 0XDEADBEEF, - l = -1L, - L = 1L, - l2 = 2l; - ulong ul = 1ul, - Ul = 1Ul, - uL = 1uL, - UL = 1UL, - lu = 1lu, - Lu = 1Lu, - lU = 1lU, - LU = 1LU; - int minInt32Value = -2147483648; - int minInt64Value = -9223372036854775808L; - - bool @bool; - byte @byte; - char @char = 'c', - \u0066 = '\u0066', - hexchar = '\x0130', - hexchar2 = (char)0xBAD; - string \U00000065 = "\U00000065"; - decimal @decimal = 1.44M; - @decimal = 1.2m; - dynamic @dynamic; - double @double = M.PI; - @double = 1d; - @double = 1D; - @double = -1.2e3; - float @float = 1.2f; - @float = 1.44F; - int @int = local ?? -1; - long @long; - object @object; - sbyte @sbyte; - short @short; - string @string = @"""/*"; - uint @uint; - ulong @ulong; - ushort @ushort; - - dynamic dynamic = local5; - var add = 0; - var alias = 0; - var arglist = 0; - var ascending = 0; - var async = 0; - var await = 0; - var by = 0; - var descending = 0; - var dynamic = 0; - var equals = 0; - var from = 0; - var get = 0; - var group = 0; - var into = 0; - var join = 0; - var let = 0; - var nameof = 0; - var on = 0; - var orderby = 0; - var partial = 0; - var remove = 0; - var select = 0; - var set = 0; - var when = 0; - var where = 0; - var yield = 0; - var __ = 0; - where = yield = 0; - - if (i > 0) - { - return; - } - else if (i == 0) - { - throw new Exception(); - } - var o1 = new MyObject(); - var o2 = new MyObject(var); - var o3 = new MyObject { A = i }; - var o4 = new MyObject(@dynamic) { A = 0, B = 0, C = 0 }; - var o5 = new { A = 0 }; - var dictionaryInitializer = new Dictionary - { - { 1, "" }, - { 2, "a" } - }; - float[] a = new float[] { 0f, 1.1f }; - int[,,] cube = { - { { 111, 112 }, { 121, 122 } }, - { { 211, 212 }, { 221, 222 } } - }; - - int[][] jagged = { { 111 }, { 121, 122 } }; - int[][,] arr = new int[5][,]; // as opposed to new int[][5,5] - arr[0] = new int[5,5]; // as opposed to arr[0,0] = new int[5]; - arr[0][0, 0] = 47; - int[] arrayTypeInference = new[] { 0, 1 }; - switch (3) { } - switch (i) - { - case 0: - case 1: - { - goto case 2; - } - case 2 + 3: - { - goto default; - break; - } - default: - { - return; - } - } - while (i < 10) - { - ++i; - if (true) - { - continue; - } - break; - } - do - { - ++i; - if (true) - { - continue; - } - break; - } - while (i < 10); - for (int j = 0; j < 100; ++j) - { - for (;;) - { - for (int i = 0, j = 0; i < length; i++, j++) { } - if (true) - { - continue; - } - break; - } - } - label: - goto label; - label2: - ; - foreach (var i in Items()) - { - if (i == 7) - { - return; - } - else - { - continue; - } - } - checked - { - checked(++i); - } - unchecked - { - unchecked(++i); - } - lock (sync) - process(); - using (var v = BeginScope()) - using (A a = new A()) - using (A a = new A(), b = new A()) - using (BeginScope()) - return; - yield return this.items[3]; - yield break; - fixed (int* p = stackalloc int[100], q = &y) - { - *intref = 1; - } - fixed (int* p = stackalloc int[100]) - { - *intref = 1; - } - unsafe - { - int* p = null; - } - try - { - throw null; - } - catch (System.AccessViolationException av) - { - throw av; - } - catch (Exception) - { - throw; - } - finally - { - try { } - catch { } - } - var anonymous = { A = 1, B = 2, C = 3 }; - var query = - from c in customers - let d = c - where d != null - join c1 in customers on c1.GetHashCode() equals c.GetHashCode() - join c1 in customers - on c1.GetHashCode() equals c.GetHashCode() - into e - group c by c.Country into g - orderby g.Count() ascending - orderby g.Key descending - select new { Country = g.Key, CustCount = g.Count() }; - query = from c in customers select c into d select d; - } - ~A() { } - private readonly int f1; - [Obsolete] - [NonExisting] - [Foo::NonExisting(var, 5)] - [CLSCompliant(false)] - [ - Obsolete, - System.NonSerialized, - NonSerialized, - CLSCompliant(true || false & true) - ] - private volatile int f2; - [return: Obsolete] - [method: Obsolete] - public void Handler(object value) { } - public int m(T t) - where T : class, new() - { - base.m(t); - return 1; - } - public string P - { - get { return "A"; } - set; - } - public abstract string P { get; } - public abstract int this[int index] - { - protected internal get; - internal protected set; - } - [method: Obsolete] - [field: Obsolete] - [event: Obsolete] - public readonly event Event E; - [event: Test] - public event Action E1 - { - [Obsolete] - add { value = value; } - [Obsolete] - [return: Obsolete] - remove - { - E += Handler; - E -= Handler; - } - } - public static A operator +(A first, A second) - { - Delegate handler = new Delegate(Handler); - return first.Add(second); - } - [method: Obsolete] - [return: Obsolete] - public static bool operator true(A a) - { - return true; - } - public static bool operator false(A a) - { - return false; - } - class C { } +Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#error Error message"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#warning Warning message"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#pragma warning disable 414, 3021"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#pragma warning restore 3021"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#pragma checksum \"file.txt\" \"{00000000-0000-0000-0000-000000000000}\" \"2453\""), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#define foo // Comment in directive"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if foo"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#else"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#undef foo"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "extern", + " " + ), + Doc.Concat( + "alias", + " " + ), + "Foo", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + "System", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + "System", + ".", + "Collections" + ), + ".", + "Generic" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Linq" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + "System", + ".", + "Linq" + ), + ".", + "Expressions" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Text" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Concat( + "M", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Concat( + "System", + ".", + "Math" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if DEBUG || TRACE"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Diagnostics" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#elif SILVERLIGHT && WINDOWS_PHONE || DEBUG || foo == true || foo != false"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.Trim, + "using System.Diagnostics; +", + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#else"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.Trim, + "using System.Diagnostics; +", + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.BeginRegion("#region Region"), + Doc.HardLine, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.BeginRegion("#region more"), + Doc.HardLine + ) + ), + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "ConsoleApplication2", + ".", + "Test" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.EndRegion("#endregion"), + Doc.HardLine + ) + ), + "using", + " " + ), + Doc.Null, + Doc.Concat( + "X", + " ", + Doc.Concat( + "=", + " " + ) + ), + "int1", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Concat( + "Y", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Concat( + "ABC", + ".", + Doc.Group( + "X", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Concat( + "static", + " " + ), + Doc.Null, + Doc.Concat( + "System", + ".", + "Math" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Concat( + "static", + " " + ), + Doc.Null, + Doc.Concat( + "System", + ".", + "DayOfWeek" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Concat( + "static", + " " + ), + Doc.Null, + Doc.Concat( + Doc.Concat( + "System", + ".", + "Linq" + ), + ".", + "Enumerable" + ), + ";" + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLine, + Doc.Trim, + Doc.EndRegion("#endregion"), + Doc.HardLine, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "[" + ), + "assembly", + Doc.Concat( + ":", + " " + ), + Doc.Group( + Doc.Concat( + "System", + ".", + "Copyright" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "@\"(C)\"\"", + Doc.LiteralLine, + "", + Doc.LiteralLine, + "2009\"" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + "[", + "module", + Doc.Concat( + ":", + " " + ), + Doc.Group( + Doc.Concat( + "System", + ".", + "Copyright" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "\"\n\t\u0123(C) \\"2009\"", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "\"\u0123\"" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "TopLevelType", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "IDisposable", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "IDisposable", + ".", + "Dispose", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "My", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "A", + ".", + "B" + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "CoContra", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "out", + " " + ), + "T" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "in", + " " + ), + "K" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "delegate", + " " + ), + "void", + " ", + "CoContra2", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.GroupWithId( + "a82b1bcf-4804-4955-8edb-e8d64c7969f4", + Doc.Group( + "[", + Doc.Group( + Doc.Concat( + "System", + ".", + "Obsolete" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Null + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.IndentIfBreak( + Doc.Line, + "a82b1bcf-4804-4955-8edb-e8d64c7969f4" + ), + Doc.Concat( + "out", + " " + ), + "T" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "in", + " " + ), + "K" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + "(", + Doc.Null, + ")" + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "struct", + Doc.Null + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + "public", + " ", + "unsafe", + " ", + "partial" + ), + " " + ), + Doc.Concat( + "class", + " " + ), + "A", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "C", + Doc.Indent( + ",", + Doc.Line, + "I" + ) + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Group( + "[", + Doc.Group( + "DllImport", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "\"kernel32\"" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "SetLastError", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Null, + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "extern", + " " + ) + ) + ), + "bool", + " ", + "CreateDirectory", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + " ", + "name" + ), + ",", + Doc.Line, + Doc.Concat( + "SecurityAttribute", + " ", + "sa" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "private", + " ", + "const" + ), + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "global", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "int", + Doc.Concat( + ".", + "MinValue" + ) + ), + Doc.Group( + Doc.Line, + "-", + " ", + "1" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Null + ), + "A", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "A", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "foo" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "L", + ":", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "1f72111f-4c49-4ccb-860b-9cba49cadc05", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "sizeof", + "(", + "int", + ")" + ), + "1f72111f-4c49-4ccb-860b-9cba49cadc05" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "++", + "i" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "s1", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + "x ", + Doc.Concat( + "{", + "1", + Doc.Concat( + ",", + " " + ), + Doc.Concat( + "-", + "2" + ), + ":", + "d", + "}" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "s2", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$@\"", + "x ", + Doc.Concat( + "{", + "1", + Doc.Concat( + ",", + " " + ), + Doc.Concat( + "-", + "2" + ), + ":", + "d", + "}" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if DEBUG"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "Console" + ), + Doc.Concat( + ".", + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "export", + Doc.Concat( + ".", + "iefSupplied" + ), + Doc.Concat( + ".", + "command" + ) + ), + Doc.Concat( + Doc.Concat( + "export" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "iefSupplied" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "command" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "const" + ), + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "local", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "6daecd8f-0a6c-4b9e-8cb7-9819976d094c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "int", + Doc.Concat( + ".", + "MaxValue" + ) + ), + "6daecd8f-0a6c-4b9e-8cb7-9819976d094c" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "const", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "Guid", + "?" + ), + " ", + "local0", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f8c173a1-ac0c-4c83-b3fc-6349f3012326", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Guid", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "r", + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "r" + ), + Doc.Concat( + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "f8c173a1-ac0c-4c83-b3fc-6349f3012326" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "привет", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f8841f95-00ff-44a4-8aee-465170ad58c8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "local", + "f8841f95-00ff-44a4-8aee-465170ad58c8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "мир", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b4b12fde-1d02-437c-bbcb-37be4b5c9f38", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "local", + "b4b12fde-1d02-437c-bbcb-37be4b5c9f38" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "var", + " ", + Doc.Indent( + Doc.Concat( + "local3", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "local4", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "local3", + " " + ), + "=", + Doc.GroupWithId( + "8cdf3989-8b8b-48e4-a626-d100069717e6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Group( + "local4", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + "8cdf3989-8b8b-48e4-a626-d100069717e6" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "local5", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "null", + Doc.Indent( + Doc.Group( + Doc.Line, + "as", + " ", + "Action" + ) + ) + ), + Doc.Line, + "??", + " ", + "null" + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "local6", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "local5", + Doc.Group( + Doc.Line, + "is", + " ", + "Action" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "u", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1u" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "U", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1U" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "long", + " ", + Doc.Indent( + Doc.Concat( + "hex", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0xBADC0DE" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "Hex", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0XDEADBEEF" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "l", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + "-", + "1L" + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "L", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1L" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "l2", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "2l" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "ulong", + " ", + Doc.Indent( + Doc.Concat( + "ul", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1ul" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "Ul", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1Ul" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "uL", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1uL" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "UL", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1UL" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "lu", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1lu" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "Lu", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1Lu" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "lU", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1lU" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "LU", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "1LU" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "minInt32Value", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b94f1744-a8d3-447a-a647-6b9a79ec30ed", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "-", + "2147483648" + ), + "b94f1744-a8d3-447a-a647-6b9a79ec30ed" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "minInt64Value", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "eae948c3-6a42-4b0a-bf40-e2fc070a8d2c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "-", + "9223372036854775808L" + ), + "eae948c3-6a42-4b0a-bf40-e2fc070a8d2c" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "bool", + " ", + "@bool", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "byte", + " ", + "@byte", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + "char", + " ", + Doc.Indent( + Doc.Concat( + "@char", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "'c'" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "\u0066", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "'\u0066'" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "hexchar", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "'\x0130'" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "hexchar2", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Group( + "(", + "char", + ")", + Doc.Indent( + Doc.SoftLine, + "0xBAD" + ) + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "\U00000065", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"\U00000065\"" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "decimal", + " ", + "@decimal", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.44M" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@decimal", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.2m" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "dynamic", + " ", + "@dynamic", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "double", + " ", + "@double", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "2d2691d8-d861-47d5-909d-32c8b2f5b829", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "M", + Doc.Concat( + ".", + "PI" + ) + ), + "2d2691d8-d861-47d5-909d-32c8b2f5b829" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@double", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1d" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@double", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1D" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@double", + " " + ), + "=", + Doc.GroupWithId( + "ed10bc6c-bf59-446e-8487-827824e32c80", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "-", + "1.2e3" + ), + "ed10bc6c-bf59-446e-8487-827824e32c80" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "float", + " ", + "@float", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.2f" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "@float", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1.44F" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "@int", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "local", + Doc.Group( + Doc.Line, + "??", + " ", + Doc.Concat( + "-", + "1" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "long", + " ", + "@long", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "object", + " ", + "@object", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "sbyte", + " ", + "@sbyte", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "short", + " ", + "@short", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "@string", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "@\"\"\"/*\"" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "uint", + " ", + "@uint", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "ulong", + " ", + "@ulong", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "ushort", + " ", + "@ushort", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "dynamic", + " ", + "dynamic", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c6b544f7-771e-4e9f-9346-4a3c80a32d8c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "local5", + "c6b544f7-771e-4e9f-9346-4a3c80a32d8c" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "add", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "alias", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "arglist", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "ascending", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "async", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "await", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "by", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "descending", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "dynamic", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "equals", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "from", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "get", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "group", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "into", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "join", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "let", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "nameof", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "on", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "orderby", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "partial", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "remove", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "select", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "set", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "when", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "where", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "yield", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "__", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "where", + " " + ), + "=", + Doc.GroupWithId( + "a306de40-5591-4f52-90d0-311b640b8990", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Group( + "yield", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + "a306de40-5591-4f52-90d0-311b640b8990" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + ">", + " ", + "0" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "else", + Doc.Concat( + " ", + Doc.Concat( + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "==", + " ", + "0" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Exception", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o1", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "2057aeb6-2b32-49f7-af17-09cc34322a14", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "2057aeb6-2b32-49f7-af17-09cc34322a14" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "1574248f-36c6-4fca-8d59-0ffe07762904", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "var" + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "1574248f-36c6-4fca-8d59-0ffe07762904" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o3", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "2a4312af-5bd0-44db-9c82-c4aa642ec5f6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Null, + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "A", + " " + ), + "=", + Doc.GroupWithId( + "62299e93-5ae9-4755-a5a7-b8389a85d048", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "62299e93-5ae9-4755-a5a7-b8389a85d048" + ) + ) + ), + Doc.Line, + "}" + ) + ) + ), + "2a4312af-5bd0-44db-9c82-c4aa642ec5f6" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o4", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b5ed0602-eefd-47b6-89da-f118eb7b2843", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyObject", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "@dynamic" + ), + Doc.SoftLine, + ")" + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Group( + "A", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + "B", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + "C", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ) + ) + ), + Doc.HardLine, + "}" + ) + ) + ), + "b5ed0602-eefd-47b6-89da-f118eb7b2843" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "o5", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "79034426-9f91-4b1b-b041-113d50150ed7", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + Doc.Line + ), + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "A", + " " + ), + Doc.Concat( + "=", + " " + ), + "0" + ) + ), + Doc.Line, + "}" + ), + "79034426-9f91-4b1b-b041-113d50150ed7" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "dictionaryInitializer", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b459eae6-fad3-4766-b792-ea37f201f9f5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Group( + "Dictionary", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null, + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "\"\"" + ) + ), + Doc.Line, + "}" + ), + ",", + Doc.Line, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "2", + ",", + Doc.Line, + "\"a\"" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.Line, + "}" + ) + ) + ), + "b459eae6-fad3-4766-b792-ea37f201f9f5" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "float", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "518004a9-03c4-43ca-90ad-739bcbe640ae", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "float", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "0f", + ",", + Doc.Line, + "1.1f" + ) + ), + Doc.Line, + "}" + ) + ) + ), + "518004a9-03c4-43ca-90ad-739bcbe640ae" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Concat( + Doc.Null, + ",", + Doc.Null, + Doc.Null, + ",", + Doc.Null, + Doc.Null + ), + "]" + ) + ) + ), + " ", + "cube", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "111", + ",", + Doc.Line, + "112" + ) + ), + Doc.Line, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "121", + ",", + Doc.Line, + "122" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "211", + ",", + Doc.Line, + "212" + ) + ), + Doc.Line, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "221", + ",", + Doc.Line, + "222" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "jagged", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + "111" + ), + Doc.Line, + "}" + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "121", + ",", + Doc.Line, + "122" + ) + ), + Doc.Line, + "}" + ) + ) + ), + Doc.HardLine, + "}" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Concat( + Doc.Null, + ",", + Doc.Null, + Doc.Null + ), + "]" + ) + ) + ), + " ", + "arr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "df6fd42f-9267-4137-a1e4-dd1578615c3c", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine + ), + "]" + ), + Doc.Concat( + "[", + Doc.Concat( + Doc.Null, + ",", + Doc.Null, + Doc.Null + ), + "]" + ) + ) + ), + Doc.Null + ), + "df6fd42f-9267-4137-a1e4-dd1578615c3c" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// as opposed to new int[][5,5]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.GroupWithId( + "9be782c6-e907-43e0-897f-3ffca8266c59", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + "5" + ) + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + Doc.Null + ), + "9be782c6-e907-43e0-897f-3ffca8266c59" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// as opposed to arr[0,0] = new int[5];", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ), + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "0", + ",", + Doc.Line, + "0" + ) + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "47" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "arrayTypeInference", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "65f8a7ee-a93d-4702-a813-ca7637f94caa", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "new", + "[", + Doc.Concat( + ), + "]", + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "0", + ",", + Doc.Line, + "1" + ) + ), + Doc.Line, + "}" + ) + ), + "65f8a7ee-a93d-4702-a813-ca7637f94caa" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "switch", + " ", + "(", + Doc.GroupWithId( + "faf43f8f-e343-46b0-8351-f786b14d7de6", + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine + ), + ")", + " ", + "{", + " ", + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "switch", + " ", + "(", + Doc.GroupWithId( + "590286c8-c4b4-4b50-bad7-5c8c878d85e8", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine + ), + ")", + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + Doc.Group( + "0" + ), + ":" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + Doc.Group( + "1" + ), + ":" + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "goto", + " ", + "case", + Doc.Concat( + " ", + "2" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + Doc.Group( + Doc.Group( + "2", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "3" + ) + ) + ) + ), + ":" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + "goto", + " ", + "default", + "", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + "default", + ":" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "while", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "<", + " ", + "10" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Concat( + "++", + "i" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "true" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "do", + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Concat( + "++", + "i" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "true" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + " ", + Doc.Concat( + "while", + " " + ), + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "<", + " ", + "10" + ) + ) + ), + Doc.SoftLine + ), + ")", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "for", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "j", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + Doc.Null, + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Group( + "j", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "100" + ) + ) + ) + ), + ";", + Doc.Line, + Doc.Group( + Doc.Indent( + "++", + "j" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "for", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + Doc.Null, + ";" + ), + Doc.Line, + ";", + Doc.Line, + Doc.Group( + Doc.Indent( + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "for", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Concat( + "int", + " ", + Doc.Indent( + Doc.Concat( + "i", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + "j", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "0" + ) + ) + ) + ) + ), + Doc.Null, + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "length" + ) + ) + ) + ), + ";", + Doc.Line, + Doc.Group( + Doc.Indent( + Doc.Concat( + "i", + "++" + ), + ",", + Doc.Line, + Doc.Concat( + "j", + "++" + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "true" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "label", + ":", + Doc.HardLine, + Doc.Concat( + Doc.Null, + "goto", + Doc.Null, + Doc.Null, + Doc.Concat( + " ", + "label" + ), + ";" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "label2", + ":", + Doc.HardLine, + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "foreach", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "var", + " ", + "i" + ), + " ", + "in", + " ", + Doc.ConditionalGroup( + Doc.Concat( + "Items", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Items", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + "==", + " ", + "7" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "else", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "continue", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "checked", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "checked", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "++", + "i" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "unchecked", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "unchecked", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "++", + "i" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "lock", + " " + ), + "(", + "sync", + ")", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "process", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "process", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "v", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "84e40709-c37d-4f69-99ae-1344c8974428", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.ConditionalGroup( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + "84e40709-c37d-4f69-99ae-1344c8974428" + ) + ), + Doc.Null + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + "A", + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "1d29f401-d619-4e5e-b4c8-63de1a7becfa", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "A", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "1d29f401-d619-4e5e-b4c8-63de1a7becfa" + ) + ), + Doc.Null + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + " ", + Doc.Indent( + Doc.Concat( + "a", + Doc.Group( + " ", + Doc.Concat( + "=", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "A", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "b", + Doc.Group( + " ", + Doc.Concat( + "=", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "A", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ), + Doc.Null + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "using", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "BeginScope", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ) + ) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "yield", + " " + ), + "return", + Doc.Concat( + " ", + Doc.Concat( + Doc.Group( + "this", + Doc.Concat( + ".", + "items" + ) + ), + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine, + "]" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "yield", + " " + ), + "break", + "", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + Doc.Indent( + Doc.Concat( + "p", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "100" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + "q", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + "&", + "y" + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "*", + "intref" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + "p", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "100" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "*", + "intref" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "unsafe", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + "p", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "try", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + "null" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + Doc.Concat( + "System", + ".", + "AccessViolationException" + ), + " ", + "av", + ")" + ), + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + "av" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + "Exception", + Doc.Null, + Doc.Null, + ")" + ), + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + "", + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + "finally", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "try", + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Null, + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "var", + " ", + "anonymous", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Group( + Doc.Group( + "A", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "B", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "2" + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "C", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "3" + ) + ) + ) + ) + ), + Doc.Line, + "}" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "query", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "from", + " " + ), + Doc.Null, + Doc.Concat( + "c", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers" + ), + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "let", + " " + ), + Doc.Concat( + "d", + " " + ), + Doc.Concat( + "=", + " " + ), + "c" + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "where", + Doc.Indent( + Doc.Line, + Doc.Group( + "d", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "join", + " " + ), + Doc.Null, + Doc.Concat( + "c1", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers", + Doc.Indent( + Doc.Line, + Doc.Concat( + "on", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c1", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c1" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + " ", + Doc.Concat( + "equals", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + Doc.Null + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "join", + " " + ), + Doc.Null, + Doc.Concat( + "c1", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers", + Doc.Indent( + Doc.Line, + Doc.Concat( + "on", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c1", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c1" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + " ", + Doc.Concat( + "equals", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "c", + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c" + ), + Doc.Concat( + Doc.Concat( + ".", + "GetHashCode" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + "into", + " " + ), + "e" + ) + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "group", + " " + ), + "c", + " ", + Doc.Concat( + "by", + " " + ), + Doc.Group( + "c", + Doc.Concat( + ".", + "Country" + ) + ) + ), + " ", + Doc.Concat( + Doc.Concat( + "into", + " " + ), + Doc.Concat( + "g", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + "orderby", + Doc.Concat( + " ", + Doc.ConditionalGroup( + Doc.Concat( + "g", + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "g" + ), + Doc.Concat( + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + " ", + "ascending" + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + "orderby", + Doc.Concat( + " ", + Doc.Group( + "g", + Doc.Concat( + ".", + "Key" + ) + ), + " ", + "descending" + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + Doc.Group( + Doc.Concat( + "new", + Doc.Line + ), + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "Country", + " " + ), + Doc.Concat( + "=", + " " + ), + Doc.Group( + "g", + Doc.Concat( + ".", + "Key" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "CustCount", + " " + ), + Doc.Concat( + "=", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "g", + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "g" + ), + Doc.Concat( + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ) + ) + ) + ), + Doc.Line, + "}" + ) + ) + ) + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "query", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "from", + " " + ), + Doc.Null, + Doc.Concat( + "c", + " " + ), + Doc.Concat( + "in", + " " + ), + "customers" + ), + Doc.Line, + Doc.Concat( + Doc.Concat( + ), + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + "c" + ), + " ", + Doc.Concat( + Doc.Concat( + "into", + " " + ), + Doc.Concat( + "d", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + ), + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + "d" + ) + ) + ) + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Concat( + "~", + "A" + ), + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "private", + " ", + "readonly" + ), + " " + ), + Doc.Group( + "int", + " ", + "f1", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "NonExisting", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + Doc.Group( + Doc.Concat( + "Foo", + "::", + "NonExisting" + ), + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "var" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + "5" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + Doc.Group( + "CLSCompliant", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "false" + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "Obsolete", + ",", + Doc.Line, + Doc.Concat( + "System", + ".", + "NonSerialized" + ), + ",", + Doc.Line, + "NonSerialized", + ",", + Doc.Line, + Doc.Group( + "CLSCompliant", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "true", + Doc.Indent( + Doc.Line, + "||", + " ", + Doc.Group( + "false", + Doc.Indent( + Doc.Group( + Doc.Line, + "&", + " ", + "true" + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + Doc.HardLine + ), + Doc.Group( + Doc.Concat( + "private", + " ", + "volatile" + ), + " " + ), + Doc.Group( + "int", + " ", + "f2", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "return", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "method", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Handler", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "object", + " ", + "value" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "int", + " ", + "m", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "t" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Concat( + "class", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "new", + "(", + ")" + ) + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "base", + Doc.Concat( + ".", + "m" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "t" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "base" + ), + Doc.Concat( + Doc.Concat( + ".", + "m" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "t" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "1", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + "get", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "\"A\"", + ";" + ) + ), + Doc.Line + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "int", + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + "int", + " ", + "index" + ), + "]" + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Group( + Doc.Concat( + "protected", + " ", + "internal" + ), + " " + ), + "get", + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Group( + Doc.Concat( + "internal", + " ", + "protected" + ), + " " + ), + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "method", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "field", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "event", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Group( + Doc.Concat( + "public", + " ", + "readonly" + ), + " " + ), + Doc.Concat( + "event", + " " + ), + Doc.Group( + "Event", + " ", + "E", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Group( + "[", + "event", + Doc.Concat( + ":", + " " + ), + "Test", + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Group( + "public", + " " + ), + Doc.Concat( + "event", + " " + ), + "Action", + " ", + Doc.Null, + "E1", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Concat( + Doc.Group( + "[", + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Null, + "add", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "value", + " " + ), + "=", + Doc.GroupWithId( + "0650a409-1414-4c7a-bd0f-6eb0c2d27ca8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "value", + "0650a409-1414-4c7a-bd0f-6eb0c2d27ca8" + ) + ), + ";" + ) + ), + Doc.Line + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "return", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Null, + "remove", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "E", + " " + ), + "+=", + Doc.GroupWithId( + "e40622fa-6b9f-41a1-9eaa-8b4904b2e8a6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "Handler", + "e40622fa-6b9f-41a1-9eaa-8b4904b2e8a6" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "E", + " " + ), + "-=", + Doc.GroupWithId( + "dbe500e8-ea0d-4b42-9ffc-ac495c9220d0", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "Handler", + "dbe500e8-ea0d-4b42-9ffc-ac495c9220d0" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "A", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "A", + " ", + "first" + ), + ",", + Doc.Line, + Doc.Concat( + "A", + " ", + "second" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Delegate", + " ", + "handler", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "a3c036be-2f1d-4310-a319-32468e7deda1", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Delegate", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "Handler" + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "a3c036be-2f1d-4310-a319-32468e7deda1" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + "first", + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "second" + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "method", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ), + Doc.HardLine, + Doc.Group( + "[", + "return", + Doc.Concat( + ":", + " " + ), + "Obsolete", + Doc.Null, + "]" + ) + ), + Doc.HardLine + ), + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "bool", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "true", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + " ", + "a" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "true", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "bool", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "false", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + " ", + "a" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "false", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "C", + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "struct", + " " + ), + "S", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "I", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "S", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "private", + " " + ), + Doc.Group( + "int", + " ", + "f1", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + Doc.Group( + "Obsolete", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "\"Use Script instead\"" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "error", + Doc.Concat( + ":", + " " + ) + ), + "false" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Group( + Doc.Concat( + "private", + " ", + "volatile" + ), + " " + ), + Doc.Group( + "int", + " ", + "f2", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "abstract", + " " + ) + ) + ), + "int", + " ", + "m", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "t" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "struct", + Doc.Null + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "1", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + "get", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "value", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "\"A\"", + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "P", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "abstract" + ), + " " + ), + Doc.Null, + "int", + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + "int", + " ", + "index" + ), + "]" + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + Doc.Line, + Doc.Null, + Doc.Group( + Doc.Concat( + "internal", + " ", + "protected" + ), + " " + ), + "set", + ";" + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Concat( + "event", + " " + ), + Doc.Group( + "Event", + " ", + "E", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "A", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "A", + " ", + "first" + ), + ",", + Doc.Line, + Doc.Concat( + "A", + " ", + "second" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + "first", + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "second" + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " " + ), + Doc.Group( + "int", + " ", + "field", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "10" + ), + Doc.SoftLine, + "]" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "C", + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "interface", + " " + ), + "I", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "A", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "value" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Null, + "string", + " ", + Doc.Null, + "Value", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + " ", + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "unsafe", + " ", + Doc.Null + ), + "void", + " ", + "UpdateSignatureByHashingContent", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.GroupWithId( + "6ab06f66-3ecb-4f78-8c4e-d832cffaf931", + Doc.Group( + "[", + "In", + Doc.Null, + "]" + ), + Doc.IndentIfBreak( + Doc.Line, + "6ab06f66-3ecb-4f78-8c4e-d832cffaf931" + ), + Doc.Concat( + "byte", + "*" + ), + " ", + "buffer" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "size" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "[", + "type", + Doc.Concat( + ":", + " " + ), + "Flags", + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Group( + "public", + " " + ), + Doc.Concat( + "enum", + " " + ), + "E", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "A" + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "B", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "A" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "C", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Group( + "2", + Doc.Group( + Doc.Line, + "+", + " ", + "A" + ) + ) + ) + ) + ), + ",", + Doc.Null, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#if DEBUG"), + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "D" + ) + ), + "," + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#else"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.Trim, + " E, } - public struct S : I - { - public S() { } - private int f1; - [Obsolete("Use Script instead", error: false)] - private volatile int f2; - public abstract int m(T t) - where T : struct - { - return 1; - } - public string P - { - get - { - int value = 0; - return "A"; - } - set; - } - public abstract string P { get; } - - public abstract int this[int index] - { - get; - internal protected set; - } - public event Event E; - public static A operator +(A first, A second) - { - return first.Add(second); - } - fixed int field[10]; - class C { } - } - public interface I - { - void A(int value); - string Value { get; set; } - unsafe void UpdateSignatureByHashingContent([In]byte* buffer, int size); - } - [type: Flags] - public enum E - { - A, - B = A, - C = 2 + A, -#if DEBUG - D, - } -#else - E, - } -#endif - - - public delegate void Delegate(object P); - namespace Test - { - using System; - using System.Collections; - public class Список - { - public static IEnumerable Power(int number, int exponent) - { - Список Список = new Список(); - Список.Main(); - int counter = (0 + 0); - int אתר = 0; - while (++counter++ < --exponent--) - { - result = result * number + +number+++++number; - yield return result; - } - } - static void Main() - { - foreach (int i in Power(2, 8)) - { - Console.Write("{0} ", i); - } - } - async void Wait() - { - await System.Threading.Tasks.Task.Delay(0); - } - void AsyncAnonymous() // C # 5 feature - { - var task = Task.Factory.StartNew( - async () => - { - return await new WebClient().DownloadStringTaskAsync( - "http://example.com" - ); - } - ); - } - } - } -} - -namespace ConsoleApplication1 -{ - namespace RecursiveGenericBaseType - { - class A : B, A> - where T : A - { - protected virtual A M() { } - protected abstract B, A> N() { } - static B, A> O() { } - } - - sealed class B : A> - { - protected override A M() { } - protected sealed override B, A> N() { } - new static A O() { } - } - } - - namespace Boo - { - public class Bar - where T : IComparable - { - public T f; - public class Foo : IEnumerable - { - public void Method(K k, T t, U u) - where K : IList, IList, IList - where V : IList - { - A a; - M(A(5)); - } - } - } - } - - class Test - { - void Bar3() - { - var x = new Boo.Bar.Foo(); - x.Method(" ", 5, new object()); - - var q = from i in new int[] { 1, 2, 3, 4 } where i > 5 select i; - } - - public static implicit operator Test(string s) - { - return new ConsoleApplication1.Test(); - } - public static explicit operator Test(string s = "") - { - return new Test(); - } - - public int foo = 5; - void Bar2() - { - foo = 6; - this.Foo = 5.GetType(); - Test t = "sss"; - } - - public event EventHandler MyEvent = delegate { }; - - void Blah() - { - int i = 5; - int? j = 6; - - Expression> e = () => i; - Expression> e2 = b => () => - { - return; - }; - Func f = async delegate(bool a) - { - return await !a; - }; - Func f2 = (a, b) => 0; - f2 = (int a, int b) => 1; - Action a = Blah; - f2 = () => { }; - f2 = () => - { - ; - }; - } - - delegate Recursive Recursive(Recursive r); - delegate Recursive Recursive(Recursive r); - - public Type Foo - { - [Obsolete("Name", error = false)] - get - { - var result = typeof(IEnumerable); - var t = typeof(int?) == typeof(Nullable); - t = typeof(IEnumerable); - return typeof(IEnumerable<>); - } - set - { - var t = typeof(System.Int32); - t.ToString(); - t = value; - } - } - - public void Constants() - { - int i = 1 + 2 + 3 + 5; - global::System.String s = - "a" + (System.String)"a" + "a" + "a" + "a" + "A"; - } - - public void ConstructedType() - { - List i = null; - int c = i.Count; - } - } -} - -namespace Comments.XmlComments.UndocumentedKeywords -{ - /// +", + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#endif"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "public" + ), + " " + ), + Doc.Concat( + "delegate", + " " + ), + "void", + " ", + "Delegate", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "object", + " ", + "P" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "Test", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + "System", + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Null, + Doc.Concat( + "System", + ".", + "Collections" + ), + ";" + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "class", + " " + ), + "Список", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "IEnumerable", + " ", + "Power", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "number" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "exponent" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Список", + " ", + "Список", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "6cdf788b-c369-4a97-9e0e-29b290668320", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Список", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "6cdf788b-c369-4a97-9e0e-29b290668320" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "Список", + Doc.Concat( + ".", + "Main" + ), + Doc.Group( + "(", + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "counter", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b30f2848-0a3f-41a0-9cb2-04339874bf88", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "0", + Doc.Group( + Doc.Line, + "+", + " ", + "0" + ) + ) + ), + Doc.SoftLine, + ")" + ), + "b30f2848-0a3f-41a0-9cb2-04339874bf88" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "אתר", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "while", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Concat( + "++", + Doc.Concat( + "counter", + "++" + ) + ), + Doc.Group( + Doc.Line, + "<", + " ", + Doc.Concat( + "--", + Doc.Concat( + "exponent", + "--" + ) + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "result", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "result", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "number" + ) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "+", + Doc.Concat( + Doc.Concat( + "number", + "++" + ), + "++" + ) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "number" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "yield", + " " + ), + "return", + Doc.Concat( + " ", + "result" + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Null + ), + "void", + " ", + "Main", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Null, + Doc.Null, + "foreach", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "i" + ), + " ", + "in", + " ", + Doc.ConditionalGroup( + Doc.Concat( + "Power", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + ",", + Doc.Line, + "8" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Power", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + ",", + Doc.Line, + "8" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "Console", + Doc.Concat( + ".", + "Write" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "\"{0} \"", + ",", + Doc.Line, + "i" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + "void", + " ", + "Wait", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + "System", + Doc.Concat( + ".", + "Threading" + ), + Doc.Concat( + ".", + "Tasks" + ), + Doc.Concat( + ".", + "Task" + ), + Doc.Concat( + ".", + "Delay" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + ")" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "AsyncAnonymous", + "(", + Doc.Concat( + ")", + Doc.TrailingComment("// C # 5 feature", CommentType.SingleLine) + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "task", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "656a4860-c367-4497-bc45-1d3fc1c80fc4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "Task", + Doc.Concat( + ".", + "Factory" + ), + Doc.Concat( + ".", + "StartNew" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Null, + Doc.Group( + "async", + " " + ), + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "WebClient", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + Doc.Concat( + ".", + "DownloadStringTaskAsync" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"http://example.com\"" + ), + Doc.SoftLine, + ")" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + ")" + ) + ), + "656a4860-c367-4497-bc45-1d3fc1c80fc4" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "ConsoleApplication1", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "RecursiveGenericBaseType", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "A", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null + ) + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ) + ) + ), + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "virtual", + " " + ) + ) + ), + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "abstract", + " " + ) + ) + ), + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "N", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Null + ), + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "O", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "sealed", + " " + ), + Doc.Concat( + "class", + " " + ), + "B", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T1" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T2" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T1", + ",", + Doc.Line, + "T2" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "override", + " " + ) + ) + ), + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "protected", + " ", + Doc.Concat( + Doc.Concat( + "sealed", + " " + ), + Doc.Concat( + "override", + " " + ) + ) + ), + Doc.Group( + "B", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "N", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "new", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "O", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "Boo", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "class", + " " + ), + "Bar", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "IComparable" + ) + ) + ) + ), + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + "T", + " ", + "f", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "public", + " " + ), + Doc.Concat( + "class", + " " + ), + "Foo", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "U" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Method", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "K" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "V" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "K", + " ", + "k" + ), + ",", + Doc.Line, + Doc.Concat( + "T", + " ", + "t" + ), + ",", + Doc.Line, + Doc.Concat( + "U", + " ", + "u" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + "where", + " " + ), + "K", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "V" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + ",", + Doc.Line, + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "U" + ), + Doc.Null, + ">" + ) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "V", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + Doc.Group( + "IList", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "K" + ), + Doc.Null, + ">" + ) + ) + ) + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "M", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "M", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "Test", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Bar3", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "x", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "125ec54f-27f1-4760-822b-b601d3028f84", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + Doc.Concat( + "Boo", + ".", + Doc.Group( + "Bar", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + ".", + Doc.Group( + "Foo", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "object" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "125ec54f-27f1-4760-822b-b601d3028f84" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "x", + Doc.Concat( + ".", + Doc.Group( + "Method", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "\" \"", + ",", + Doc.Line, + "5", + ",", + Doc.Line, + Doc.Group( + Doc.Concat( + "new", + " " + ), + "object", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "x" + ), + Doc.Concat( + Doc.Concat( + ".", + Doc.Group( + "Method", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "\" \"", + ",", + Doc.Line, + "5", + ",", + Doc.Line, + Doc.Group( + Doc.Concat( + "new", + " " + ), + "object", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "q", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "from", + " " + ), + Doc.Null, + Doc.Concat( + "i", + " " + ), + Doc.Concat( + "in", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3", + ",", + Doc.Line, + "4" + ) + ), + Doc.Line, + "}" + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "where", + Doc.Indent( + Doc.Line, + Doc.Group( + "i", + Doc.Group( + Doc.Line, + ">", + " ", + "5" + ) + ) + ) + ) + ), + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Concat( + "select", + " " + ), + "i" + ) + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Concat( + "implicit", + " " + ), + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "Test", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + " ", + "s" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + "ConsoleApplication1", + ".", + "Test" + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Concat( + "explicit", + " " + ), + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "Test", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + " ", + "s", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"\"" + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Test", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "foo", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Bar2", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "foo", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "6" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Group( + "this", + Doc.Concat( + ".", + "Foo" + ) + ), + " " + ), + "=", + Doc.GroupWithId( + "ace7e8be-f46d-4a7d-a555-afae3cb65183", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "5", + Doc.Concat( + ".", + "GetType" + ), + Doc.Group( + "(", + ")" + ) + ), + "ace7e8be-f46d-4a7d-a555-afae3cb65183" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Test", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"sss\"" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Concat( + "event", + " " + ), + Doc.Group( + Doc.Group( + Doc.Concat( + "EventHandler", + " ", + "MyEvent", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "45f96df5-f407-48b0-b200-5c6c4377eac1", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + "delegate", + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ), + "45f96df5-f407-48b0-b200-5c6c4377eac1" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Blah", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "j", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "6" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Expression", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "e", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "599b2215-4a52-4528-8a6c-1b0e507b0b3a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "i" + ) + ) + ), + "599b2215-4a52-4528-8a6c-1b0e507b0b3a" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Expression", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "bool", + ",", + Doc.Line, + "Action" + ) + ), + Doc.SoftLine, + ">" + ) + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "e2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c89e4187-bf4d-480e-a416-d6f8b4bf47f6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Null, + "b", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + Doc.Null + ), + Doc.Null, + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + "c89e4187-bf4d-480e-a416-d6f8b4bf47f6" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "bool", + ",", + Doc.Line, + "bool" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "f", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "77337785-9498-4872-a405-5f0425f07e3b", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Group( + "async", + " " + ), + "delegate", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "bool", + " ", + "a" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Concat( + "!", + "a" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + "77337785-9498-4872-a405-5f0425f07e3b" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "int", + ",", + Doc.Line, + "int" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "f2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "14361d42-e482-4f33-99bb-070ed2290c20", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "a", + ",", + Doc.Line, + "b" + ) + ), + Doc.SoftLine + ), + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + "14361d42-e482-4f33-99bb-070ed2290c20" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "f2", + " " + ), + "=", + Doc.GroupWithId( + "8d91fa71-ccf9-425a-a599-00c36ca625b8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "b" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "1" + ) + ) + ), + "8d91fa71-ccf9-425a-a599-00c36ca625b8" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Action", + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c6027a85-5632-423f-99c2-093865370aa6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "Blah", + "c6027a85-5632-423f-99c2-093865370aa6" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "f2", + " " + ), + "=", + Doc.GroupWithId( + "fd2b77ef-f9e6-43ed-b09b-200ec8214a53", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + " ", + Doc.Group( + Doc.Null, + "{", + " ", + "}" + ) + ), + "fd2b77ef-f9e6-43ed-b09b-200ec8214a53" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "f2", + " " + ), + "=", + Doc.GroupWithId( + "e4511533-1530-4157-a5f7-6d99d45061db", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Null, + ")" + ), + " ", + "=>", + Doc.HardLine, + Doc.Group( + Doc.Null, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + ";" + ), + Doc.HardLine + ), + "}" + ) + ), + "e4511533-1530-4157-a5f7-6d99d45061db" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "delegate", + " " + ), + "Recursive", + " ", + "Recursive", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "Recursive", + " ", + "r" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "delegate", + " " + ), + "Recursive", + " ", + "Recursive", + Doc.Group( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "A" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "R" + ) + ) + ), + Doc.SoftLine, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "Recursive", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "A", + ",", + Doc.Line, + "R" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "r" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "Type", + " ", + Doc.Null, + "Foo", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Concat( + Doc.HardLine, + Doc.Concat( + Doc.Group( + "[", + Doc.Group( + "Obsolete", + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + "\"Name\"" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "error", + " ", + Doc.Concat( + "=", + " " + ) + ), + Doc.Null, + "false" + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null, + "]" + ), + Doc.HardLine + ), + Doc.Null, + "get", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "result", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b04af53f-984e-4856-861f-e6d33f900992", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "typeof", + "(", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + ")" + ), + "b04af53f-984e-4856-861f-e6d33f900992" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "typeof", + "(", + Doc.Concat( + "int", + "?" + ), + ")" + ), + Doc.Group( + Doc.Line, + "==", + " ", + Doc.Concat( + "typeof", + "(", + Doc.Group( + "Nullable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + ")" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "t", + " " + ), + "=", + Doc.GroupWithId( + "db7f7705-2f97-464a-a5d6-3da74a8b5117", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "typeof", + "(", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ) + ), + Doc.Null, + ">" + ) + ), + ")" + ), + "db7f7705-2f97-464a-a5d6-3da74a8b5117" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + "typeof", + "(", + Doc.Group( + "IEnumerable", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + Doc.Null + ), + Doc.Null, + ">" + ) + ), + ")" + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + "set", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "4f1eaaaf-edb1-48e2-a601-e44443abda16", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "typeof", + "(", + Doc.Concat( + "System", + ".", + "Int32" + ), + ")" + ), + "4f1eaaaf-edb1-48e2-a601-e44443abda16" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "t", + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "t" + ), + Doc.Concat( + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "t", + " " + ), + "=", + Doc.GroupWithId( + "26cb65b5-3f8e-45c0-b48f-39dcb4924182", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "value", + "26cb65b5-3f8e-45c0-b48f-39dcb4924182" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.Line, + "}" + ), + Doc.Null, + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Constants", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "1", + Doc.Concat( + Doc.Line, + "+", + " ", + "2" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "3" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "5" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "global", + "::", + "System" + ), + ".", + "String" + ), + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "\"a\"", + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Group( + "(", + Doc.Concat( + "System", + ".", + "String" + ), + ")", + Doc.Indent( + Doc.SoftLine, + "\"a\"" + ) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"a\"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"a\"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"a\"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\"A\"" + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ConstructedType", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "List", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "c", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "12ea48eb-aa9a-498d-a7c8-5c1f3e4ff390", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "i", + Doc.Concat( + ".", + "Count" + ) + ), + "12ea48eb-aa9a-498d-a7c8-5c1f3e4ff390" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + Doc.Concat( + Doc.Concat( + "Comments", + ".", + "XmlComments" + ), + ".", + "UndocumentedKeywords" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("/// /// Whatever /// /// @@ -632,523 +12139,11834 @@ namespace Comments.XmlComments.UndocumentedKeywords /// /// /// - /// - class /*///*/C - { - void M(T t, U u) - { - // comment - /* *** / */ - /* // - */ - /*s*///comment - // /***/ - /*s*/int /*s*/intValue = 0; - intValue = intValue /*s*/+ 1; - string strValue = /*s*/"hello"; - /*s*/MyClass c = new MyClass(); - string verbatimStr = /*s*/@"\\\\"; - } - } - - //General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324) - class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/*Scen8*/{ } - - class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22/*Scen9*/{ } - - class yield - { - void Foo(__arglist) - { - C c = null; - c.M(5, default(U)); - TypedReference tr = __makeref(c); - Type t = __reftype(tr); - int j = __refvalue(tr, int); - Params(a: t, b: t); - Params(ref c, out c); - } - void Params(ref dynamic a, out dynamic b, params dynamic[] c) { } - void Params( - out dynamic a = 2, - ref dynamic c = default(dynamic), - params dynamic[][] c) { } - - public override string ToString() - { - return base.ToString(); - } - - public partial void OnError(); - - public partial void method() - { - int?[] a = new int?[5]; /*[] bug*/ // YES [] - int[] var = { 1, 2, 3, 4, 5 }; /*,;*/ - int i = a[i]; /*[]*/ - Foo f = new Foo(); /*<> ()*/ - f.method(); /*().*/ - i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ - bool b = true & false | true ^ false; /*& | ^*/ - b = !b; /*!*/ - i = ~i; /*~i*/ - b = i < i && i > i; /*< && >*/ - int? ii = 5; /*? bug*/ // NO ? - int f = true ? 1 : 0; /*? :*/ // YES : - i++; /*++*/ - i--; /*--*/ - b = true && false || true; /*&& ||*/ - i << 5; /*<<*/ - i >> 5; /*>>*/ - b = i == i && i != i && i <= i && i >= i; /*= == && != <= >=*/ - i += 5.0; /*+=*/ - i -= i; /*-=*/ - i *= i; /* *=*/ - i /= i; /*/=*/ - i %= i; /*%=*/ - i &= i; /*&=*/ - i |= i; /*|=*/ - i ^= i; /*^=*/ - i <<= i; /*<<=*/ - i >>= i; /*>>=*/ - object s = x => x + 1; /*=>*/ - double d = .3; - Point point; - unsafe - { - Point* p = &point; /* * &*/ - p->x = 10; /*->*/ - } - IO::BinaryReader br = null; - x[i: 1] = 3; - x[i: 1, j: 5] = "str"; - } - - struct Point - { - public int X; - public int Y; - public void ThisAccess() - { - this = this; - } - } - } - - // From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6 - class CSharp6Features - { - // Initializers for auto-properties - public string First { get; set; } = "Jane"; - public string Last { get; set; } = "Doe"; - - // Getter-only auto-properties - public string Third { get; } = "Jane"; - public string Fourth { get; } = "Doe"; - - // Expression bodies on method-like members - public Point Move(int dx, int dy) => new Point(x + dx, y + dy); - public static Complex operator +(Complex a, Complex b) => a.Add(b); - public static implicit operator string(Person p) => - p.First + " " + p.Last; - public void Print() => Console.WriteLine(First + " " + Last); - - // Expression bodies on property-like function members - public string Name => First + " " + Last; - public int this[long id] => id; - - async void Test() - { - // Using static - WriteLine(Sqrt(3 * 3 + 4 * 4)); - WriteLine(Friday - Monday); - var range = Range(5, 17); // Ok: not extension - var even = range.Where(i => i % 2 == 0); // Ok - - // Null-conditional operators - int? length = customers?.Length; // null if customers is null - Customer first = customers?[0]; // null if customers is null - int length = customers?.Length ?? 0; // 0 if customers is null - int? first = customers?[0]?.Orders?.Count(); - PropertyChanged?.Invoke(this, args); - - // String interpolation - string s = $"{p.Name, 20} is {p.Age:D3} year{{s}} old #"; - s = $"{p.Name} is \"{p.Age} year{(p.Age == 1 ? "" : "s")} old"; - s = $"{(p.Age == 2 ? $"{new Person { }}" : "")}"; - s = $@"\{p.Name} - ""\"; - s = $"Color [ R={func(b: 3):#0.##}, G={G:#0.##}, B={B:#0.##}, A={A:#0.##} ]"; - - // nameof expressions - if (x == null) - { - throw new ArgumentNullException(nameof(x)); - } - - WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode" - - // Index initializers - var numbers = new Dictionary - { - [7] = "seven", - [9] = "nine", - [13] = "thirteen" - }; - - // Exception filters - try { } - catch (MyException e) when (myfilter(e)) { } - - // Await in catch and finally blocks - Resource res = null; - try - { - res = await Resource.OpenAsync(); // You could do this. - } - catch (ResourceException e) - { - await Resource.LogAsync(res, e); // Now you can do this … - } - finally - { - if (res != null) - { - await res.CloseAsync(); // … and this. - } - } - } - } -} -#line 6 -#line 2 "test.cs" -#line default -#line hidden - -class CSharp70 -{ - void PatternMatching(string arg, int b) - { - switch (arg) - { - case "A" when b > 50: - case "B" when b < 50: - default: - break; - } - - (A D, E H) = e; - - if (x?.y?.z is Type value2) - { - // code using value - } - - if (expr is Type v) - { - Hello(); - } - } - - public static async Task LocalFunctions(string[] args) - { - string Hello2(int i) - { - return args[i]; - } - - async Task Hello(T i) => await Task.FromResult(args[i]); - await Hello(1); - } - - public static void OutVar(string[] args) - { - int.TryParse(Hello(1), out var item); - int.TryParse(Hello(1), out int item); - } - - public void ThrowExpression() - { - var result = nullableResult ?? throw new NullReferenceException(); - } - - public void BinaryLiterals() - { - int nineteen = 0b10011; - } - - public void DigitSeparators() - { - int bin = 0b1001_1010_0001_0100; - int hex = 0x1b_a0_44_fe; - int dec = 33_554_432; - int weird = 1_2__3___4____5_____6______7_______8________9; - double real = 1_000.111_1e-1_000; - } -} - -class CSharp71 -{ - void DefaultWithoutTypeName(string content = default) - { - DefaultWithoutTypeName(default); - } - - void TupleRecognize(int a, (int, int) b, (int, int, int)? c) - { - var result = list.Select(c => (c.f1, f3: c.f2)).Where(t => t.f2 == 1); - } -} - -class CSharp72 -{ - readonly struct ReadonlyRef1 - { - Func s = (in int x) => x; - ref TValue this[in TKey index] => null; - public static Vector3 operator +(in Vector3 x, in Vector3 y) => null; - - static readonly ref Vector3 M1_Trace() - { - // OK - ref readonly var r1 = ref M1(); - - // Not valid. Need an LValue - ref readonly Vector3 r2 = ref default(Vector3); - - // Not valid. r1 is readonly. - Mutate(ref r1); - - // OK. - Print(in r1); - - // OK. - return ref r1; - } - } - - ref struct ReadonlyRef2 - { - ref readonly Guid Test(in Vector3 v1, in Vector3 v2) - { - // not OK!! - v1 = default(Vector3); - - // not OK!! - v1.X = 0; - - // not OK!! - foo(ref v1.X); - - return ref (arr != null ? ref arr[0] : ref otherArr[0]); - - Span span = stackalloc int[1]; - - // OK - return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); - } - - ref T Choice(bool condition, ref T consequence, ref T alternative) - { - if (condition) - { - return ref consequence; - } - else - { - return ref alternative; - } - } - } - - public void DoSomething(bool isEmployed, string personName, int personAge) - { } - - public void NonTrailingNamedArguments() - { - DoSomething(isEmployed: true, name, age); // currently CS1738, but would become legal - DoSomething(true, personName: name, age); // currently CS1738, but would become legal - DoSomething(name, isEmployed: true, age); // remains illegal - DoSomething(name, age, isEmployed: true); // remains illegal - DoSomething(true, personAge: age, personName: name); // already legal - } - - public void ConditionalRef() - { - ref var r = ref (arr != null ? ref arr[0] : ref otherArr[0]); - } - - public void LeadingSeparator() - { - var res = 0 - + 123 // permitted in C# 1.0 and later - + 1_2_3 // permitted in C# 7.0 and later - + 0x1_2_3 // permitted in C# 7.0 and later - + 0b101 // binary literals added in C# 7.0 - + 0b1_0_1 // permitted in C# 7.0 and later - - // in C# 7.2, _ is permitted after the `0x` or `0b` - + 0x_1_2 // permitted in C# 7.2 and later - + 0b_1_0_1 // permitted in C# 7.2 and later - ; - } -} - -class CSharp73 -{ - void Blittable(T value) - where T : unmanaged - { - var unmanaged = 666; - } - - unsafe struct IndexingMovableFixed - { - public fixed int myFixedField[10]; - } - - static IndexingMovableFixed s; - - public unsafe void IndexingMovableFixedFields() - { - int* ptr = s.myFixedField; - int t = s.myFixedField[5]; - } - - public void PatternBasedFixed() - { - fixed (byte* ptr = byteArray) - { - // ptr is a native pointer to the first element of the array - // byteArray is protected from being moved/collected by the GC for the duration of this block - } - } - - public void StackallocArrayInitializer() - { - Span a = stackalloc int[3]; // currently allowed - Span a = stackalloc int[3] { 1, 2, 3 }; - Span a = stackalloc int[] { 1, 2, 3 }; - Span a = stackalloc[] { 1, 2, 3 }; - } - - public void TupleEquality() - { - (int, (int, int)) t1, t2; - var res = t1 == (1, (2, 3)); - } -} - -namespace CSharp80 -{ - class CSharp80ExceptInterfaceDefaultImplement - { - void ReferenceNullable() - { - var? x = E; - x!.ToString(); - string? wtf = null; - int?[]? hello; - } - - void Patterns() - { - if (o is string { Length: 5 } s) - { - Do(); - } - - return lang.CountOfTokens switch - { - 1 => 100, - 2 => 200, - _ => throw new global::System.Exception() - }; - - var newState = (GetState(), action, hasKey) switch - { - (DoorState.Closed, Action.Open, _) => DoorState.Opened, - (DoorState.Opened, Action.Close, _) => DoorState.Closed, - (DoorState.Closed, Action.Lock, true) => DoorState.Locked, - (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, - (var state, _, _) => state - }; - } - - async Task AsyncStreams() - { - await foreach (var item in asyncEnumerables) { } - } - - void Ranges() - { - var thirdItem = list[2]; // list[2] - var lastItem = list[^1]; // list[Index.CreateFromEnd(1)] - var multiDimensional = list[3, ^2]; // list[3, Index.CreateFromEnd(2)] - - var slice1 = list[2..^3]; // list[Range.Create(2, Index.CreateFromEnd(3))] - var slice2 = list[..^3]; // list[Range.ToEnd(Index.CreateFromEnd(3))] - var slice3 = list[2..]; // list[Range.FromStart(2)] - var slice4 = list[..]; // list[Range.All] - var multiDimensional = list[1..2, ..]; // list[Range.Create(1, 2), Range.All] - } - - void UsingDeclarators() - { - using var item = new FileStream("./.f"); - fixed (char* ch = "hell"); - item.Dispose(); - } - - void StaticLocalFunction() - { - static unsafe void Func1() { } - static unsafe void Func1() { } - async static void Func2() { } - static async void Func2() { } - } - - void NullCoalescingAssignment() - { - var item = a ??= b ??= c ??= d ??= throw new Exception(); - } - - public readonly float Hello() - { - return 0.1f; - } - } - - interface IA - { - void M() - { - WriteLine("IA.M"); - } - } - - interface IA - { - void M() - { - WriteLine("IA.M"); - } - } - - interface IB : IA - { - override void IA.M() // explicitly named - { - WriteLine("IB.M"); - } - } - - interface IC : IA - { - override void M() // implicitly named - { - WriteLine("IC.M"); - } - } -} - + /// ", CommentType.SingleLine), + Doc.HardLineSkipBreakIfFirstInGroup + ), + "class", + Doc.Concat( + " ", + Doc.TrailingComment("/*///*/", CommentType.MultiLine) + ), + " " + ), + "C", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "M", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "U" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "T", + " ", + "t" + ), + ",", + Doc.Line, + Doc.Concat( + "U", + " ", + "u" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// comment", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /* *** / */", CommentType.MultiLine), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /* // + */", CommentType.MultiLine), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /*s*/", CommentType.MultiLine), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment("//comment", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment("// /***/", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment(" /*s*/", CommentType.MultiLine) + ), + "int", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + " ", + "intValue", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "intValue", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "intValue", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + Doc.Group( + Doc.Line, + "+", + " ", + "1" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "strValue", + Doc.Null + ), + " " + ), + Doc.Concat( + "=", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + Doc.Group( + Doc.Indent( + Doc.Line, + "\"hello\"" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment(" /*s*/", CommentType.MultiLine), + "MyClass" + ), + " ", + "c", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "3d5bedd1-37ba-41a5-8f0d-95f27453b65e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "MyClass", + Doc.Group( + "(", + ")" + ), + Doc.Null + ), + "3d5bedd1-37ba-41a5-8f0d-95f27453b65e" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "string", + " ", + "verbatimStr", + Doc.Null + ), + " " + ), + Doc.Concat( + "=", + Doc.Concat( + " ", + Doc.TrailingComment("/*s*/", CommentType.MultiLine) + ) + ), + Doc.Group( + Doc.Indent( + Doc.Line, + "@\"\\\\\"" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("//General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324)", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "class", + " " + ), + Doc.Concat( + "TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + Doc.Concat( + " ", + Doc.TrailingComment("/*Scen8*/", CommentType.MultiLine) + ) + ), + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + Doc.Concat( + "TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22", + Doc.Concat( + " ", + Doc.TrailingComment("/*Scen9*/", CommentType.MultiLine) + ) + ), + Doc.Null, + " ", + "{", + " ", + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "yield", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Foo", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "U" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "__arglist" + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "C", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "U" + ), + Doc.Null, + ">" + ) + ), + " ", + "c", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "c", + Doc.Concat( + ".", + Doc.Group( + "M", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + Doc.Concat( + "default", + "(", + "U", + ")" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "c" + ), + Doc.Concat( + Doc.Concat( + ".", + Doc.Group( + "M", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ) + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + Doc.Concat( + "default", + "(", + "U", + ")" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "TypedReference", + " ", + "tr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "3c001921-b9b0-4267-a8ab-d0a5ca503f4f", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "__makeref", + "(", + "c", + ")" + ), + "3c001921-b9b0-4267-a8ab-d0a5ca503f4f" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Type", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f74531d1-069a-42f9-ba21-0750e93d52ce", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "__reftype", + "(", + "tr", + ")" + ), + "f74531d1-069a-42f9-ba21-0750e93d52ce" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "j", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "c4494fef-5b2f-4d8d-8ccd-1cd23190a794", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "__refvalue", + "(", + "tr", + Doc.Concat( + ",", + " " + ), + "int", + ")" + ), + "c4494fef-5b2f-4d8d-8ccd-1cd23190a794" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "a", + Doc.Concat( + ":", + " " + ) + ), + "t" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "t" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "a", + Doc.Concat( + ":", + " " + ) + ), + "t" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "t" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "c" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + "c" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Params", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "c" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + "c" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Params", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "dynamic", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "out", + " " + ), + "dynamic", + " ", + "b" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "params", + " " + ), + Doc.Concat( + "dynamic", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "c" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Params", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "out", + " " + ), + "dynamic", + " ", + "a", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "2" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "dynamic", + " ", + "c", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + Doc.Concat( + "default", + "(", + "dynamic", + ")" + ) + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "params", + " " + ), + Doc.Concat( + "dynamic", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ), + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "c" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "override", + " " + ) + ) + ), + "string", + " ", + "ToString", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "base", + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "base" + ), + Doc.Concat( + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "partial", + " " + ) + ) + ), + "void", + " ", + "OnError", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "partial", + " " + ) + ) + ), + "void", + " ", + "method", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "97d69e8d-6261-4b08-887e-0e114d6218f8", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + Doc.Null + ), + "97d69e8d-6261-4b08-887e-0e114d6218f8" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*[] bug*/", CommentType.MultiLine), + Doc.TrailingComment("// YES []", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "var", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3", + ",", + Doc.Line, + "4", + ",", + Doc.Line, + "5" + ) + ), + Doc.Line, + "}" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*,;*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "i", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "35724e53-144e-4828-b165-68b49733abd4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "a", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ), + "35724e53-144e-4828-b165-68b49733abd4" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*[]*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Foo", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "T" + ), + Doc.Null, + ">" + ) + ), + " ", + "f", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Group( + "Foo", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*<> ()*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "f", + Doc.Concat( + ".", + "method" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "f" + ), + Doc.Concat( + Doc.Concat( + ".", + "method" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*().*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Concat( + Doc.Line, + "+", + " ", + "i" + ), + Doc.Concat( + Doc.Line, + "-", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Concat( + Doc.Line, + "*", + " ", + "i" + ), + Doc.Concat( + Doc.Line, + "/", + " ", + "i" + ), + Doc.Concat( + Doc.Line, + "%", + " ", + "i" + ) + ) + ) + ) + ) + ), + Doc.Indent( + Doc.Line, + "&", + " ", + "i" + ) + ), + Doc.Concat( + Doc.Line, + "|", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "^", + " ", + "i" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*+ - * / % & | ^*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "bool", + " ", + "b", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "true", + Doc.Indent( + Doc.Group( + Doc.Line, + "&", + " ", + "false" + ) + ) + ), + Doc.Concat( + Doc.Line, + "|", + " ", + Doc.Group( + "true", + Doc.Indent( + Doc.Group( + Doc.Line, + "^", + " ", + "false" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*& | ^*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.GroupWithId( + "cdc0a259-eb4f-4d9d-90e2-1d7d85cb385a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "!", + "b" + ), + "cdc0a259-eb4f-4d9d-90e2-1d7d85cb385a" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*!*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "=", + Doc.GroupWithId( + "9422ddba-c3df-4bd2-be86-b9411856bd6d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "~", + "i" + ), + "9422ddba-c3df-4bd2-be86-b9411856bd6d" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*~i*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "i" + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + ">", + " ", + "i" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*< && >*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "ii", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*? bug*/", CommentType.MultiLine), + Doc.TrailingComment("// NO ?", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "f", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "70f45016-1c23-4b08-ace9-c4a99e877a0e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Null, + "true", + Doc.Indent( + Doc.Line, + Doc.Concat( + "?", + " " + ), + "1", + Doc.Line, + Doc.Concat( + ":", + " " + ), + "0" + ) + ), + "70f45016-1c23-4b08-ace9-c4a99e877a0e" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*? :*/", CommentType.MultiLine), + Doc.TrailingComment("// YES :", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "i", + "++" + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*++*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "i", + "--" + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*--*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "true", + Doc.Indent( + Doc.Group( + Doc.Line, + "&&", + " ", + "false" + ) + ) + ), + Doc.Concat( + Doc.Line, + "||", + " ", + "true" + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*&& ||*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<<", + " ", + "5" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*<<*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + ">>", + " ", + "5" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*>>*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "b", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "==", + " ", + "i" + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "!=", + " ", + "i" + ) + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "<=", + " ", + "i" + ) + ) + ) + ), + Doc.Concat( + Doc.Line, + "&&", + " ", + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + ">=", + " ", + "i" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*= == && != <= >=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "+=", + Doc.Group( + Doc.Indent( + Doc.Line, + "5.0" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*+=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "-=", + Doc.GroupWithId( + "34c61dad-f8d1-4a72-896e-caae5c4fb76d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "34c61dad-f8d1-4a72-896e-caae5c4fb76d" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*-=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "*=", + Doc.GroupWithId( + "cdb632b9-e4d0-4191-a3c8-056ac9ec6750", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "cdb632b9-e4d0-4191-a3c8-056ac9ec6750" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/* *=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "/=", + Doc.GroupWithId( + "ba200a86-ed20-4867-a181-6ca12b7f6412", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "ba200a86-ed20-4867-a181-6ca12b7f6412" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*/=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "%=", + Doc.GroupWithId( + "c70d5cff-d5cd-45d2-8d15-2ad024411481", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "c70d5cff-d5cd-45d2-8d15-2ad024411481" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*%=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "&=", + Doc.GroupWithId( + "5b36cea2-bc51-4db6-a76c-d9a449dabef3", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "5b36cea2-bc51-4db6-a76c-d9a449dabef3" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*&=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "|=", + Doc.GroupWithId( + "cc437271-0d7d-4f1c-8261-8d24107b8bc9", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "cc437271-0d7d-4f1c-8261-8d24107b8bc9" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*|=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "^=", + Doc.GroupWithId( + "c20476bd-7370-4944-a643-366ccf947ff5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "c20476bd-7370-4944-a643-366ccf947ff5" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*^=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + "<<=", + Doc.GroupWithId( + "5452f0d3-4fd8-408a-9e52-6fc1816342b7", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "5452f0d3-4fd8-408a-9e52-6fc1816342b7" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*<<=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "i", + " " + ), + ">>=", + Doc.GroupWithId( + "38758ecb-3312-432a-b880-512ffb6e4044", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "i", + "38758ecb-3312-432a-b880-512ffb6e4044" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*>>=*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "object", + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "29f6795a-a7a9-479d-8bd9-3107a9d2e289", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Null, + "x", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + "x", + Doc.Group( + Doc.Line, + "+", + " ", + "1" + ) + ) + ) + ), + "29f6795a-a7a9-479d-8bd9-3107a9d2e289" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*=>*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "double", + " ", + "d", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + ".3" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "Point", + " ", + "point", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + "unsafe", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "Point", + "*" + ), + " ", + "p", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "6f4d2cc7-f94a-4ec6-b35b-fc043446df99", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "&", + "point" + ), + "6f4d2cc7-f94a-4ec6-b35b-fc043446df99" + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/* * &*/", CommentType.MultiLine) + ) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + "->", + "x" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "10" + ) + ) + ), + Doc.Concat( + ";", + Doc.Concat( + " ", + Doc.TrailingComment("/*->*/", CommentType.MultiLine) + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "IO", + "::", + "BinaryReader" + ), + " ", + "br", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "x", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "i", + Doc.Concat( + ":", + " " + ) + ), + "1" + ) + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "3" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "x", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "i", + Doc.Concat( + ":", + " " + ) + ), + "1" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "j", + Doc.Concat( + ":", + " " + ) + ), + "5" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"str\"" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "struct", + " " + ), + "Point", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + "int", + " ", + "X", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Group( + "int", + " ", + "Y", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ThisAccess", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "this", + " " + ), + "=", + Doc.GroupWithId( + "f87e41ec-7f62-4481-9d95-6e9dd7f6fd11", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "this", + "f87e41ec-7f62-4481-9d95-6e9dd7f6fd11" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "class", + " " + ), + "CSharp6Features", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Initializers for auto-properties", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "public" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "First", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Jane\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Last", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ), + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "set", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Doe\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Getter-only auto-properties", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "public" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Third", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Jane\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Fourth", + Doc.Group( + " ", + "{", + Doc.Indent( + Doc.Concat( + " ", + Doc.Null, + Doc.Null, + "get", + ";" + ) + ), + " ", + "}" + ), + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "\"Doe\"" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.LeadingComment("// Expression bodies on method-like members", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "Point", + " ", + "Move", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "dx" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "dy" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Point", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "x", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "dx" + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + "y", + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + "dy" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "Complex", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "Complex", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + "Complex", + " ", + "b" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.ConditionalGroup( + Doc.Concat( + "a", + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "b" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "a" + ), + Doc.Concat( + Doc.Concat( + ".", + "Add" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "b" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + Doc.Concat( + "implicit", + " " + ), + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "string", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "Person", + " ", + "p" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + ".", + "First" + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "\" \"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Group( + "p", + Doc.Concat( + ".", + "Last" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "Print", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + "Console", + Doc.Concat( + ".", + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "First", + Doc.Indent( + Doc.Concat( + Doc.Line, + "+", + " ", + "\" \"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "Last" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Expression bodies on property-like function members", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "public" + ), + " " + ), + Doc.Null, + "string", + " ", + Doc.Null, + "Name", + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Group( + "First", + Doc.Concat( + Doc.Line, + "+", + " ", + "\" \"" + ), + Doc.Concat( + Doc.Line, + "+", + " ", + "Last" + ) + ) + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "public", + " " + ), + Doc.Null, + "int", + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + "long", + " ", + "id" + ), + "]" + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + "id" + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + "void", + " ", + "Test", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Using static", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Using static", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "WriteLine" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Sqrt", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "3", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "3" + ) + ) + ), + Doc.Indent( + Doc.Line, + "+", + " ", + Doc.Group( + "4", + Doc.Indent( + Doc.Group( + Doc.Line, + "*", + " ", + "4" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Friday", + Doc.Indent( + Doc.Group( + Doc.Line, + "-", + " ", + "Monday" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "Friday", + Doc.Indent( + Doc.Group( + Doc.Line, + "-", + " ", + "Monday" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "range", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8ad9c0a0-e9d0-4a76-8520-0d4930b8c919", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.ConditionalGroup( + Doc.Concat( + "Range", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + "17" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Range", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "5", + ",", + Doc.Line, + "17" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + "8ad9c0a0-e9d0-4a76-8520-0d4930b8c919" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// Ok: not extension", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "even", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "ffc8f92b-9e95-4a9e-8d86-fe2d14e5134a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "range", + Doc.Concat( + ".", + "Where" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "i", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "i", + Doc.Indent( + Doc.Group( + Doc.Line, + "%", + " ", + "2" + ) + ) + ), + Doc.Concat( + Doc.Line, + "==", + " ", + "0" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + "ffc8f92b-9e95-4a9e-8d86-fe2d14e5134a" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// Ok", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Null-conditional operators", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "int" + ), + "?" + ), + " ", + "length", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "b54d42f4-5e4b-48af-80d7-fcc073aee865", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "customers", + "?", + Doc.Concat( + ".", + "Length" + ) + ), + "b54d42f4-5e4b-48af-80d7-fcc073aee865" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// null if customers is null", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "Customer", + " ", + "first", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "cd477baa-8b19-4d15-8b85-374cd356c41b", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "customers", + "?", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ), + "cd477baa-8b19-4d15-8b85-374cd356c41b" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// null if customers is null", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "length", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "customers", + "?", + Doc.Concat( + ".", + "Length" + ) + ), + Doc.Group( + Doc.Line, + "??", + " ", + "0" + ) + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// 0 if customers is null", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + " ", + "first", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "9f64f8e9-9208-4dd7-a99e-9f58bc6fedd3", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "customers", + "?", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ), + "?", + Doc.Concat( + ".", + "Orders" + ), + "?", + Doc.Concat( + ".", + "Count" + ), + Doc.Group( + "(", + ")" + ) + ), + "9f64f8e9-9208-4dd7-a99e-9f58bc6fedd3" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "PropertyChanged", + "?", + Doc.Concat( + ".", + "Invoke" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "this", + ",", + Doc.Line, + "args" + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// String interpolation", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "string" + ), + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Name" + ) + ), + Doc.Concat( + ",", + " " + ), + "20", + "}" + ), + " is ", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + ":", + "D3", + "}" + ), + " year{{s}} old #", + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Name" + ) + ), + "}" + ), + " is \\"", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + "}" + ), + " year", + Doc.Concat( + "{", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + Doc.Group( + " ", + "==", + " ", + "1" + ) + ), + Doc.Indent( + " ", + Doc.Concat( + "?", + " " + ), + "\"\"", + " ", + Doc.Concat( + ":", + " " + ), + "\"s\"" + ) + ) + ), + "", + ")" + ), + "}" + ), + " old", + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "p", + Doc.Concat( + ".", + "Age" + ) + ), + Doc.Group( + " ", + "==", + " ", + "2" + ) + ), + Doc.Indent( + " ", + Doc.Concat( + "?", + " " + ), + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + Doc.Concat( + "{", + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Person", + Doc.Null, + Doc.Concat( + " ", + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + " ", + Doc.Null + ), + Doc.Null, + "}" + ) + ) + ), + "}" + ), + "\"" + ) + ), + " ", + Doc.Concat( + ":", + " " + ), + "\"\"" + ) + ) + ), + "", + ")" + ), + "}" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$@\"", + "\", + Doc.Concat( + "{", + Doc.Group( + "p", + Doc.Concat( + ".", + "Name" + ) + ), + "}" + ), + Doc.Concat( + "", + Doc.LiteralLine, + " \"\"\" + ), + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "s", + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.ForceFlat( + "$\"", + "Color [ R=", + Doc.Concat( + "{", + Doc.ConditionalGroup( + Doc.Concat( + "func", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "3" + ) + ), + "", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "func", + Doc.Group( + "(", + Doc.Indent( + "", + Doc.Concat( + Doc.Concat( + "b", + Doc.Concat( + ":", + " " + ) + ), + "3" + ) + ), + "", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ":", + "#0.##", + "}" + ), + ", G=", + Doc.Concat( + "{", + "G", + ":", + "#0.##", + "}" + ), + ", B=", + Doc.Concat( + "{", + "B", + ":", + "#0.##", + "}" + ), + ", A=", + Doc.Concat( + "{", + "A", + ":", + "#0.##", + "}" + ), + " ]", + "\"" + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// nameof expressions", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "if" + ), + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "x", + Doc.Group( + Doc.Line, + "==", + " ", + "null" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "throw", + Doc.Concat( + " ", + Doc.Group( + Doc.Concat( + "new", + " " + ), + "ArgumentNullException", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "x" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "x" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "nameof", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.ConditionalGroup( + Doc.Concat( + "person", + Doc.Concat( + ".", + "Address" + ), + Doc.Concat( + ".", + "ZipCode" + ) + ), + Doc.Concat( + Doc.Concat( + "person" + ), + Doc.Null, + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Concat( + ".", + "Address" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "ZipCode" + ) + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// prints "ZipCode"", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Index initializers", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "var" + ), + " ", + "numbers", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "45171546-5aca-40b9-82e7-c2ae1c9c4fcb", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Group( + "Dictionary", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "string" + ) + ), + Doc.SoftLine, + ">" + ) + ), + Doc.Null, + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Null, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Group( + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "7" + ), + Doc.SoftLine, + "]" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"seven\"" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "9" + ), + Doc.SoftLine, + "]" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"nine\"" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "13" + ), + Doc.SoftLine, + "]" + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"thirteen\"" + ) + ) + ) + ) + ), + Doc.HardLine, + "}" + ) + ) + ), + "45171546-5aca-40b9-82e7-c2ae1c9c4fcb" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Exception filters", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "try" + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + "MyException", + " ", + "e", + ")" + ), + Doc.Indent( + Doc.Line, + Doc.Concat( + "when", + " " + ), + "(", + Doc.Group( + Doc.Indent( + Doc.ConditionalGroup( + Doc.Concat( + "myfilter", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "e" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "myfilter", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "e" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + Doc.SoftLine + ), + ")" + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Await in catch and finally blocks", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Resource" + ), + " ", + "res", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "try", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "res", + " " + ), + "=", + Doc.GroupWithId( + "f3b281e1-f50c-4bf7-b1b3-44990d77c987", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + "Resource", + Doc.Concat( + ".", + "OpenAsync" + ), + Doc.Group( + "(", + ")" + ) + ) + ), + "f3b281e1-f50c-4bf7-b1b3-44990d77c987" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// You could do this.", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "catch", + Doc.Group( + Doc.Concat( + " ", + "(", + "ResourceException", + " ", + "e", + ")" + ), + Doc.Null + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.Group( + "Resource", + Doc.Concat( + ".", + "LogAsync" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "res", + ",", + Doc.Line, + "e" + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// Now you can do this …", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Concat( + "finally", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "res", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "res", + Doc.Concat( + ".", + "CloseAsync" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "res" + ), + Doc.Concat( + Doc.Concat( + ".", + "CloseAsync" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// … and this.", CommentType.SingleLine) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.AlwaysFits( + Doc.Concat( + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line 6"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line 2 \"test.cs\""), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line default"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.HardLineIfNoPreviousLineSkipBreakIfFirstInGroup, + Doc.Trim, + Doc.Directive("#line hidden"), + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.HardLineSkipBreakIfFirstInGroup + ) + ), + "class", + " " + ), + "CSharp70", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "PatternMatching", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + " ", + "arg" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "b" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "switch", + " ", + "(", + Doc.GroupWithId( + "cb4ba951-3577-4951-a51e-3ea65cab8d0e", + Doc.Indent( + Doc.SoftLine, + "arg" + ), + Doc.SoftLine + ), + ")", + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + "\"A\"", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + "when", + " " + ), + Doc.Group( + "b", + Doc.Indent( + Doc.Group( + Doc.Line, + ">", + " ", + "50" + ) + ) + ) + ) + ), + ":" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Concat( + "case", + " " + ), + "\"B\"", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + "when", + " " + ), + Doc.Group( + "b", + Doc.Indent( + Doc.Group( + Doc.Line, + "<", + " ", + "50" + ) + ) + ) + ) + ), + ":" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + "default", + ":" + ) + ), + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + "break", + ";" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "A", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "B", + ",", + Doc.Line, + "C" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "D" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "E", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "F", + ",", + Doc.Line, + "G" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "H" + ) + ) + ), + Doc.SoftLine, + ")" + ), + " " + ), + "=", + Doc.GroupWithId( + "300b82f1-94ad-4242-9aa7-a2c24e86888d", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "e", + "300b82f1-94ad-4242-9aa7-a2c24e86888d" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "x", + "?", + Doc.Concat( + ".", + "y" + ), + "?", + Doc.Concat( + ".", + "z" + ) + ), + Doc.Line, + "is", + " ", + Doc.Concat( + "Type", + " ", + "value2" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + " ", + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Indent( + Doc.LeadingComment("// code using value", CommentType.SingleLine), + Doc.Null + ), + Doc.HardLine + ), + "}" + ) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + "expr", + Doc.Line, + "is", + " ", + Doc.Concat( + "Type", + " ", + "v" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ), + Doc.Concat( + "async", + " " + ) + ) + ), + "Task", + " ", + "LocalFunctions", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "args" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + "string", + " ", + "Hello2", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + " ", + "i" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + "args", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + Doc.Group( + "Task", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "string" + ), + Doc.Null, + ">" + ) + ), + " ", + "Hello", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "i" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "Task", + Doc.Concat( + ".", + "FromResult" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "args", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Task" + ), + Doc.Concat( + Doc.Concat( + ".", + "FromResult" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "args", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "i" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + Doc.Concat( + "await", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "void", + " ", + "OutVar", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "string", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + " ", + "args" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "int", + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "var", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "int" + ), + Doc.Concat( + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "var", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "int", + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "int", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "int" + ), + Doc.Concat( + Doc.Concat( + ".", + "TryParse" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Hello", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "out", + " " + ), + Doc.Concat( + "int", + " ", + "item" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ThrowExpression", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "result", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "nullableResult", + Doc.Group( + Doc.Line, + "??", + " ", + Doc.Concat( + Doc.Concat( + "throw", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "NullReferenceException", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "BinaryLiterals", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "nineteen", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0b10011" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "DigitSeparators", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "bin", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0b1001_1010_0001_0100" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "hex", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0x1b_a0_44_fe" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "dec", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "33_554_432" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "weird", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1_2__3___4____5_____6______7_______8________9" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "double", + " ", + "real", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "1_000.111_1e-1_000" + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp71", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "DefaultWithoutTypeName", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "string", + " ", + "content", + Doc.Indent( + Doc.Group( + " ", + Doc.Concat( + "=", + Doc.Line + ), + "default" + ) + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DefaultWithoutTypeName", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "default" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DefaultWithoutTypeName", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "default" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "TupleRecognize", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + " ", + "a" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + " ", + "b" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + "?" + ), + " ", + "c" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "result", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "5b0f7e3c-a9b9-4ffb-9857-f369c86b6388", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.ConditionalGroup( + Doc.Concat( + "list", + Doc.Concat( + ".", + "Select" + ), + Doc.Group( + Doc.Indent( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "c", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "c", + Doc.Concat( + ".", + "f1" + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "f3", + Doc.Concat( + ":", + " " + ) + ), + Doc.Group( + "c", + Doc.Concat( + ".", + "f2" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + ".", + "Where" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "t", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "t", + Doc.Concat( + ".", + "f2" + ) + ), + Doc.Group( + Doc.Line, + "==", + " ", + "1" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "list" + ), + Doc.Concat( + Doc.Concat( + ".", + "Select" + ), + Doc.Group( + Doc.Indent( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "c", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "c", + Doc.Concat( + ".", + "f1" + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "f3", + Doc.Concat( + ":", + " " + ) + ), + Doc.Group( + "c", + Doc.Concat( + ".", + "f2" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.Indent( + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Concat( + ".", + "Where" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + "t", + " ", + "=>", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Group( + "t", + Doc.Concat( + ".", + "f2" + ) + ), + Doc.Group( + Doc.Line, + "==", + " ", + "1" + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ) + ) + ), + "5b0f7e3c-a9b9-4ffb-9857-f369c86b6388" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp72", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + "readonly", + " " + ), + Doc.Concat( + "struct", + " " + ), + "ReadonlyRef1", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Func", + Doc.Concat( + "<", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "int", + ",", + Doc.Line, + "int" + ) + ), + Doc.SoftLine, + ">" + ) + ), + " ", + "s", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "da4df76b-af68-4d43-b36e-d2722d02477e", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + "in", + " " + ), + "int", + " ", + "x" + ) + ), + Doc.SoftLine + ), + ")" + ), + " ", + "=>", + Doc.Group( + Doc.Indent( + Doc.Line, + "x" + ) + ) + ), + "da4df76b-af68-4d43-b36e-d2722d02477e" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "TValue" + ), + " ", + Doc.Null, + Doc.Concat( + "this", + Doc.Concat( + "[", + Doc.Concat( + Doc.Group( + "in", + " " + ), + "TKey", + " ", + "index" + ), + "]" + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + "null" + ) + ), + Doc.Null, + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "Vector3", + " ", + Doc.Null, + Doc.Concat( + "operator", + " " + ), + Doc.Null, + "+", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "x" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "y" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + " ", + Doc.Concat( + "=>", + Doc.Line + ), + "null" + ) + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "readonly", + " " + ) + ) + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "Vector3" + ), + " ", + "M1_Trace", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "ref", + " " + ), + Doc.Concat( + "readonly", + " " + ), + "var" + ), + " ", + "r1", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "96cc4b6e-f070-4e8a-b5c8-240ee92d54b7", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.ConditionalGroup( + Doc.Concat( + "M1", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "M1", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ) + ), + "96cc4b6e-f070-4e8a-b5c8-240ee92d54b7" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Not valid. Need an LValue", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "ref", + " " + ), + Doc.Concat( + "readonly", + " " + ), + "Vector3" + ), + " ", + "r2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "193295c4-2a9f-4cd9-b510-3809bd612fe1", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "default", + "(", + "Vector3", + ")" + ) + ), + "193295c4-2a9f-4cd9-b510-3809bd612fe1" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Not valid. r1 is readonly.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Mutate" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// Not valid. r1 is readonly.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Mutate" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Print" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "in", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "Print" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "in", + " " + ), + "r1" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK.", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "r1" + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + Doc.Concat( + "struct", + " " + ), + "ReadonlyRef2", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "readonly", + " " + ), + "Guid" + ), + " ", + "Test", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "v1" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "in", + " " + ), + "Vector3", + " ", + "v2" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "v1" + ), + " " + ), + "=", + Doc.GroupWithId( + "53d5a0ef-8d05-4b11-985d-476c5e77e0a3", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "default", + "(", + "Vector3", + ")" + ), + "53d5a0ef-8d05-4b11-985d-476c5e77e0a3" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Group( + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "v1" + ), + Doc.Concat( + ".", + "X" + ) + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "0" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.ConditionalGroup( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "foo" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "v1", + Doc.Concat( + ".", + "X" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// not OK!!", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "foo" + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "v1", + Doc.Concat( + ".", + "X" + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + Doc.Group( + "arr", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ), + Doc.Indent( + Doc.Line, + Doc.Concat( + "?", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.Line, + Doc.Concat( + ":", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "otherArr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "span", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "1" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// OK", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "return", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Vector3", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Group( + Doc.Group( + "v1", + Doc.Concat( + ".", + "X" + ) + ), + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + Doc.Group( + "v2", + Doc.Concat( + ".", + "X" + ) + ) + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "v1", + Doc.Concat( + ".", + "Y" + ) + ), + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + Doc.Group( + "v2", + Doc.Concat( + ".", + "Y" + ) + ) + ) + ) + ), + ",", + Doc.Line, + Doc.Group( + Doc.Group( + "v1", + Doc.Concat( + ".", + "Z" + ) + ), + Doc.Indent( + Doc.Group( + Doc.Line, + "+", + " ", + Doc.Group( + "v2", + Doc.Concat( + ".", + "Z" + ) + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "T" + ), + " ", + "Choice", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "bool", + " ", + "condition" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "T", + " ", + "consequence" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "ref", + " " + ), + "T", + " ", + "alternative" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + "condition" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "consequence" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.HardLine, + Doc.Concat( + "else", + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + "alternative" + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "DoSomething", + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "bool", + " ", + "isEmployed" + ), + ",", + Doc.Line, + Doc.Concat( + "string", + " ", + "personName" + ), + ",", + Doc.Line, + Doc.Concat( + "int", + " ", + "personAge" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Concat( + " ", + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "NonTrailingNamedArguments", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "name", + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "name", + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// currently CS1738, but would become legal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// currently CS1738, but would become legal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ), + ",", + Doc.Line, + "age" + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// remains illegal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + "age", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "name", + ",", + Doc.Line, + "age", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "isEmployed", + Doc.Concat( + ":", + " " + ) + ), + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// remains illegal", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personAge", + Doc.Concat( + ":", + " " + ) + ), + "age" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "DoSomething", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "true", + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personAge", + Doc.Concat( + ":", + " " + ) + ), + "age" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Concat( + "personName", + Doc.Concat( + ":", + " " + ) + ), + "name" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// already legal", CommentType.SingleLine) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "ConditionalRef", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Null, + "var" + ), + " ", + "r", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "953af41e-e84e-4486-aaef-47f1255f093a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Null, + Doc.Group( + "arr", + Doc.Group( + Doc.Line, + "!=", + " ", + "null" + ) + ), + Doc.Indent( + Doc.Line, + Doc.Concat( + "?", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "arr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ), + Doc.Line, + Doc.Concat( + ":", + " " + ), + Doc.Concat( + Doc.Concat( + "ref", + " " + ), + Doc.Concat( + "otherArr", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "0" + ), + Doc.SoftLine, + "]" + ) + ) + ) + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + "953af41e-e84e-4486-aaef-47f1255f093a" + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "LeadingSeparator", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "res", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "0", + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "123", + Doc.TrailingComment("// permitted in C# 1.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "1_2_3", + Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0x1_2_3", + Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0b101", + Doc.TrailingComment("// binary literals added in C# 7.0", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0b1_0_1", + Doc.TrailingComment("// permitted in C# 7.0 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + Doc.Concat( + Doc.Concat( + Doc.LeadingComment("// in C# 7.2, _ is permitted after the `0x` or `0b`", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup + ), + "+" + ), + " ", + Doc.Concat( + "0x_1_2", + Doc.TrailingComment("// permitted in C# 7.2 and later", CommentType.SingleLine) + ) + ), + Doc.Concat( + Doc.Line, + "+", + " ", + Doc.Concat( + "0b_1_0_1", + Doc.TrailingComment("// permitted in C# 7.2 and later", CommentType.SingleLine) + ) + ) + ) + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp73", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Blittable", + Doc.Group( + "<", + Doc.Indent( + Doc.Null, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + "T" + ) + ), + Doc.Null, + ">" + ), + Doc.Group( + "(", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "T", + " ", + "value" + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Concat( + "where", + " " + ), + "T", + " ", + Doc.Concat( + ":", + " " + ), + Doc.Indent( + "unmanaged" + ) + ) + ) + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "unmanaged", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "666" + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Group( + "unsafe", + " " + ), + Doc.Concat( + "struct", + " " + ), + "IndexingMovableFixed", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + "public", + " ", + "fixed" + ), + " " + ), + Doc.Group( + "int", + " ", + "myFixedField", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "10" + ), + Doc.SoftLine, + "]" + ) + ), + ";" + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "static", + " " + ), + Doc.Group( + "IndexingMovableFixed", + " ", + "s", + Doc.Null + ), + ";" + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "unsafe", + " " + ) + ) + ), + "void", + " ", + "IndexingMovableFixedFields", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "int", + "*" + ), + " ", + "ptr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "aa1a65d2-15b9-4101-9735-a81a46b82734", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + "s", + Doc.Concat( + ".", + "myFixedField" + ) + ), + "aa1a65d2-15b9-4101-9735-a81a46b82734" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "int", + " ", + "t", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "94f17906-f5c1-41fc-a502-6b5e6ead23c6", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Group( + "s", + Doc.Concat( + ".", + "myFixedField" + ) + ), + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "5" + ), + Doc.SoftLine, + "]" + ) + ), + "94f17906-f5c1-41fc-a502-6b5e6ead23c6" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "PatternBasedFixed", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "byte", + "*" + ), + " ", + "ptr", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "f5b72adc-f7eb-4309-8f65-dbbcbc0b48ae", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "byteArray", + "f5b72adc-f7eb-4309-8f65-dbbcbc0b48ae" + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Group( + Doc.Line, + "{", + " ", + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Indent( + Doc.LeadingComment("// ptr is a native pointer to the first element of the array", CommentType.SingleLine), + Doc.Null, + Doc.HardLineSkipBreakIfFirstInGroup, + Doc.LeadingComment("// byteArray is protected from being moved/collected by the GC for the duration of this block", CommentType.SingleLine), + Doc.Null + ), + Doc.HardLine + ), + "}" + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "StackallocArrayInitializer", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + "" + ) + ) + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// currently allowed", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Group( + "[", + Doc.Concat( + Doc.Indent( + Doc.SoftLine, + "3" + ), + Doc.SoftLine + ), + "]" + ) + ) + ), + Doc.Concat( + " ", + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.Line, + "}" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "stackalloc", + " " + ), + Doc.Concat( + "int", + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + Doc.Concat( + " ", + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.Line, + "}" + ) + ) + ) + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Group( + "Span", + Doc.Concat( + "<", + Doc.Concat( + Doc.Null, + "int" + ), + Doc.Null, + ">" + ) + ), + " ", + "a", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "5184f1eb-78a0-4fe0-9da4-a43a09677830", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "stackalloc", + "[", + Doc.Concat( + "]", + " " + ), + Doc.Group( + Doc.Null, + "{", + Doc.Indent( + Doc.Line, + Doc.Concat( + "1", + ",", + Doc.Line, + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.Line, + "}" + ) + ), + "5184f1eb-78a0-4fe0-9da4-a43a09677830" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Null + ), + "void", + " ", + "TupleEquality", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "int", + Doc.Null + ), + ",", + Doc.Line, + Doc.Concat( + "int", + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ) + ) + ), + Doc.SoftLine, + ")" + ), + " ", + Doc.Indent( + "t1", + ",", + Doc.HardLine, + "t2" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "res", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Group( + "t1", + Doc.Group( + Doc.Line, + "==", + " ", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "1", + ",", + Doc.Line, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + ",", + Doc.Line, + "3" + ) + ), + Doc.SoftLine, + ")" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ) + ) + ) + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + "namespace", + " ", + "CSharp80", + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Null, + Doc.Concat( + Doc.Concat( + "class", + " " + ), + "CSharp80ExceptInterfaceDefaultImplement", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "ReferenceNullable", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "var", + "?" + ), + " ", + "x", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "420bf32b-7eeb-42c2-9c2f-ee1e3e3a8724", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + "E", + "420bf32b-7eeb-42c2-9c2f-ee1e3e3a8724" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Concat( + "x", + "!" + ), + Doc.Concat( + ".", + "ToString" + ), + Doc.Group( + "(", + ")" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "string", + "?" + ), + " ", + "wtf", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "null" + ) + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Concat( + Doc.Concat( + "int", + "?" + ), + Doc.Concat( + Doc.Concat( + "[", + Doc.Null, + "]" + ) + ) + ), + "?" + ), + " ", + "hello", + Doc.Null + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Patterns", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "if", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + "o", + Doc.Line, + "is", + " ", + "string" + ), + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Indent( + Doc.Line, + Doc.Group( + Doc.Concat( + "Length", + Doc.Concat( + ":", + " " + ) + ), + "5" + ) + ), + Doc.Line, + "}" + ), + " ", + "s" + ) + ) + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "Do", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "Do", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.HardLine, + Doc.Concat( + "return", + " " + ), + Doc.Concat( + Doc.Group( + "lang", + Doc.Concat( + ".", + "CountOfTokens" + ) + ), + " ", + "switch", + Doc.HardLine, + "{", + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "1", + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + "100" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "2", + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + "200" + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "_", + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Concat( + Doc.Concat( + "throw", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + Doc.Concat( + Doc.Concat( + "global", + "::", + "System" + ), + ".", + "Exception" + ), + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "newState", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "4db6b10f-9668-4e80-98f6-911a47bafd27", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.ConditionalGroup( + Doc.Concat( + "GetState", + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "GetState", + Doc.Group( + "(", + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ",", + Doc.Line, + "action", + ",", + Doc.Line, + "hasKey" + ) + ), + Doc.SoftLine, + ")" + ), + " ", + "switch", + Doc.HardLine, + "{", + Doc.Group( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Open" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Opened" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Opened" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Close" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Lock" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Locked" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Locked" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + Doc.Group( + "Action", + Doc.Concat( + ".", + "Unlock" + ) + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "true" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + Doc.Group( + "DoorState", + Doc.Concat( + ".", + "Closed" + ) + ) + ) + ) + ), + ",", + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Concat( + Doc.Concat( + "var", + " " + ), + "state" + ) + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "_" + ) + ) + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Indent( + Doc.Line, + Doc.Concat( + "=>", + " " + ), + "state" + ) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + "4db6b10f-9668-4e80-98f6-911a47bafd27" + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Null + ), + "Task", + " ", + "AsyncStreams", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "await", + " ", + "foreach", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "var", + " ", + "item" + ), + " ", + "in", + " ", + "asyncEnumerables" + ), + Doc.SoftLine + ), + ")" + ), + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "Ranges", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "thirdItem", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "38c3defe-efc3-4a29-99b6-a2e37c26df18", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + "2" + ), + Doc.SoftLine, + "]" + ) + ), + "38c3defe-efc3-4a29-99b6-a2e37c26df18" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[2]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "lastItem", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "5c09946a-60da-45dd-9d9f-1c09635ea39a", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "^", + "1" + ) + ), + Doc.SoftLine, + "]" + ) + ), + "5c09946a-60da-45dd-9d9f-1c09635ea39a" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Index.CreateFromEnd(1)]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "multiDimensional", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "4d6f0edb-3063-4c0a-9cd4-70fa8ca7fed7", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "3", + ",", + Doc.Line, + Doc.Concat( + "^", + "2" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "4d6f0edb-3063-4c0a-9cd4-70fa8ca7fed7" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[3, Index.CreateFromEnd(2)]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.HardLine, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice1", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "ec99a039-f7e1-4ca9-86a3-1287ac6c5238", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + "..", + Doc.Concat( + "^", + "3" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "ec99a039-f7e1-4ca9-86a3-1287ac6c5238" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.Create(2, Index.CreateFromEnd(3))]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice2", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "0012177f-cfea-4ed9-9e62-1a825872fd30", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + "..", + Doc.Concat( + "^", + "3" + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "0012177f-cfea-4ed9-9e62-1a825872fd30" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.ToEnd(Index.CreateFromEnd(3))]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice3", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "8ed3e83d-e5fb-4c2e-bfcd-79ebc27e7218", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + "2", + "..", + Doc.Null + ) + ), + Doc.SoftLine, + "]" + ) + ), + "8ed3e83d-e5fb-4c2e-bfcd-79ebc27e7218" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.FromStart(2)]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "slice4", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "9acb9e4d-5dfc-4bc2-817c-29eaacc503f4", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Null, + "..", + Doc.Null + ) + ), + Doc.SoftLine, + "]" + ) + ), + "9acb9e4d-5dfc-4bc2-817c-29eaacc503f4" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.All]", CommentType.SingleLine) + ) + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "multiDimensional", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "075b9e05-bf36-4022-adf9-95bf977de1f5", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Concat( + "list", + Doc.Group( + "[", + Doc.Indent( + Doc.SoftLine, + Doc.Concat( + Doc.Concat( + "1", + "..", + "2" + ), + ",", + Doc.Line, + Doc.Concat( + Doc.Null, + "..", + Doc.Null + ) + ) + ), + Doc.SoftLine, + "]" + ) + ), + "075b9e05-bf36-4022-adf9-95bf977de1f5" + ) + ), + Doc.Concat( + ";", + Doc.TrailingComment("// list[Range.Create(1, 2), Range.All]", CommentType.SingleLine) + ) + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "UsingDeclarators", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Concat( + "using", + " " + ), + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "item", + Doc.Null + ), + " " + ), + "=", + Doc.GroupWithId( + "76552bd9-1276-4acf-834a-a0ed6c4ae827", + Doc.Indent( + Doc.Line + ) + ), + Doc.IndentIfBreak( + Doc.Group( + Doc.Concat( + "new", + " " + ), + "FileStream", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"./.f\"" + ), + Doc.SoftLine, + ")" + ), + Doc.Null + ), + "76552bd9-1276-4acf-834a-a0ed6c4ae827" + ) + ), + ";" + ), + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Group( + "fixed", + " ", + "(", + Doc.Group( + Doc.Indent( + Doc.SoftLine, + Doc.Group( + Doc.Group( + Doc.Concat( + Doc.Concat( + "char", + "*" + ), + " ", + "ch", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + "\"hell\"" + ) + ) + ) + ), + Doc.SoftLine + ), + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Indent( + Doc.HardLine, + ";" + ) + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "item", + Doc.Concat( + ".", + "Dispose" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "item" + ), + Doc.Concat( + Doc.Concat( + ".", + "Dispose" + ), + Doc.Group( + "(", + ")" + ) + ), + Doc.Null + ) + ), + ";" + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "StaticLocalFunction", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "unsafe", + " " + ) + ) + ), + "void", + " ", + "Func1", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "unsafe", + " " + ) + ) + ), + "void", + " ", + "Func1", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "async", + " ", + Doc.Concat( + Doc.Concat( + "static", + " " + ) + ) + ), + "void", + " ", + "Func2", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + "static", + " ", + Doc.Concat( + Doc.Concat( + "async", + " " + ) + ) + ), + "void", + " ", + "Func2", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + " ", + "}" + ), + Doc.Null + ) + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "NullCoalescingAssignment", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Concat( + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Null, + Doc.Group( + Doc.Group( + Doc.Concat( + "var", + " ", + "item", + Doc.Null + ), + " " + ), + "=", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Group( + "a", + " " + ), + "??=", + Doc.Line, + Doc.Concat( + Doc.Group( + "b", + " " + ), + "??=", + Doc.Line, + Doc.Concat( + Doc.Group( + "c", + " " + ), + "??=", + Doc.Line, + Doc.Concat( + Doc.Group( + "d", + " " + ), + "??=", + Doc.Indent( + Doc.Line, + Doc.Concat( + Doc.Concat( + "throw", + " " + ), + Doc.Group( + Doc.Concat( + "new", + " " + ), + "Exception", + Doc.Group( + "(", + ")" + ), + Doc.Null + ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "public", + " ", + Doc.Concat( + Doc.Concat( + "readonly", + " " + ) + ) + ), + "float", + " ", + "Hello", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Concat( + "return", + " " + ), + "0.1f", + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IA", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IA", + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + "void", + " ", + "M", + "(", + ")", + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IA.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IB", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "IA", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "override", + " ", + Doc.Null + ), + "void", + " ", + "IA", + ".", + "M", + "(", + Doc.Concat( + ")", + Doc.TrailingComment("// explicitly named", CommentType.SingleLine) + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IB.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IB.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ), + Doc.HardLine, + Doc.HardLine, + Doc.Concat( + Doc.Concat( + "interface", + " " + ), + "IC", + Doc.Group( + Doc.Indent( + Doc.Line, + Doc.Concat( + ":", + " ", + "IA", + Doc.Null + ) + ) + ), + Doc.Null, + Doc.HardLine, + "{", + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.Group( + Doc.Group( + "override", + " ", + Doc.Null + ), + "void", + " ", + "M", + "(", + Doc.Concat( + ")", + Doc.TrailingComment("// implicitly named", CommentType.SingleLine) + ), + Doc.IfBreak( + Doc.Null, + Doc.SoftLine + ) + ), + Doc.Null, + Doc.Group( + Doc.Line, + "{", + Doc.Concat( + Doc.Indent( + Doc.HardLine, + Doc.Group( + Doc.Null, + Doc.ConditionalGroup( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IC.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Concat( + Doc.Concat( + "WriteLine", + Doc.Group( + "(", + Doc.Indent( + Doc.SoftLine, + "\"IC.M\"" + ), + Doc.SoftLine, + ")" + ) + ), + Doc.Null, + Doc.Null + ) + ), + ";" + ) + ), + Doc.HardLine + ), + "}" + ), + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLine, + "}", + Doc.Null + ) + ), + Doc.HardLineIfNoPreviousLine +) \ No newline at end of file diff --git a/Src/CSharpier.Tests/Samples/Scratch.test b/Src/CSharpier.Tests/Samples/Scratch.test index 1d8ef2950..5f282702b 100644 --- a/Src/CSharpier.Tests/Samples/Scratch.test +++ b/Src/CSharpier.Tests/Samples/Scratch.test @@ -1 +1 @@ -Doc.HardLineIfNoPreviousLine \ No newline at end of file + \ No newline at end of file diff --git a/Src/CSharpier/XmlFormatter.cs b/Src/CSharpier/XmlFormatter.cs deleted file mode 100644 index f40076234..000000000 --- a/Src/CSharpier/XmlFormatter.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace CSharpier; - -internal class XmlFormatter : IFormatter -{ - public Task FormatAsync( - string code, - PrinterOptions printerOptions, - CancellationToken cancellationToken - ) - { - throw new NotImplementedException(); - } -} From ebd2316d793de28839ef23db4b591dc2191e1432 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 17 Apr 2023 12:25:26 -0500 Subject: [PATCH 15/21] Getting attributes working better --- .../ClientApp/src/Controls.tsx | 2 +- .../Controllers/FormatController.cs | 2 +- Src/CSharpier.Tests/CSharpier.Tests.csproj | 3 - .../TestFiles/csproj/LongAttributes.test | 97 ------------------ .../TestFiles/csproj/RetainXmlElement.test | 2 - .../TestFiles/xml/Attributes.test | 14 +++ .../{csproj => xml}/BasicProject.test | 0 .../TestFiles/{csproj => xml}/Conditions.test | 2 +- .../TestFiles/{csproj => xml}/Elements.test | 1 + .../TestFiles/xml/LongAttributes.test | 98 +++++++++++++++++++ .../TestFiles/xml/RetainXmlElement.test | 2 + Src/CSharpier/CodeFormatter.cs | 1 + .../Formatters/Xml/XmlNodePrinters/Element.cs | 15 +-- 13 files changed, 128 insertions(+), 111 deletions(-) delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test delete mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Attributes.test rename Src/CSharpier.Tests/FormattingTests/TestFiles/{csproj => xml}/BasicProject.test (100%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{csproj => xml}/Conditions.test (88%) rename Src/CSharpier.Tests/FormattingTests/TestFiles/{csproj => xml}/Elements.test (83%) create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/xml/LongAttributes.test create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/xml/RetainXmlElement.test diff --git a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx index a4c6f5fd5..b7679eba5 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx @@ -28,7 +28,7 @@ export const Controls = observer(() => { Language {fileExtension === "cs" && ( diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 64b7c2706..c057c23fc 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -56,7 +56,7 @@ public async Task Post([FromBody] string content, string fileExten }; } - if (fileExtension == "csproj") + if (fileExtension == "xml") { var result = XmlFormatter.Format( content, diff --git a/Src/CSharpier.Tests/CSharpier.Tests.csproj b/Src/CSharpier.Tests/CSharpier.Tests.csproj index 85f2c9cdf..cafce0e3e 100644 --- a/Src/CSharpier.Tests/CSharpier.Tests.csproj +++ b/Src/CSharpier.Tests/CSharpier.Tests.csproj @@ -27,7 +27,4 @@ $([System.String]::Copy(%(Filename)).Replace('.expected', '.test')) - - - diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test deleted file mode 100644 index 9c620221e..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/LongAttributes.test +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test deleted file mode 100644 index 14be65070..000000000 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/RetainXmlElement.test +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Attributes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Attributes.test new file mode 100644 index 000000000..f5c97bca6 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Attributes.test @@ -0,0 +1,14 @@ + + + + + diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/BasicProject.test similarity index 100% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/BasicProject.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/xml/BasicProject.test diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Conditions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Conditions.test similarity index 88% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Conditions.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Conditions.test index b1e91939b..f0a27341a 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Conditions.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Conditions.test @@ -4,6 +4,6 @@ Condition=" '$(MSBuildProjectName)' != 'Microsoft.TestCommon' AND '$(MSBuildProjectName)' != 'System.Net.Http.Formatting.NetCore.Test' AND '$(MSBuildProjectName)' != 'System.Net.Http.Formatting.NetStandard.Test' " - >v4.5.2 + >v4.5.2 diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test similarity index 83% rename from Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test rename to Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test index 354eca1ac..6e1e3621d 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/csproj/Elements.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test @@ -1,4 +1,5 @@ + Text diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/LongAttributes.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/LongAttributes.test new file mode 100644 index 000000000..036644c51 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/LongAttributes.test @@ -0,0 +1,98 @@ + + + + + + + diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/RetainXmlElement.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/RetainXmlElement.test new file mode 100644 index 000000000..820a64750 --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/RetainXmlElement.test @@ -0,0 +1,2 @@ + + diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index b67fa3338..cbe1cc484 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -62,6 +62,7 @@ CancellationToken cancellationToken return await CSharpFormatter.FormatAsync(fileContents, options, cancellationToken); } + // TODO XML maybe don't include xml by default? if (loweredExtension is ".csproj" or ".props" or ".targets" or ".xml") { return XmlFormatter.Format(fileContents, options); diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs index 7f8128b51..d3dccbb94 100644 --- a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs @@ -6,10 +6,13 @@ internal static class Element { internal static Doc Print(XmlElement element) { + if (element.IsEmpty) + { + return Doc.Group("<" + element.Name, PrintAttributes(element), Doc.Line, "/>"); + } + return Doc.Group( - "<" + element.Name, - PrintAttributes(element), - ">", + Doc.Group("<" + element.Name, PrintAttributes(element), Doc.SoftLine, ">"), PrintChildren(element), "" ); @@ -20,11 +23,11 @@ private static Doc PrintAttributes(XmlElement element) var result = new List(); foreach (XmlAttribute attribute in element.Attributes) { - result.Add(" "); - result.Add(attribute.OuterXml); + // TODO XML replace line endings in Value with the proper ones + result.Add(Doc.Line, attribute.Name, "=\"", attribute.Value, "\""); } - return Doc.Concat(result); + return Doc.Indent(result); } private static Doc PrintChildren(XmlElement element) From f95ad65422a491fd3f0bd5bb3c66f7917d27b46c Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 17 Apr 2023 13:03:58 -0500 Subject: [PATCH 16/21] some little cleanup --- Src/CSharpier.Cli/CommandLineFormatter.cs | 12 ++-- .../Controllers/FormatController.cs | 57 ++++++------------- Src/CSharpier.Tests/CodeFormatterTests.cs | 25 -------- .../TestFiles/xml/Comments.test | 4 ++ .../TestFiles/xml/Elements.test | 6 ++ Src/CSharpier.Tests/PrinterOptionsTests.cs | 33 +++++++++++ Src/CSharpier/CodeFormatter.cs | 2 +- Src/CSharpier/Formatters/Xml/XmlFormatter.cs | 14 ----- .../Formatters/Xml/XmlNodePrinters/Node.cs | 5 ++ 9 files changed, 69 insertions(+), 89 deletions(-) create mode 100644 Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test create mode 100644 Src/CSharpier.Tests/PrinterOptionsTests.cs diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index 423ac3f56..33ed97ab2 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -355,7 +355,6 @@ CancellationToken cancellationToken try { - // TODO xml find correct formatter codeFormattingResult = await CodeFormatter.FormatAsync( fileToFormatInfo.FileContents, Path.GetExtension(fileToFormatInfo.Path), @@ -393,13 +392,10 @@ CancellationToken cancellationToken return; } - // TODO xml there should be some better way to skip this for xml files - // TODO xml https://github.com/belav/csharpier-repos/pull/63/files?diff=split&w=1#diff-728cec53af202d35e1f3cad47603161109fd1e388c8531ba730b355e794983de - // it moves things onto the same line? - // TODO https://github.com/belav/csharpier-repos/pull/63/files?diff=split&w=1#diff-bd08b8684f5eba71601efe0b04bb5c04faa1c7ee4362c1c05744a03b1461003b - // auto collapse nodes with no content? - // TODO https://github.com/belav/csharpier-repos/pull/63/files?diff=split&w=1#diff-75c74095e49441988711783ff9cf04ef4d64c82f967356d9258151c929e7aae9 - // this one is real ugly, ugh, why is it collapsing new lines? + // TODO xml implement this stuff - maybe new PR? + // https://github.com/belav/csharpier/pull/858#issuecomment-1487385384 + // TODO xml review this https://github.com/belav/csharpier-repos/pull/67 + // TODO xml what about allowing lines between elements? if (!commandLineOptions.Fast && fileToFormatInfo.Path.EndsWithIgnoreCase(".cs")) { var syntaxNodeComparer = new SyntaxNodeComparer( diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index c057c23fc..56ca051f2 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -34,50 +34,25 @@ public FormatController(ILogger logger) [HttpPost] public async Task Post([FromBody] string content, string fileExtension) { - // TODO xml use the proper formatter class? - if (fileExtension == "cs") - { - var result = await CSharpFormatter.FormatAsync( - content, - new PrinterOptions - { - IncludeAST = true, - IncludeDocTree = true, - Width = PrinterOptions.WidthUsedByTests - } - ); - - return new FormatResult + var result = await CodeFormatter.FormatAsync( + content, + fileExtension, + new PrinterOptions { - Code = result.Code, - Json = result.AST, - Doc = result.DocTree, - Errors = result.CompilationErrors.Select(this.ConvertError).ToList(), - }; - } + IncludeAST = true, + IncludeDocTree = true, + Width = PrinterOptions.WidthUsedByTests + }, + CancellationToken.None + ); - if (fileExtension == "xml") + return new FormatResult { - var result = XmlFormatter.Format( - content, - new PrinterOptions - { - Width = PrinterOptions.WidthUsedByTests, - IncludeAST = true, - IncludeDocTree = true, - } - ); - - return new FormatResult - { - Code = result.Code, - Json = result.AST, - Doc = result.DocTree, - Errors = new List() - }; - } - - throw new Exception("Cannot handle file extension " + fileExtension); + Code = result.Code, + Json = result.AST, + Doc = result.DocTree, + Errors = result.CompilationErrors.Select(this.ConvertError).ToList(), + }; } private FormatError ConvertError(Diagnostic diagnostic) diff --git a/Src/CSharpier.Tests/CodeFormatterTests.cs b/Src/CSharpier.Tests/CodeFormatterTests.cs index e517676ad..032e20ca8 100644 --- a/Src/CSharpier.Tests/CodeFormatterTests.cs +++ b/Src/CSharpier.Tests/CodeFormatterTests.cs @@ -4,35 +4,10 @@ namespace CSharpier.Tests; -// TODO xml move these around [TestFixture] [Parallelizable(ParallelScope.All)] internal class CodeFormatterTests { - [TestCase(EndOfLine.LF, "\n")] - [TestCase(EndOfLine.CRLF, "\r\n")] - public void GetLineEndings_Should_Return_Easy_Cases(EndOfLine endOfLine, string expected) - { - var code = "tester\n"; - var result = PrinterOptions.GetLineEnding( - code, - new PrinterOptions { EndOfLine = endOfLine } - ); - - result.Should().Be(expected); - } - - [TestCase("tester\n", "\n")] - [TestCase("tester\r\n", "\r\n")] - [TestCase("\ntester\n", "\n")] - [TestCase("tester", "\n")] - public void GetLineEndings_With_Auto_Should_Detect(string code, string expected) - { - var result = PrinterOptions.GetLineEnding(code, new PrinterOptions()); - - result.Should().Be(expected); - } - [Test] public void Format_Should_Use_Default_Width() { diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test new file mode 100644 index 000000000..8a69ffbbf --- /dev/null +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test index 6e1e3621d..adfc814b0 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test @@ -2,4 +2,10 @@ Text + 4.3.0 + $(MSBuildThisFileDirectory)..\..\tools\roslynlatest diff --git a/Src/CSharpier.Tests/PrinterOptionsTests.cs b/Src/CSharpier.Tests/PrinterOptionsTests.cs new file mode 100644 index 000000000..6a3ba9f2a --- /dev/null +++ b/Src/CSharpier.Tests/PrinterOptionsTests.cs @@ -0,0 +1,33 @@ +namespace CSharpier.Tests; + +using FluentAssertions; +using NUnit.Framework; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +internal class PrinterOptionsTests +{ + [TestCase(EndOfLine.LF, "\n")] + [TestCase(EndOfLine.CRLF, "\r\n")] + public void GetLineEndings_Should_Return_Easy_Cases(EndOfLine endOfLine, string expected) + { + var code = "tester\n"; + var result = PrinterOptions.GetLineEnding( + code, + new PrinterOptions { EndOfLine = endOfLine } + ); + + result.Should().Be(expected); + } + + [TestCase("tester\n", "\n")] + [TestCase("tester\r\n", "\r\n")] + [TestCase("\ntester\n", "\n")] + [TestCase("tester", "\n")] + public void GetLineEndings_With_Auto_Should_Detect(string code, string expected) + { + var result = PrinterOptions.GetLineEnding(code, new PrinterOptions()); + + result.Should().Be(expected); + } +} diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index cbe1cc484..f6f669845 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -47,7 +47,6 @@ public static Task FormatAsync( ); } - // TODO XML make use of this? internal static async Task FormatAsync( string fileContents, string fileExtension, @@ -62,6 +61,7 @@ CancellationToken cancellationToken return await CSharpFormatter.FormatAsync(fileContents, options, cancellationToken); } + // TODO XML maybe make this opt in until it is better tested? // TODO XML maybe don't include xml by default? if (loweredExtension is ".csproj" or ".props" or ".targets" or ".xml") { diff --git a/Src/CSharpier/Formatters/Xml/XmlFormatter.cs b/Src/CSharpier/Formatters/Xml/XmlFormatter.cs index 9a592ffb0..84a43d58a 100644 --- a/Src/CSharpier/Formatters/Xml/XmlFormatter.cs +++ b/Src/CSharpier/Formatters/Xml/XmlFormatter.cs @@ -8,22 +8,8 @@ internal static class XmlFormatter { internal static CodeFormatterResult Format(string xml, PrinterOptions printerOptions) { - // TODO xml width? - // var stringBuilder = new StringWriter(); - // - // var settings = new XmlWriterSettings - // { - // Indent = true, - // IndentChars = printerOptions.UseTabs ? "\t" : new string(' ', printerOptions.TabWidth), - // NewLineChars = PrinterOptions.GetLineEnding(code, printerOptions), - // OmitXmlDeclaration = !code.Trim().StartsWith(" Date: Sun, 15 Sep 2024 13:38:22 -0500 Subject: [PATCH 17/21] get playground partly working --- Src/CSharpier.Playground/Controllers/FormatController.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 34f887ed9..2dc83ee6b 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -36,9 +36,6 @@ public FormatController(ILogger logger) public class PostModel { public string Code { get; set; } = string.Empty; - - // TODO ditch this and use the parser? - public string FileExtension { get; set; } = string.Empty; public int PrintWidth { get; set; } public int IndentSize { get; set; } public bool UseTabs { get; set; } @@ -51,13 +48,15 @@ public async Task Post( CancellationToken cancellationToken ) { - var sourceCodeKind = model.FileExtension.EqualsIgnoreCase(".csx") + // TODO + var sourceCodeKind = false // model.FileExtension.EqualsIgnoreCase(".csx") ? SourceCodeKind.Script : SourceCodeKind.Regular; var result = await CodeFormatter.FormatAsync( model.Code, - model.FileExtension, + // TODO + ".cs", new PrinterOptions { IncludeAST = true, From 21b71851414b4447727d3cb806e404442e0eb9c5 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Sun, 15 Sep 2024 13:46:27 -0500 Subject: [PATCH 18/21] cleanup usings --- .editorconfig | 1 + CSharpier.sln.DotSettings | 1 + Src/CSharpier.Benchmarks/Program.cs | 3 +-- Src/CSharpier.Cli.Tests/CliTests.cs | 6 ++---- .../EditorConfig/SectionTests.cs | 4 ++-- Src/CSharpier.Cli.Tests/ServerTests.cs | 5 ++--- Src/CSharpier.Cli/CommandLineFormatter.cs | 17 ++++++++++------- Src/CSharpier.Cli/CommandLineOptions.cs | 3 +-- Src/CSharpier.Cli/EditorConfig/GlobMatcher.cs | 7 ++++--- Src/CSharpier.Cli/EditorConfig/Section.cs | 4 ++-- Src/CSharpier.Cli/FormattingCache.cs | 3 +-- .../Options/CaseInsensitiveEnumConverter.cs | 4 ++-- Src/CSharpier.Cli/Options/ConfigFileParser.cs | 4 ++-- .../Options/ConfigurationFileOptions.cs | 4 ++-- Src/CSharpier.Cli/Options/OptionsProvider.cs | 4 ++-- Src/CSharpier.Cli/PipeMultipleFilesFormatter.cs | 4 ++-- Src/CSharpier.Cli/Program.cs | 3 +-- .../Server/CSharpierServiceImplementation.cs | 4 ++-- Src/CSharpier.Cli/Server/FormatFileResult.cs | 4 ++-- Src/CSharpier.Cli/Server/ServerFormatter.cs | 4 ++-- .../SyntaxNodeComparerGenerator.cs | 3 +-- .../NodePrinterGenerator.cs | 6 +++--- .../Controllers/FormatController.cs | 3 --- .../FormattingTestsGenerator.cs | 7 +++---- Src/CSharpier.Tests/CSharpierIgnoreTests.cs | 5 ++--- .../Cli/Options/ConfigFileParserTests.cs | 4 ++-- .../CommandLineFormatterTests.cs | 3 +-- .../CSharp/PreprocessorSymbolsTests.cs | 4 ++-- Src/CSharpier.Tests/FormattingTests/BaseTest.cs | 5 ++--- .../FormattingTests/LineEndingEdgeCase.cs | 4 ++-- Src/CSharpier.Tests/OptionsProviderTests.cs | 4 ++-- Src/CSharpier.Tests/PrinterOptionsTests.cs | 4 ++-- Src/CSharpier.Tests/Samples/Samples.cs | 3 +-- Src/CSharpier.Tests/SyntaxNodeComparerTests.cs | 3 +-- Src/CSharpier/CodeFormatter.cs | 5 ++--- .../CSharp/BooleanExpressionParser.cs | 4 ++-- Src/CSharpier/Formatters/Xml/XmlFormatter.cs | 6 +++--- .../Formatters/Xml/XmlNodePrinters/Element.cs | 4 ++-- .../Formatters/Xml/XmlNodePrinters/Node.cs | 4 ++-- Src/CSharpier/SyntaxNodeJsonWriter.cs | 4 ++-- Src/CSharpier/SyntaxPrinter/CSharpierIgnore.cs | 4 ++-- .../SyntaxPrinter/MembersWithForcedLines.cs | 3 +-- .../SyntaxPrinter/SeparatedSyntaxList.cs | 4 ++-- .../SyntaxNodePrinters/BaseMethodDeclaration.cs | 4 ++-- Src/CSharpier/SyntaxPrinter/Token.cs | 4 ++-- Src/CSharpier/Utilities/StackExtensions.cs | 4 ++-- Src/SyntaxFinder/SyntaxFinderWalker.cs | 4 ++-- Src/SyntaxFinder/SyntaxTriviaExtensions.cs | 4 ++-- Src/SyntaxFinder/Walkers/ExampleWalker.cs | 4 ++-- Src/SyntaxFinder/Walkers/ModifiersWalker.cs | 4 ++-- .../NestedConditionalExpressionsWalker.cs | 4 ++-- .../Walkers/ObjectInitializerWalker.cs | 4 ++-- Src/SyntaxFinder/Walkers/SpreadWalker.cs | 4 ++-- 53 files changed, 106 insertions(+), 119 deletions(-) diff --git a/.editorconfig b/.editorconfig index 69fe77aa1..c06f455ce 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,4 +4,5 @@ indent_style = space [*.{cs,vb}] dotnet_diagnostic.RS0041.severity = warning +dotnet_diagnostic.IDE0065.severity = warning csharp_using_directive_placement = outside_namespace diff --git a/CSharpier.sln.DotSettings b/CSharpier.sln.DotSettings index 708b98810..176f4143d 100644 --- a/CSharpier.sln.DotSettings +++ b/CSharpier.sln.DotSettings @@ -1,4 +1,5 @@  + False True True True diff --git a/Src/CSharpier.Benchmarks/Program.cs b/Src/CSharpier.Benchmarks/Program.cs index 08bab192a..33c594fe6 100644 --- a/Src/CSharpier.Benchmarks/Program.cs +++ b/Src/CSharpier.Benchmarks/Program.cs @@ -2,11 +2,10 @@ using System.Threading; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; +using Microsoft.CodeAnalysis; namespace CSharpier.Benchmarks; -using Microsoft.CodeAnalysis; - [MemoryDiagnoser] public class Benchmarks { diff --git a/Src/CSharpier.Cli.Tests/CliTests.cs b/Src/CSharpier.Cli.Tests/CliTests.cs index 74d1d85e7..659e0ee03 100644 --- a/Src/CSharpier.Cli.Tests/CliTests.cs +++ b/Src/CSharpier.Cli.Tests/CliTests.cs @@ -1,13 +1,11 @@ -namespace CSharpier.Cli.Tests; - -using System.Collections.Generic; -using System.Linq; using System.Text; using CliWrap; using CliWrap.Buffered; using FluentAssertions; using NUnit.Framework; +namespace CSharpier.Cli.Tests; + // these tests are kind of nice as c# because they run in the same place. // except the one test that has issues with console input redirection // they used to be powershell, but doing the multiple file thing didn't work diff --git a/Src/CSharpier.Cli.Tests/EditorConfig/SectionTests.cs b/Src/CSharpier.Cli.Tests/EditorConfig/SectionTests.cs index 03b028f1b..5cf8729d1 100644 --- a/Src/CSharpier.Cli.Tests/EditorConfig/SectionTests.cs +++ b/Src/CSharpier.Cli.Tests/EditorConfig/SectionTests.cs @@ -1,10 +1,10 @@ -namespace CSharpier.Cli.Tests.EditorConfig; - using CSharpier.Cli.EditorConfig; using FluentAssertions; using IniParser.Model; using NUnit.Framework; +namespace CSharpier.Cli.Tests.EditorConfig; + [TestFixture] public class SectionTests { diff --git a/Src/CSharpier.Cli.Tests/ServerTests.cs b/Src/CSharpier.Cli.Tests/ServerTests.cs index 91ba2b642..f28ec240f 100644 --- a/Src/CSharpier.Cli.Tests/ServerTests.cs +++ b/Src/CSharpier.Cli.Tests/ServerTests.cs @@ -1,14 +1,13 @@ -namespace CSharpier.Cli.Tests; - using System.Diagnostics; using System.Net.Http.Json; -using System.Text; using CliWrap; using CliWrap.EventStream; using CSharpier.Cli.Server; using FluentAssertions; using NUnit.Framework; +namespace CSharpier.Cli.Tests; + [TestFixture] public class ServerTests { diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index e56eb66b8..143f35260 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -3,12 +3,11 @@ using System.Text; using CSharpier.Cli.Options; using CSharpier.Utilities; +using Microsoft.CodeAnalysis; using Microsoft.Extensions.Logging; namespace CSharpier.Cli; -using Microsoft.CodeAnalysis; - internal static class CommandLineFormatter { public static async Task Format( @@ -177,9 +176,9 @@ CancellationToken cancellationToken cancellationToken ); - var originalDirectoryOrFile = commandLineOptions.OriginalDirectoryOrFilePaths[ - x - ].Replace("\\", "/"); + var originalDirectoryOrFile = commandLineOptions + .OriginalDirectoryOrFilePaths[x] + .Replace("\\", "/"); var formattingCache = await FormattingCacheFactory.InitializeAsync( commandLineOptions, @@ -255,8 +254,12 @@ await FormatPhysicalFile( return 1; } - var tasks = fileSystem.Directory - .EnumerateFiles(directoryOrFilePath, "*.*", SearchOption.AllDirectories) + var tasks = fileSystem + .Directory.EnumerateFiles( + directoryOrFilePath, + "*.*", + SearchOption.AllDirectories + ) .Select(o => { var normalizedPath = o.Replace("\\", "/"); diff --git a/Src/CSharpier.Cli/CommandLineOptions.cs b/Src/CSharpier.Cli/CommandLineOptions.cs index d12dfc1fd..3f72b9850 100644 --- a/Src/CSharpier.Cli/CommandLineOptions.cs +++ b/Src/CSharpier.Cli/CommandLineOptions.cs @@ -1,9 +1,8 @@ using System.CommandLine; +using Microsoft.Extensions.Logging; namespace CSharpier.Cli; -using Microsoft.Extensions.Logging; - internal class CommandLineOptions { public string[] DirectoryOrFilePaths { get; init; } = Array.Empty(); diff --git a/Src/CSharpier.Cli/EditorConfig/GlobMatcher.cs b/Src/CSharpier.Cli/EditorConfig/GlobMatcher.cs index 3332886e1..0b9b80112 100644 --- a/Src/CSharpier.Cli/EditorConfig/GlobMatcher.cs +++ b/Src/CSharpier.Cli/EditorConfig/GlobMatcher.cs @@ -5,9 +5,6 @@ * From https://github.com/SLaks/Minimatch */ -#nullable disable - -namespace CSharpier.Cli.EditorConfig; using System; using System.Collections.Generic; @@ -16,6 +13,10 @@ namespace CSharpier.Cli.EditorConfig; using System.Text; using System.Text.RegularExpressions; +#nullable disable + +namespace CSharpier.Cli.EditorConfig; + // ReSharper disable UnusedAutoPropertyAccessor.Global ///Contains options that control how Minimatch matches strings. diff --git a/Src/CSharpier.Cli/EditorConfig/Section.cs b/Src/CSharpier.Cli/EditorConfig/Section.cs index f50f312d2..51189760d 100644 --- a/Src/CSharpier.Cli/EditorConfig/Section.cs +++ b/Src/CSharpier.Cli/EditorConfig/Section.cs @@ -1,7 +1,7 @@ -namespace CSharpier.Cli.EditorConfig; - using IniParser.Model; +namespace CSharpier.Cli.EditorConfig; + internal class Section { private readonly GlobMatcher matcher; diff --git a/Src/CSharpier.Cli/FormattingCache.cs b/Src/CSharpier.Cli/FormattingCache.cs index ee86cd315..b6ca28ba9 100644 --- a/Src/CSharpier.Cli/FormattingCache.cs +++ b/Src/CSharpier.Cli/FormattingCache.cs @@ -3,12 +3,11 @@ using System.IO.Hashing; using System.Text; using System.Text.Json; +using CSharpier.Cli.Options; using CSharpier.Utilities; namespace CSharpier.Cli; -using CSharpier.Cli.Options; - internal interface IFormattingCache { Task ResolveAsync(CancellationToken cancellationToken); diff --git a/Src/CSharpier.Cli/Options/CaseInsensitiveEnumConverter.cs b/Src/CSharpier.Cli/Options/CaseInsensitiveEnumConverter.cs index 2968d3ab4..c5820c85d 100644 --- a/Src/CSharpier.Cli/Options/CaseInsensitiveEnumConverter.cs +++ b/Src/CSharpier.Cli/Options/CaseInsensitiveEnumConverter.cs @@ -1,8 +1,8 @@ -namespace CSharpier.Cli.Options; - using System.Text.Json; using System.Text.Json.Serialization; +namespace CSharpier.Cli.Options; + internal class CaseInsensitiveEnumConverter : JsonConverter where TEnum : struct { diff --git a/Src/CSharpier.Cli/Options/ConfigFileParser.cs b/Src/CSharpier.Cli/Options/ConfigFileParser.cs index 5591d2f4a..954fdc31e 100644 --- a/Src/CSharpier.Cli/Options/ConfigFileParser.cs +++ b/Src/CSharpier.Cli/Options/ConfigFileParser.cs @@ -1,11 +1,11 @@ -namespace CSharpier.Cli.Options; - using System.IO.Abstractions; using System.Text.Json; using Microsoft.Extensions.Logging; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; +namespace CSharpier.Cli.Options; + internal static class ConfigFileParser { private static readonly string[] validExtensions = { ".csharpierrc", ".json", ".yml", ".yaml" }; diff --git a/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs b/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs index eeaaa72ac..c0c743a55 100644 --- a/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs +++ b/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs @@ -1,8 +1,8 @@ -namespace CSharpier.Cli.Options; - using System.Text.Json.Serialization; using CSharpier.Cli.EditorConfig; +namespace CSharpier.Cli.Options; + internal class ConfigurationFileOptions { public int PrintWidth { get; init; } = 100; diff --git a/Src/CSharpier.Cli/Options/OptionsProvider.cs b/Src/CSharpier.Cli/Options/OptionsProvider.cs index 2497b0be2..00728a368 100644 --- a/Src/CSharpier.Cli/Options/OptionsProvider.cs +++ b/Src/CSharpier.Cli/Options/OptionsProvider.cs @@ -1,10 +1,10 @@ -namespace CSharpier.Cli.Options; - using System.IO.Abstractions; using System.Text.Json; using CSharpier.Cli.EditorConfig; using Microsoft.Extensions.Logging; +namespace CSharpier.Cli.Options; + internal class OptionsProvider { private readonly IList editorConfigs; diff --git a/Src/CSharpier.Cli/PipeMultipleFilesFormatter.cs b/Src/CSharpier.Cli/PipeMultipleFilesFormatter.cs index 861455f5d..f20df6b91 100644 --- a/Src/CSharpier.Cli/PipeMultipleFilesFormatter.cs +++ b/Src/CSharpier.Cli/PipeMultipleFilesFormatter.cs @@ -1,9 +1,9 @@ -namespace CSharpier.Cli; - using System.IO.Abstractions; using System.Text; using Microsoft.Extensions.Logging; +namespace CSharpier.Cli; + internal static class PipeMultipleFilesFormatter { public static async Task StartServer( diff --git a/Src/CSharpier.Cli/Program.cs b/Src/CSharpier.Cli/Program.cs index be5ddf5fe..b26db8d4f 100644 --- a/Src/CSharpier.Cli/Program.cs +++ b/Src/CSharpier.Cli/Program.cs @@ -2,12 +2,11 @@ using System.CommandLine.Invocation; using System.IO.Abstractions; using System.Text; +using CSharpier.Cli.Server; using Microsoft.Extensions.Logging; namespace CSharpier.Cli; -using CSharpier.Cli.Server; - internal class Program { public static async Task Main(string[] args) diff --git a/Src/CSharpier.Cli/Server/CSharpierServiceImplementation.cs b/Src/CSharpier.Cli/Server/CSharpierServiceImplementation.cs index 11771c437..35b17640e 100644 --- a/Src/CSharpier.Cli/Server/CSharpierServiceImplementation.cs +++ b/Src/CSharpier.Cli/Server/CSharpierServiceImplementation.cs @@ -1,9 +1,9 @@ -namespace CSharpier.Cli.Server; - using System.IO.Abstractions; using CSharpier.Cli.Options; using Microsoft.Extensions.Logging; +namespace CSharpier.Cli.Server; + internal class CSharpierServiceImplementation(string? configPath, ILogger logger) { private readonly IFileSystem fileSystem = new FileSystem(); diff --git a/Src/CSharpier.Cli/Server/FormatFileResult.cs b/Src/CSharpier.Cli/Server/FormatFileResult.cs index cffdafe7d..bf66113d1 100644 --- a/Src/CSharpier.Cli/Server/FormatFileResult.cs +++ b/Src/CSharpier.Cli/Server/FormatFileResult.cs @@ -1,7 +1,7 @@ -namespace CSharpier.Cli.Server; - using System.Text.Json.Serialization; +namespace CSharpier.Cli.Server; + public class FormatFileResult(Status status) { public string? formattedFile { get; set; } diff --git a/Src/CSharpier.Cli/Server/ServerFormatter.cs b/Src/CSharpier.Cli/Server/ServerFormatter.cs index 555ee3806..e3ff8ae0b 100644 --- a/Src/CSharpier.Cli/Server/ServerFormatter.cs +++ b/Src/CSharpier.Cli/Server/ServerFormatter.cs @@ -1,5 +1,3 @@ -namespace CSharpier.Cli.Server; - using System.Net; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -9,6 +7,8 @@ namespace CSharpier.Cli.Server; using Microsoft.Extensions.Logging; using NReco.Logging.File; +namespace CSharpier.Cli.Server; + internal static class ServerFormatter { public static async Task StartServer( diff --git a/Src/CSharpier.FakeGenerators/SyntaxNodeComparerGenerator.cs b/Src/CSharpier.FakeGenerators/SyntaxNodeComparerGenerator.cs index 1ec251322..55cc46291 100644 --- a/Src/CSharpier.FakeGenerators/SyntaxNodeComparerGenerator.cs +++ b/Src/CSharpier.FakeGenerators/SyntaxNodeComparerGenerator.cs @@ -1,11 +1,10 @@ using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; namespace CSharpier.FakeGenerators; -using Microsoft.CodeAnalysis.CSharp.Syntax; - public class SyntaxNodeComparerGenerator { // this would probably be easier to understand as a scriban template but is a lot of effort diff --git a/Src/CSharpier.Generators/NodePrinterGenerator.cs b/Src/CSharpier.Generators/NodePrinterGenerator.cs index 480cfcf2a..49c234f21 100644 --- a/Src/CSharpier.Generators/NodePrinterGenerator.cs +++ b/Src/CSharpier.Generators/NodePrinterGenerator.cs @@ -1,10 +1,10 @@ -namespace CSharpier.Generators; - -using System.Text; +using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; using Scriban; +namespace CSharpier.Generators; + // the magic command to get source generators to actually regenerate when they get stuck with old code // dotnet build-server shutdown [Generator] diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 2dc83ee6b..11058c965 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -4,9 +4,6 @@ namespace CSharpier.Playground.Controllers; -using CSharpier.Formatters.Xml; -using CSharpier.Utilities; - public class FormatResult { public required string Code { get; set; } diff --git a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs index d60a51927..b0aa77f51 100644 --- a/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs +++ b/Src/CSharpier.Tests.Generators/FormattingTestsGenerator.cs @@ -1,13 +1,12 @@ using System.IO; using System.Linq; -using Microsoft.CodeAnalysis; - -namespace CSharpier.Tests.Generators; - using System.Text; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; using Scriban; +namespace CSharpier.Tests.Generators; + // the magic command to get source generators to actually regenerate when they get stuck with old code // dotnet build-server shutdown [Generator] diff --git a/Src/CSharpier.Tests/CSharpierIgnoreTests.cs b/Src/CSharpier.Tests/CSharpierIgnoreTests.cs index 264d3e1d2..6f2a12399 100644 --- a/Src/CSharpier.Tests/CSharpierIgnoreTests.cs +++ b/Src/CSharpier.Tests/CSharpierIgnoreTests.cs @@ -1,10 +1,9 @@ +using CSharpier.SyntaxPrinter; +using FluentAssertions; using NUnit.Framework; namespace CSharpier.Tests; -using CSharpier.SyntaxPrinter; -using FluentAssertions; - [TestFixture] public class CSharpierIgnoreTests { diff --git a/Src/CSharpier.Tests/Cli/Options/ConfigFileParserTests.cs b/Src/CSharpier.Tests/Cli/Options/ConfigFileParserTests.cs index 8dbf3cd1f..d206bb708 100644 --- a/Src/CSharpier.Tests/Cli/Options/ConfigFileParserTests.cs +++ b/Src/CSharpier.Tests/Cli/Options/ConfigFileParserTests.cs @@ -1,9 +1,9 @@ -namespace CSharpier.Tests.Cli.Options; - using CSharpier.Cli.Options; using FluentAssertions; using NUnit.Framework; +namespace CSharpier.Tests.Cli.Options; + [TestFixture] public class ConfigFileParserTests { diff --git a/Src/CSharpier.Tests/CommandLineFormatterTests.cs b/Src/CSharpier.Tests/CommandLineFormatterTests.cs index 94c5748dc..160867e8f 100644 --- a/Src/CSharpier.Tests/CommandLineFormatterTests.cs +++ b/Src/CSharpier.Tests/CommandLineFormatterTests.cs @@ -2,12 +2,11 @@ using System.Text; using CSharpier.Cli; using FluentAssertions; +using Microsoft.Extensions.Logging; using NUnit.Framework; namespace CSharpier.Tests; -using Microsoft.Extensions.Logging; - [TestFixture] [Parallelizable(ParallelScope.All)] public class CommandLineFormatterTests diff --git a/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs b/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs index ffff8d9ad..02cf29399 100644 --- a/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs +++ b/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs @@ -1,9 +1,9 @@ -namespace CSharpier.Tests.Formatters.CSharp; - using CSharpier.Formatters.CSharp; using FluentAssertions; using NUnit.Framework; +namespace CSharpier.Tests.Formatters.CSharp; + [TestFixture] public class PreprocessorSymbolsTests { diff --git a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs index 15d6c6241..32b7686c5 100644 --- a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs +++ b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs @@ -2,14 +2,13 @@ using System.Text; using CSharpier.Cli; using CSharpier.SyntaxPrinter; +using CSharpier.Utilities; using DiffEngine; using FluentAssertions; +using Microsoft.CodeAnalysis; namespace CSharpier.Tests.FormattingTests; -using CSharpier.Utilities; -using Microsoft.CodeAnalysis; - public class BaseTest { private readonly DirectoryInfo rootDirectory = DirectoryFinder.FindParent("CSharpier.Tests"); diff --git a/Src/CSharpier.Tests/FormattingTests/LineEndingEdgeCase.cs b/Src/CSharpier.Tests/FormattingTests/LineEndingEdgeCase.cs index 74596cb11..02cd37407 100644 --- a/Src/CSharpier.Tests/FormattingTests/LineEndingEdgeCase.cs +++ b/Src/CSharpier.Tests/FormattingTests/LineEndingEdgeCase.cs @@ -1,9 +1,9 @@ -namespace CSharpier.Tests.FormattingTests; - using System.Text; using FluentAssertions; using NUnit.Framework; +namespace CSharpier.Tests.FormattingTests; + [TestFixture] internal class LineEndingEdgeCase { diff --git a/Src/CSharpier.Tests/OptionsProviderTests.cs b/Src/CSharpier.Tests/OptionsProviderTests.cs index be40d21ba..acff098aa 100644 --- a/Src/CSharpier.Tests/OptionsProviderTests.cs +++ b/Src/CSharpier.Tests/OptionsProviderTests.cs @@ -1,11 +1,11 @@ -namespace CSharpier.Tests; - using System.IO.Abstractions.TestingHelpers; using CSharpier.Cli.Options; using FluentAssertions; using Microsoft.Extensions.Logging.Abstractions; using NUnit.Framework; +namespace CSharpier.Tests; + [TestFixture] [Parallelizable(ParallelScope.Fixtures)] public class OptionsProviderTests diff --git a/Src/CSharpier.Tests/PrinterOptionsTests.cs b/Src/CSharpier.Tests/PrinterOptionsTests.cs index 6a3ba9f2a..080e071e9 100644 --- a/Src/CSharpier.Tests/PrinterOptionsTests.cs +++ b/Src/CSharpier.Tests/PrinterOptionsTests.cs @@ -1,8 +1,8 @@ -namespace CSharpier.Tests; - using FluentAssertions; using NUnit.Framework; +namespace CSharpier.Tests; + [TestFixture] [Parallelizable(ParallelScope.All)] internal class PrinterOptionsTests diff --git a/Src/CSharpier.Tests/Samples/Samples.cs b/Src/CSharpier.Tests/Samples/Samples.cs index 2c18f2636..5392747f3 100644 --- a/Src/CSharpier.Tests/Samples/Samples.cs +++ b/Src/CSharpier.Tests/Samples/Samples.cs @@ -1,11 +1,10 @@ using System.Text; using FluentAssertions; +using Microsoft.CodeAnalysis; using NUnit.Framework; namespace CSharpier.Tests.Samples; -using Microsoft.CodeAnalysis; - [TestFixture] [Parallelizable(ParallelScope.All)] public class Samples diff --git a/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs b/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs index b4ae576e2..aa9f457f0 100644 --- a/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs +++ b/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs @@ -1,10 +1,9 @@ using FluentAssertions; +using Microsoft.CodeAnalysis; using NUnit.Framework; namespace CSharpier.Tests; -using Microsoft.CodeAnalysis; - [TestFixture] [Parallelizable(ParallelScope.All)] public class SyntaxNodeComparerTests diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index e58186a1e..d5c09cb37 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -1,11 +1,10 @@ using System.Text; -using CSharpier.SyntaxPrinter; using System.Text.Json; +using CSharpier.Formatters.Xml; +using CSharpier.SyntaxPrinter; namespace CSharpier; -using CSharpier.Formatters.Xml; - public static class CodeFormatter { public static CodeFormatterResult Format(string code, CodeFormatterOptions? options = null) diff --git a/Src/CSharpier/Formatters/CSharp/BooleanExpressionParser.cs b/Src/CSharpier/Formatters/CSharp/BooleanExpressionParser.cs index 8c8f62f28..ff7f112ea 100644 --- a/Src/CSharpier/Formatters/CSharp/BooleanExpressionParser.cs +++ b/Src/CSharpier/Formatters/CSharp/BooleanExpressionParser.cs @@ -1,8 +1,8 @@ -namespace CSharpier.Formatters.CSharp; - using System.Collections.Concurrent; using System.Linq.Expressions; +namespace CSharpier.Formatters.CSharp; + internal abstract class BooleanExpressionParser { private static readonly ConcurrentDictionary parsedExpressions = diff --git a/Src/CSharpier/Formatters/Xml/XmlFormatter.cs b/Src/CSharpier/Formatters/Xml/XmlFormatter.cs index 84a43d58a..9567c72cd 100644 --- a/Src/CSharpier/Formatters/Xml/XmlFormatter.cs +++ b/Src/CSharpier/Formatters/Xml/XmlFormatter.cs @@ -1,9 +1,9 @@ -namespace CSharpier.Formatters.Xml; - using System.Text.Json; using System.Xml; using CSharpier.Formatters.Xml.XmlNodePrinters; +namespace CSharpier.Formatters.Xml; + internal static class XmlFormatter { internal static CodeFormatterResult Format(string xml, PrinterOptions printerOptions) @@ -19,7 +19,7 @@ internal static CodeFormatterResult Format(string xml, PrinterOptions printerOpt { Code = formattedXml, DocTree = printerOptions.IncludeDocTree ? DocSerializer.Serialize(doc) : string.Empty, - AST = printerOptions.IncludeAST ? JsonSerializer.Serialize(xmlDocument) : string.Empty + AST = printerOptions.IncludeAST ? JsonSerializer.Serialize(xmlDocument) : string.Empty, }; } } diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs index d3dccbb94..2b3556e03 100644 --- a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs @@ -1,7 +1,7 @@ -namespace CSharpier.Formatters.Xml.XmlNodePrinters; - using System.Xml; +namespace CSharpier.Formatters.Xml.XmlNodePrinters; + internal static class Element { internal static Doc Print(XmlElement element) diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs index dd9b357d0..1b96dc964 100644 --- a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Node.cs @@ -1,7 +1,7 @@ -namespace CSharpier.Formatters.Xml.XmlNodePrinters; - using System.Xml; +namespace CSharpier.Formatters.Xml.XmlNodePrinters; + internal static class Node { internal static Doc Print(XmlNode xmlNode) diff --git a/Src/CSharpier/SyntaxNodeJsonWriter.cs b/Src/CSharpier/SyntaxNodeJsonWriter.cs index 38874ea68..ec0b15bd8 100644 --- a/Src/CSharpier/SyntaxNodeJsonWriter.cs +++ b/Src/CSharpier/SyntaxNodeJsonWriter.cs @@ -1,7 +1,7 @@ -namespace CSharpier; - using System.Text.Json; +namespace CSharpier; + internal static partial class SyntaxNodeJsonWriter { private static string? WriteBoolean(string name, bool value) diff --git a/Src/CSharpier/SyntaxPrinter/CSharpierIgnore.cs b/Src/CSharpier/SyntaxPrinter/CSharpierIgnore.cs index fb4e750bd..523c54e98 100644 --- a/Src/CSharpier/SyntaxPrinter/CSharpierIgnore.cs +++ b/Src/CSharpier/SyntaxPrinter/CSharpierIgnore.cs @@ -1,8 +1,8 @@ -namespace CSharpier.SyntaxPrinter; - using System.Text; using System.Text.RegularExpressions; +namespace CSharpier.SyntaxPrinter; + internal static class CSharpierIgnore { private static readonly Regex IgnoreRegex = new("^// csharpier-ignore($| -)"); diff --git a/Src/CSharpier/SyntaxPrinter/MembersWithForcedLines.cs b/Src/CSharpier/SyntaxPrinter/MembersWithForcedLines.cs index 6e858fb89..885d4f72b 100644 --- a/Src/CSharpier/SyntaxPrinter/MembersWithForcedLines.cs +++ b/Src/CSharpier/SyntaxPrinter/MembersWithForcedLines.cs @@ -1,9 +1,8 @@ using System.Collections.Immutable; +using System.Text; namespace CSharpier.SyntaxPrinter; -using System.Text; - internal static class MembersWithForcedLines { public static List Print( diff --git a/Src/CSharpier/SyntaxPrinter/SeparatedSyntaxList.cs b/Src/CSharpier/SyntaxPrinter/SeparatedSyntaxList.cs index 45e730f55..270a66e60 100644 --- a/Src/CSharpier/SyntaxPrinter/SeparatedSyntaxList.cs +++ b/Src/CSharpier/SyntaxPrinter/SeparatedSyntaxList.cs @@ -1,7 +1,7 @@ -namespace CSharpier.SyntaxPrinter; - using System.Text; +namespace CSharpier.SyntaxPrinter; + internal static class SeparatedSyntaxList { public static Doc Print( diff --git a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BaseMethodDeclaration.cs b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BaseMethodDeclaration.cs index 69d36fa04..bf7fe4746 100644 --- a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BaseMethodDeclaration.cs +++ b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BaseMethodDeclaration.cs @@ -1,7 +1,7 @@ -namespace CSharpier.SyntaxPrinter.SyntaxNodePrinters; - using System.Text.RegularExpressions; +namespace CSharpier.SyntaxPrinter.SyntaxNodePrinters; + internal static class BaseMethodDeclaration { public static Doc Print(CSharpSyntaxNode node, FormattingContext context) diff --git a/Src/CSharpier/SyntaxPrinter/Token.cs b/Src/CSharpier/SyntaxPrinter/Token.cs index f7291e2c7..26d646772 100644 --- a/Src/CSharpier/SyntaxPrinter/Token.cs +++ b/Src/CSharpier/SyntaxPrinter/Token.cs @@ -1,7 +1,7 @@ -namespace CSharpier.SyntaxPrinter; - using System.Text.RegularExpressions; +namespace CSharpier.SyntaxPrinter; + internal static class Token { public static Doc PrintWithoutLeadingTrivia(SyntaxToken syntaxToken, FormattingContext context) diff --git a/Src/CSharpier/Utilities/StackExtensions.cs b/Src/CSharpier/Utilities/StackExtensions.cs index 78ff09c64..a465419cd 100644 --- a/Src/CSharpier/Utilities/StackExtensions.cs +++ b/Src/CSharpier/Utilities/StackExtensions.cs @@ -1,7 +1,7 @@ -namespace CSharpier.Utilities; - using System.Diagnostics.CodeAnalysis; +namespace CSharpier.Utilities; + internal static class StackExtensions { #if NETSTANDARD2_0 diff --git a/Src/SyntaxFinder/SyntaxFinderWalker.cs b/Src/SyntaxFinder/SyntaxFinderWalker.cs index 79bd461a1..849b375e0 100644 --- a/Src/SyntaxFinder/SyntaxFinderWalker.cs +++ b/Src/SyntaxFinder/SyntaxFinderWalker.cs @@ -1,8 +1,8 @@ -namespace SyntaxFinder; - using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; +namespace SyntaxFinder; + public abstract class SyntaxFinderWalker(string file) : CSharpSyntaxWalker { private bool wroteFile; diff --git a/Src/SyntaxFinder/SyntaxTriviaExtensions.cs b/Src/SyntaxFinder/SyntaxTriviaExtensions.cs index 3d67990b0..79d545180 100644 --- a/Src/SyntaxFinder/SyntaxTriviaExtensions.cs +++ b/Src/SyntaxFinder/SyntaxTriviaExtensions.cs @@ -1,8 +1,8 @@ -namespace SyntaxFinder; - using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; +namespace SyntaxFinder; + public static class SyntaxTriviaExtensions { public static bool IsComment(this SyntaxTrivia syntaxTrivia) diff --git a/Src/SyntaxFinder/Walkers/ExampleWalker.cs b/Src/SyntaxFinder/Walkers/ExampleWalker.cs index 43424381f..451c45aa9 100644 --- a/Src/SyntaxFinder/Walkers/ExampleWalker.cs +++ b/Src/SyntaxFinder/Walkers/ExampleWalker.cs @@ -1,10 +1,10 @@ -namespace SyntaxFinder.Walkers; - using System.Collections.Concurrent; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; +namespace SyntaxFinder.Walkers; + public class ExampleWalker(string file) : SyntaxFinderWalker(file) { public static readonly ConcurrentDictionary> MembersInType = new(); diff --git a/Src/SyntaxFinder/Walkers/ModifiersWalker.cs b/Src/SyntaxFinder/Walkers/ModifiersWalker.cs index 868184db4..a7ab5f0ba 100644 --- a/Src/SyntaxFinder/Walkers/ModifiersWalker.cs +++ b/Src/SyntaxFinder/Walkers/ModifiersWalker.cs @@ -1,7 +1,7 @@ -namespace SyntaxFinder.Walkers; - using Microsoft.CodeAnalysis.CSharp.Syntax; +namespace SyntaxFinder.Walkers; + public class ModifiersWalker : SyntaxFinderWalker { public ModifiersWalker(string file) diff --git a/Src/SyntaxFinder/Walkers/NestedConditionalExpressionsWalker.cs b/Src/SyntaxFinder/Walkers/NestedConditionalExpressionsWalker.cs index 13ccd77cc..6ed98bf15 100644 --- a/Src/SyntaxFinder/Walkers/NestedConditionalExpressionsWalker.cs +++ b/Src/SyntaxFinder/Walkers/NestedConditionalExpressionsWalker.cs @@ -1,10 +1,10 @@ -namespace SyntaxFinder.Walkers; - using System.Collections.Concurrent; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; +namespace SyntaxFinder.Walkers; + public class NestedConditionalExpressionsWalker(string file) : SyntaxFinderWalker(file) { public static readonly ConcurrentDictionary> MembersInType = new(); diff --git a/Src/SyntaxFinder/Walkers/ObjectInitializerWalker.cs b/Src/SyntaxFinder/Walkers/ObjectInitializerWalker.cs index 903540254..81194aac3 100644 --- a/Src/SyntaxFinder/Walkers/ObjectInitializerWalker.cs +++ b/Src/SyntaxFinder/Walkers/ObjectInitializerWalker.cs @@ -1,8 +1,8 @@ -namespace SyntaxFinder.Walkers; - using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; +namespace SyntaxFinder.Walkers; + public class ObjectInitializerWalker : CSharpSyntaxWalker { private static int total; diff --git a/Src/SyntaxFinder/Walkers/SpreadWalker.cs b/Src/SyntaxFinder/Walkers/SpreadWalker.cs index ba5ae061f..6f2c098b3 100644 --- a/Src/SyntaxFinder/Walkers/SpreadWalker.cs +++ b/Src/SyntaxFinder/Walkers/SpreadWalker.cs @@ -1,8 +1,8 @@ -namespace SyntaxFinder.Walkers; - using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; +namespace SyntaxFinder.Walkers; + public class SpreadWalker : CSharpSyntaxWalker { private static int total; From a8ffa772c53ecd80d76335d3655db7d0290d1314 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Sun, 15 Sep 2024 20:01:53 -0500 Subject: [PATCH 19/21] Getting things working with the changes that were in main --- Src/CSharpier.Cli.Tests/ServerTests.cs | 3 +- Src/CSharpier.Cli/CommandLineFormatter.cs | 17 +++------ .../EditorConfig/EditorConfigSections.cs | 10 +++-- .../Options/ConfigurationFileOptions.cs | 15 +++++++- Src/CSharpier.Cli/Options/OptionsProvider.cs | 19 +++++++++- .../ClientApp/src/AppContext.ts | 8 ++-- .../ClientApp/src/Controls.tsx | 8 ++-- .../Controllers/FormatController.cs | 17 ++++----- .../CSharp/PreprocessorSymbolsTests.cs | 2 - .../FormattingTests/BaseTest.cs | 18 +++++++-- Src/CSharpier/CodeFormatter.cs | 37 ++++++++++--------- Src/CSharpier/PrinterOptions.cs | 10 ++++- 12 files changed, 104 insertions(+), 60 deletions(-) diff --git a/Src/CSharpier.Cli.Tests/ServerTests.cs b/Src/CSharpier.Cli.Tests/ServerTests.cs index f28ec240f..56739fc62 100644 --- a/Src/CSharpier.Cli.Tests/ServerTests.cs +++ b/Src/CSharpier.Cli.Tests/ServerTests.cs @@ -78,7 +78,8 @@ public void RunTwo() async Task NewFunction() { - var command = Cli.Wrap("dotnet") + var command = CliWrap + .Cli.Wrap("dotnet") .WithArguments(path + " --server") .WithValidation(CommandResultValidation.None); diff --git a/Src/CSharpier.Cli/CommandLineFormatter.cs b/Src/CSharpier.Cli/CommandLineFormatter.cs index 143f35260..3a0046757 100644 --- a/Src/CSharpier.Cli/CommandLineFormatter.cs +++ b/Src/CSharpier.Cli/CommandLineFormatter.cs @@ -176,9 +176,9 @@ CancellationToken cancellationToken cancellationToken ); - var originalDirectoryOrFile = commandLineOptions - .OriginalDirectoryOrFilePaths[x] - .Replace("\\", "/"); + var originalDirectoryOrFile = commandLineOptions.OriginalDirectoryOrFilePaths[ + x + ].Replace("\\", "/"); var formattingCache = await FormattingCacheFactory.InitializeAsync( commandLineOptions, @@ -254,12 +254,8 @@ await FormatPhysicalFile( return 1; } - var tasks = fileSystem - .Directory.EnumerateFiles( - directoryOrFilePath, - "*.*", - SearchOption.AllDirectories - ) + var tasks = fileSystem.Directory + .EnumerateFiles(directoryOrFilePath, "*.*", SearchOption.AllDirectories) .Select(o => { var normalizedPath = o.Replace("\\", "/"); @@ -385,7 +381,6 @@ CancellationToken cancellationToken { codeFormattingResult = await CodeFormatter.FormatAsync( fileToFormatInfo.FileContents, - Path.GetExtension(fileToFormatInfo.Path), printerOptions, cancellationToken ); @@ -435,7 +430,7 @@ CancellationToken cancellationToken // TODO xml what about allowing lines between elements? if (!commandLineOptions.Fast && fileToFormatInfo.Path.EndsWithIgnoreCase(".cs")) { - // TODO the thing above should do this if we are using the csharp formatter + // TODO xml the thing above should do this if we are using the csharp formatter var sourceCodeKind = Path.GetExtension(fileToFormatInfo.Path).EqualsIgnoreCase(".csx") ? SourceCodeKind.Script : SourceCodeKind.Regular; diff --git a/Src/CSharpier.Cli/EditorConfig/EditorConfigSections.cs b/Src/CSharpier.Cli/EditorConfig/EditorConfigSections.cs index ddb82d51d..88573fad7 100644 --- a/Src/CSharpier.Cli/EditorConfig/EditorConfigSections.cs +++ b/Src/CSharpier.Cli/EditorConfig/EditorConfigSections.cs @@ -16,14 +16,18 @@ internal class EditorConfigSections var formatter = resolvedConfiguration.Formatter - ?? (filePath.EndsWith(".cs") || filePath.EndsWith(".csx") ? "csharp" : null); + ?? ( + filePath.EndsWith(".cs") ? "CSharp" + : filePath.EndsWith(".csx") ? "CSharpScript" + : null + ); - if (formatter == null) + if (!Enum.TryParse(formatter, ignoreCase: true, out var parsedFormatter)) { return null; } - var printerOptions = new PrinterOptions { Formatter = formatter }; + var printerOptions = new PrinterOptions { Formatter = parsedFormatter }; if (resolvedConfiguration.MaxLineLength is { } maxLineLength) { diff --git a/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs b/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs index c0c743a55..6fe6d27ba 100644 --- a/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs +++ b/Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs @@ -20,13 +20,24 @@ internal class ConfigurationFileOptions var matchingOverride = this.Overrides.LastOrDefault(o => o.IsMatch(filePath)); if (matchingOverride is not null) { + if ( + !Enum.TryParse( + matchingOverride.Formatter, + ignoreCase: true, + out var parsedFormatter + ) + ) + { + return null; + } + return new PrinterOptions { IndentSize = matchingOverride.TabWidth, UseTabs = matchingOverride.UseTabs, Width = matchingOverride.PrintWidth, EndOfLine = matchingOverride.EndOfLine, - Formatter = matchingOverride.Formatter, + Formatter = parsedFormatter, }; } @@ -38,7 +49,7 @@ internal class ConfigurationFileOptions UseTabs = this.UseTabs, Width = this.PrintWidth, EndOfLine = this.EndOfLine, - Formatter = "csharp", + Formatter = filePath.EndsWith(".cs") ? Formatter.CSharp : Formatter.CSharpScript, }; } diff --git a/Src/CSharpier.Cli/Options/OptionsProvider.cs b/Src/CSharpier.Cli/Options/OptionsProvider.cs index 00728a368..8b26a8f17 100644 --- a/Src/CSharpier.Cli/Options/OptionsProvider.cs +++ b/Src/CSharpier.Cli/Options/OptionsProvider.cs @@ -110,9 +110,24 @@ public static async Task Create( return resolvedEditorConfig.ConvertToPrinterOptions(filePath); } - if (filePath.EndsWith(".cs") || filePath.EndsWith(".csx")) + if (filePath.EndsWith(".cs")) { - return new PrinterOptions { Formatter = "csharp" }; + return new PrinterOptions { Formatter = Formatter.CSharp }; + } + + if (filePath.EndsWith(".csx")) + { + return new PrinterOptions { Formatter = Formatter.CSharpScript }; + } + + if ( + filePath.EndsWith(".csproj") + || filePath.EndsWith(".props") + || filePath.EndsWith(".targets") + || filePath.EndsWith(".xml") + ) + { + return new PrinterOptions { Formatter = Formatter.XML }; } return null; diff --git a/Src/CSharpier.Playground/ClientApp/src/AppContext.ts b/Src/CSharpier.Playground/ClientApp/src/AppContext.ts index ee798ef63..e8f7cb839 100644 --- a/Src/CSharpier.Playground/ClientApp/src/AppContext.ts +++ b/Src/CSharpier.Playground/ClientApp/src/AppContext.ts @@ -33,7 +33,7 @@ class AppState { printWidth = getNumber("printWidth", 100); indentSize = getNumber("indentSize", 4); useTabs = getBoolean("useTabs", false); - parser = getString("parser", "CSharp"); + formatter = getString("formatter", "CSharp"); showAst = getBoolean("showAst", false); showDoc = getBoolean("showDoc", false); hideNull = getBoolean("hideNull", false); @@ -48,9 +48,9 @@ class AppState { makeAutoObservable(this); } - setParser = (value: string) => { - window.sessionStorage.setItem("parser", value); - this.parser = value; + setFormatter = (value: string) => { + window.sessionStorage.setItem("formatter", value); + this.formatter = value; }; setIndentSize = (value: number) => { diff --git a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx index 8321d1dba..3eec52dda 100644 --- a/Src/CSharpier.Playground/ClientApp/src/Controls.tsx +++ b/Src/CSharpier.Playground/ClientApp/src/Controls.tsx @@ -3,8 +3,6 @@ import "./Controls.css"; import { observer } from "mobx-react-lite"; import { useAppContext } from "./AppContext"; -// TODO review this, looks like I was changing it to use mobx -// https://github.com/belav/csharpier/pull/858/files#diff-fe7eb3d9ce08803cc37869645e835dda3ecb5cf2e87991e6b73a7a246091f37b export const Controls = observer(() => { const { printWidth, @@ -13,8 +11,8 @@ export const Controls = observer(() => { setIndentSize, useTabs, setUseTabs, - parser, - setParser, + formatter, + setFormatter, showDoc, setShowDoc, hideNull, @@ -44,7 +42,7 @@ export const Controls = observer(() => { Use Tabs - setFormatter(e.target.value)}> diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index 11058c965..57d00decc 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -36,7 +36,7 @@ public class PostModel public int PrintWidth { get; set; } public int IndentSize { get; set; } public bool UseTabs { get; set; } - public string Parser { get; set; } = string.Empty; + public string Formatter { get; set; } = string.Empty; } [HttpPost] @@ -45,15 +45,13 @@ public async Task Post( CancellationToken cancellationToken ) { - // TODO - var sourceCodeKind = false // model.FileExtension.EqualsIgnoreCase(".csx") - ? SourceCodeKind.Script - : SourceCodeKind.Regular; + if (!Enum.TryParse(model.Formatter, ignoreCase: true, out var parsedFormatter)) + { + throw new Exception("Invalid formatter " + model.Formatter); + } var result = await CodeFormatter.FormatAsync( model.Code, - // TODO - ".cs", new PrinterOptions { IncludeAST = true, @@ -61,17 +59,18 @@ CancellationToken cancellationToken Width = model.PrintWidth, IndentSize = model.IndentSize, UseTabs = model.UseTabs, + Formatter = parsedFormatter, }, cancellationToken ); - // TODO what about xml? + // TODO xml what about this? var comparer = new SyntaxNodeComparer( model.Code, result.Code, result.ReorderedModifiers, result.ReorderedUsingsWithDisabledText, - sourceCodeKind, + parsedFormatter is Formatter.CSharp ? SourceCodeKind.Regular : SourceCodeKind.Script, cancellationToken ); diff --git a/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs b/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs index 02cf29399..65ad6acee 100644 --- a/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs +++ b/Src/CSharpier.Tests/Formatters/CSharp/PreprocessorSymbolsTests.cs @@ -199,8 +199,6 @@ public void GetSets_Should_Handle_Nested_If() #endif #endif ", - // TODO because the second is a subset of the first, we don't actually need it - // but it's more work to figure that out for now "ONE,TWO", "ONE" ); diff --git a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs index 32b7686c5..72a8c780e 100644 --- a/Src/CSharpier.Tests/FormattingTests/BaseTest.cs +++ b/Src/CSharpier.Tests/FormattingTests/BaseTest.cs @@ -32,11 +32,22 @@ protected async Task RunTest( CancellationToken.None ); + var formatter = fileExtensionWithoutDot switch + { + "cs" => Formatter.CSharp, + "csx" => Formatter.CSharpScript, + "xml" => Formatter.XML, + _ => Formatter.Unknown, + }; + var result = await CodeFormatter.FormatAsync( fileReaderResult.FileContents, - "." + fileExtensionWithoutDot, - new PrinterOptions { Width = PrinterOptions.WidthUsedByTests, UseTabs = useTabs }, - // TODO fileExtensionWithoutDot.EqualsIgnoreCase("csx") ? SourceCodeKind.Script : SourceCodeKind.Regular, + new PrinterOptions + { + Width = PrinterOptions.WidthUsedByTests, + UseTabs = useTabs, + Formatter = formatter, + }, CancellationToken.None ); @@ -62,6 +73,7 @@ protected async Task RunTest( normalizedCode = normalizedCode.Replace("\r\n", "\n"); } + // TODO xml what about this? var comparer = new SyntaxNodeComparer( expectedCode, normalizedCode, diff --git a/Src/CSharpier/CodeFormatter.cs b/Src/CSharpier/CodeFormatter.cs index d5c09cb37..ef0645c0c 100644 --- a/Src/CSharpier/CodeFormatter.cs +++ b/Src/CSharpier/CodeFormatter.cs @@ -29,7 +29,7 @@ public static Task FormatAsync( IndentSize = options.IndentSize, EndOfLine = options.EndOfLine, IncludeGenerated = options.IncludeGenerated, - Formatter = "csharp", + Formatter = Formatter.CSharp, }, cancellationToken ); @@ -59,7 +59,7 @@ public static Task FormatAsync( UseTabs = options.IndentStyle == IndentStyle.Tabs, IndentSize = options.IndentSize, EndOfLine = options.EndOfLine, - Formatter = "csharp", + Formatter = Formatter.CSharp, }, SourceCodeKind.Regular, cancellationToken @@ -68,25 +68,28 @@ public static Task FormatAsync( internal static async Task FormatAsync( string fileContents, - string fileExtension, PrinterOptions options, CancellationToken cancellationToken ) { - var loweredExtension = fileExtension.ToLower(); - - if (loweredExtension is ".cs") - { - return await CSharpFormatter.FormatAsync(fileContents, options, cancellationToken); - } - - // TODO XML maybe make this opt in until it is better tested? - // TODO XML maybe don't include xml by default? - if (loweredExtension is ".csproj" or ".props" or ".targets" or ".xml") + return options.Formatter switch { - return XmlFormatter.Format(fileContents, options); - } - - return new CodeFormatterResult { FailureMessage = "Is an unsupported file type." }; + Formatter.CSharp + => await CSharpFormatter.FormatAsync( + fileContents, + options, + SourceCodeKind.Regular, + cancellationToken + ), + Formatter.CSharpScript + => await CSharpFormatter.FormatAsync( + fileContents, + options, + SourceCodeKind.Script, + cancellationToken + ), + Formatter.XML => XmlFormatter.Format(fileContents, options), + _ => new CodeFormatterResult { FailureMessage = "Is an unsupported file type." } + }; } } diff --git a/Src/CSharpier/PrinterOptions.cs b/Src/CSharpier/PrinterOptions.cs index 895176012..7cb4b4ae8 100644 --- a/Src/CSharpier/PrinterOptions.cs +++ b/Src/CSharpier/PrinterOptions.cs @@ -10,7 +10,7 @@ internal class PrinterOptions public EndOfLine EndOfLine { get; set; } = EndOfLine.Auto; public bool TrimInitialLines { get; init; } = true; public bool IncludeGenerated { get; set; } - public string Formatter { get; init; } = string.Empty; + public Formatter Formatter { get; init; } = Formatter.Unknown; public const int WidthUsedByTests = 100; @@ -34,3 +34,11 @@ internal static string GetLineEnding(string code, PrinterOptions printerOptions) return "\n"; } } + +internal enum Formatter +{ + Unknown, + CSharp, + CSharpScript, + XML, +} From 93676485583e3bd7ef3de244f38c9c6bea00f009 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 16 Sep 2024 21:10:17 -0500 Subject: [PATCH 20/21] starting to pull in all the logic from how prettier prints html --- .../ClientApp/src/AppContext.ts | 2 +- .../ClientApp/src/FormatCode.ts | 4 +- .../TestFiles/xml/Comments.test | 2 +- .../TestFiles/xml/Elements.test | 13 +- Src/CSharpier/DocPrinter/DocFitter.cs | 5 +- Src/CSharpier/DocTypes/Doc.cs | 11 + .../Formatters/Xml/XmlNodePrinters/Element.cs | 368 ++++++++++++++++-- .../Xml/XmlNodePrinters/ElementChildren.cs | 152 ++++++++ .../SyntaxPrinter/FormattingContext.cs | 1 + 9 files changed, 520 insertions(+), 38 deletions(-) create mode 100644 Src/CSharpier/Formatters/Xml/XmlNodePrinters/ElementChildren.cs diff --git a/Src/CSharpier.Playground/ClientApp/src/AppContext.ts b/Src/CSharpier.Playground/ClientApp/src/AppContext.ts index e8f7cb839..14ef684e1 100644 --- a/Src/CSharpier.Playground/ClientApp/src/AppContext.ts +++ b/Src/CSharpier.Playground/ClientApp/src/AppContext.ts @@ -118,7 +118,7 @@ class AppState { this.printWidth, this.indentSize, this.useTabs, - this.parser, + this.formatter, ); runInAction(() => { diff --git a/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts b/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts index cd81e11b5..ac1e23e30 100644 --- a/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts +++ b/Src/CSharpier.Playground/ClientApp/src/FormatCode.ts @@ -7,12 +7,12 @@ export const formatCode = async ( printWidth: number, indentSize: number, useTabs: boolean, - parser: string, + formatter: string, ) => { const makeRequest = async () => { const response = await fetch("/Format", { method: "POST", - body: JSON.stringify({ code, printWidth, indentSize, useTabs, parser }), + body: JSON.stringify({ code, printWidth, indentSize, useTabs, formatter }), headers: { "Content-Type": "application/json", "cache-control": "no-cache", diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test index 8a69ffbbf..7ad24f919 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Comments.test @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test index adfc814b0..8d38d2d14 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/xml/Elements.test @@ -2,10 +2,13 @@ Text - 4.3.0TextValue - $(MSBuildThisFileDirectory)..\..\tools\roslynlatestTextValue + TextValue + TextValue - + diff --git a/Src/CSharpier/DocPrinter/DocFitter.cs b/Src/CSharpier/DocPrinter/DocFitter.cs index fa4b7f677..838d376d7 100644 --- a/Src/CSharpier/DocPrinter/DocFitter.cs +++ b/Src/CSharpier/DocPrinter/DocFitter.cs @@ -90,8 +90,9 @@ void Push(Doc doc, PrintMode printMode, Indent indent) case IfBreak ifBreak: { var ifBreakMode = - ifBreak.GroupId != null && groupModeMap!.ContainsKey(ifBreak.GroupId) - ? groupModeMap[ifBreak.GroupId] + ifBreak.GroupId != null + && groupModeMap.TryGetValue(ifBreak.GroupId, out var value) + ? value : currentMode; var contents = diff --git a/Src/CSharpier/DocTypes/Doc.cs b/Src/CSharpier/DocTypes/Doc.cs index 10edb115b..e6f02b13e 100644 --- a/Src/CSharpier/DocTypes/Doc.cs +++ b/Src/CSharpier/DocTypes/Doc.cs @@ -102,6 +102,17 @@ public static Group GroupWithId(string groupId, Doc contents) return group; } + private static int groupNumber; + + public static Group GroupWithNewId(out string groupId, Doc contents) + { + groupId = "Group_" + groupNumber; + Interlocked.Increment(ref groupNumber); + var group = Group(contents); + group.GroupId = groupId; + return group; + } + public static Group GroupWithId(string groupId, params Doc[] contents) { var group = Group(contents); diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs index 2b3556e03..305acbbc1 100644 --- a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs @@ -4,52 +4,366 @@ namespace CSharpier.Formatters.Xml.XmlNodePrinters; internal static class Element { - internal static Doc Print(XmlElement element) + internal static Doc Print(XmlElement node) { - if (element.IsEmpty) + var shouldHugContent = false; + // TODO need any of this? + // node.ChildNodes.Count == 1 && + // (node.firstChild.type == "interpolation" || + // node.firstChild.type == "angularIcuExpression") && + // node.firstChild.isLeadingSpaceSensitive && + // !node.firstChild.hasLeadingSpaces && + // node.lastChild.isTrailingSpaceSensitive && + // !node.lastChild.hasTrailingSpaces; + + // TODO good idea for group names + var attrGroupId = Guid.NewGuid().ToString(); // Symbol("element-attr-group-id"); + + Group PrintTag(Doc doc) => + Doc.Group( + Doc.GroupWithId(attrGroupId, PrintOpeningTag(node)), + doc, + PrintClosingTag(node) + ); + + Doc PrintChildrenDoc(params Doc[] childrenDoc) + { + if (shouldHugContent) + { + return Doc.IndentIfBreak(Doc.Concat(childrenDoc), attrGroupId); + } + + return Doc.Indent(childrenDoc); + } + + Doc PrintLineBeforeChildren() { - return Doc.Group("<" + element.Name, PrintAttributes(element), Doc.Line, "/>"); + if (shouldHugContent) + { + return Doc.IfBreak(Doc.SoftLine, "", attrGroupId); + } + + // if ( + // node.firstChild.hasLeadingSpaces && + // node.firstChild.isLeadingSpaceSensitive + // ) { + // return Doc.Line; + // } + + // if ( + // node.firstChild.type == "text" && + // node.isWhitespaceSensitive && + // node.isIndentationSensitive + // ) { + // return dedentToRoot(Doc.SoftLine); + // } + + return Doc.SoftLine; + } + ; + + Doc PrintLineAfterChildren() + { + // var needsToBorrow = node.next + // ? needsToBorrowPrevClosingTagEndMarker(node.next) + // : needsToBorrowLastChildClosingTagEndMarker(node.parent); + // if (needsToBorrow) { + // if ( + // node.lastChild.hasTrailingSpaces && + // node.lastChild.isTrailingSpaceSensitive + // ) { + // return " "; + // } + // return ""; + // } + if (shouldHugContent) + { + return Doc.IfBreak(Doc.SoftLine, "", attrGroupId); + } + + // if ( + // node.lastChild.hasTrailingSpaces && + // node.lastChild.isTrailingSpaceSensitive + // ) { + // return line; + // } + // if ( + // (node.lastChild.type == "comment" || + // (node.lastChild.type == "text" && + // node.isWhitespaceSensitive && + // node.isIndentationSensitive)) && + // new RegExp( + // `\\n[\\t ]{${options.tabWidth * (path.ancestors.length - 1)}}$`, + // ).test(node.lastChild.value) + // ) { + // return ""; + // } + + return Doc.SoftLine; } + ; - return Doc.Group( - Doc.Group("<" + element.Name, PrintAttributes(element), Doc.SoftLine, ">"), - PrintChildren(element), - "" + if (node.ChildNodes.Count == 0) + { + return PrintTag( + "" + // node.hasDanglingSpaces && node.isDanglingSpaceSensitive ? Doc.Line : "" + ); + } + + return PrintTag( + Doc.Concat( + ForceBreakContent(node) ? Doc.BreakParent : "", + PrintChildrenDoc(PrintLineBeforeChildren(), ElementChildren.Print(node)), + PrintLineAfterChildren() + ) ); + + // if (element.IsEmpty) + // { + // return Doc.Doc.Group("<" + element.Name, PrintAttributes(element), Doc.Line, "/>"); + // } + // + // return Doc.Doc.Group( + // Doc.Doc.Group("<" + element.Name, PrintAttributes(element)), + // Doc.Indent(Doc.SoftLine, ">", PrintChildren(element), "" + // ); + + // return Doc.Doc.Group( + // Doc.GroupWithNewId( + // out var groupId, + // Doc.Indent( + // Doc.Doc.Group("<" + element.Name, PrintAttributes(element), Doc.SoftLine, ">"), + // PrintChildren(element) + // ) + // ), + // "" + // ); } - private static Doc PrintAttributes(XmlElement element) + private static Doc PrintOpeningTag(XmlElement node) { - var result = new List(); - foreach (XmlAttribute attribute in element.Attributes) - { - // TODO XML replace line endings in Value with the proper ones - result.Add(Doc.Line, attribute.Name, "=\"", attribute.Value, "\""); - } + return Doc.Concat("<" + node.Name, PrintAttributes(node), node.IsEmpty ? Doc.Null : ">"); - return Doc.Indent(result); + // return [ + // printOpeningTagStart(node, options), + // printAttributes(path, options, print), + // node.isSelfClosing ? "" : printOpeningTagEnd(node), + // ]; } - private static Doc PrintChildren(XmlElement element) + private static Doc PrintClosingTag(XmlElement node) { - if (element.ChildNodes.Count == 0) - { - return Doc.Null; - } + return Doc.Concat( + node.IsEmpty ? Doc.Null : PrintClosingTagStart(node), + PrintClosingTagEnd(node) + ); + // return [ + // node.isSelfClosing ? "" : printClosingTagStart(node, options), + // printClosingTagEnd(node, options), + // ]; + } - if (element.FirstChild is XmlText) + private static Doc PrintClosingTagStart(XmlElement node) + { + // return node.lastChild is not null && + // needsToBorrowParentClosingTagStartMarker(node.lastChild) + // ? Doc.Null + // : + + return Doc.Concat(PrintClosingTagPrefix(node), PrintClosingTagStartMarker(node)); + } + + private static Doc PrintClosingTagStartMarker(XmlElement node) + { + // if (shouldNotPrintClosingTag(node)) { + // return ""; + // } + // switch (node.type) { + // case "ieConditionalComment": + // return ""; + // case "ieConditionalStartComment": + // return "]>"; + // case "interpolation": + // return "}}"; + // case "angularIcuExpression": + // return "}"; + // case "element": + // if (node.isSelfClosing) { + // return "/>"; + // } + // // fall through + // default: + + return node.IsEmpty ? "/>" : ">"; + } + + private static Doc PrintClosingTagSuffix(XmlElement node) + { + return Doc.Null; + // return needsToBorrowParentClosingTagStartMarker(node) + // ? printClosingTagStartMarker(node.parent, options) + // : needsToBorrowNextOpeningTagStartMarker(node) + // ? printOpeningTagStartMarker(node.next) + // : ""; + } + + private static Doc PrintClosingTagPrefix(XmlElement node) + { + return Doc.Null; + // return needsToBorrowLastChildClosingTagEndMarker(node) + // ? printClosingTagEndMarker(node.lastChild, options) + // : ""; + } + + private static bool ForceBreakContent(XmlElement node) + { + return false; + // return ( + // forceBreakChildren(node) || + // (node.type === "element" && + // node.children.length > 0 && + // (["body", "script", "style"].includes(node.name) || + // node.children.some((child) => hasNonTextChild(child)))) || + // (node.firstChild && + // node.firstChild === node.lastChild && + // node.firstChild.type !== "text" && + // hasLeadingLineBreak(node.firstChild) && + // (!node.lastChild.isTrailingSpaceSensitive || + // hasTrailingLineBreak(node.lastChild))) + // ); + } + + private static Doc PrintAttributes(XmlElement node) + { + if (node.Attributes.Count == 0) { - return Node.Print(element.FirstChild); + return node.IsEmpty ? " " : Doc.Null; } + // this is just shoved in here for now var result = new List(); - - foreach (XmlNode xmlNode in element.ChildNodes) + foreach (XmlAttribute attribute in node.Attributes) { - result.Add(Doc.Line); - result.Add(Node.Print(xmlNode)); + result.Add(Doc.Line, attribute.Name, "=\"", attribute.Value, "\""); } - return Doc.Concat(Doc.BreakParent, Doc.Indent(result), Doc.Line); + return Doc.Indent(result); + // const ignoreAttributeData = + // node.prev?.type === "comment" && + // getPrettierIgnoreAttributeCommentData(node.prev.value); + // + // const hasPrettierIgnoreAttribute = + // typeof ignoreAttributeData === "boolean" + // ? () => ignoreAttributeData + // : Array.isArray(ignoreAttributeData) + // ? (attribute) => ignoreAttributeData.includes(attribute.rawName) + // : () => false; + // + // const printedAttributes = path.map( + // ({ node: attribute }) => + // hasPrettierIgnoreAttribute(attribute) + // ? replaceEndOfLine( + // options.originalText.slice( + // locStart(attribute), + // locEnd(attribute), + // ), + // ) + // : print(), + // "attrs", + // ); + // + // const forceNotToBreakAttrContent = + // node.type === "element" && + // node.fullName === "script" && + // node.attrs.length === 1 && + // node.attrs[0].fullName === "src" && + // node.children.length === 0; + // + // const shouldPrintAttributePerLine = + // options.singleAttributePerLine && + // node.attrs.length > 1 && + // !isVueSfcBlock(node, options); + // const attributeLine = shouldPrintAttributePerLine ? hardline : line; + // + // /** @type {Doc[]} */ + // const parts = [ + // indent([ + // forceNotToBreakAttrContent ? " " : line, + // join(attributeLine, printedAttributes), + // ]), + // ]; + // + // if ( + // /** + // * 123456 + // */ + // (node.firstChild && + // needsToBorrowParentOpeningTagEndMarker(node.firstChild)) || + // /** + // * 123 + // */ + // (node.isSelfClosing && + // needsToBorrowLastChildClosingTagEndMarker(node.parent)) || + // forceNotToBreakAttrContent + // ) { + // parts.push(node.isSelfClosing ? " " : ""); + // } else { + // parts.push( + // options.bracketSameLine + // ? node.isSelfClosing + // ? " " + // : "" + // : node.isSelfClosing + // ? line + // : softline, + // ); + // } + // + // return parts; } } diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/ElementChildren.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/ElementChildren.cs new file mode 100644 index 000000000..5994f3132 --- /dev/null +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/ElementChildren.cs @@ -0,0 +1,152 @@ +using System.Xml; + +namespace CSharpier.Formatters.Xml.XmlNodePrinters; + +internal static class ElementChildren +{ + public static Doc Print(XmlElement node) + { + return PrintChildren(node, Node.Print); + + // if (node.ChildNodes.Count == 0) + // { + // return Doc.Null; + // } + // + // if (node.FirstChild is XmlText) + // { + // return Node.Print(node.FirstChild); + // } + // + // var result = new List(); + // + // foreach (XmlNode xmlNode in node.ChildNodes) + // { + // result.Add(Doc.Line); + // result.Add(Node.Print(xmlNode)); + // } + // + // return Doc.Concat(Doc.BreakParent, Doc.Concat(result), Doc.Line); + } + + public static Doc PrintChildren(XmlElement node, Func print) + { + // this force breaks html, head, ul, ol, etc + // if (ForceBreakChildren(node)) + // { + // var result = new List { Doc.BreakParent }; + // + // foreach (XmlNode child in node.ChildNodes) + // { + // var prevBetweenLine = + // child.PreviousSibling == null + // ? Doc.Null + // : PrintBetweenLine(child.PreviousSibling, child); + // result.AddRange( + // prevBetweenLine == Doc.Null + // ? new List() + // : new List + // { + // prevBetweenLine, + // ForceNextEmptyLine(child.Prev) ? Doc.HardLine : Doc.Null, + // } + // ); + // result.AddRange(PrintChild(child, print)); + // } + // + // return result; + // } + + var groupIds = new List(); // Assuming CSharpier has grouping feature + foreach (var child in node.ChildNodes) + { + groupIds.Add(Guid.NewGuid().ToString()); + } + + var docs = new List(); + foreach (XmlNode child in node.ChildNodes) + { + var prevBetweenLine = + child.PreviousSibling == null + ? Doc.Null + : PrintBetweenLine(child.PreviousSibling, child); + var nextBetweenLine = + child.NextSibling == null ? Doc.Null : PrintBetweenLine(child, child.NextSibling); + + var parts = new List(); + if (prevBetweenLine is not NullDoc) + { + parts.Add(prevBetweenLine == Doc.HardLine ? Doc.HardLine : Doc.SoftLine); + } + + parts.Add(PrintChild(child, print)); + + if (nextBetweenLine is not NullDoc) + { + parts.Add(nextBetweenLine == Doc.HardLine ? Doc.HardLine : Doc.SoftLine); + } + + docs.Add(Doc.Group(parts)); + } + + return Doc.Concat(docs); + } + + public static Doc PrintChild(XmlNode child, Func print) + { + // should we try to support csharpier-ignore some day? + // if (HasPrettierIgnore(child)) + // { + // int endLocation = GetEndLocation(child); + // + // return new List + // { + // PrintOpeningTagPrefix(child, options), + // ReplaceEndOfLine(TrimEnd(options.OriginalText.Substring( + // LocStart(child) + (child.Prev != null && NeedsToBorrowNextOpeningTagStartMarker(child.Prev) + // ? PrintOpeningTagStartMarker(child).Length : 0), + // endLocation - (child.Next != null && NeedsToBorrowPrevClosingTagEndMarker(child.Next) + // ? PrintClosingTagEndMarker(child, options).Length : 0) + // ))), + // PrintClosingTagSuffix(child, options) + // }; + // } + + return print(child); + } + + // public static int GetEndLocation(XmlElement node) + // { + // int endLocation = LocEnd(node); + // + // // Element can be unclosed + // if (node.Type == "element" && node.Children != null && node.Children.Count > 0) + // { + // return Math.Max(endLocation, GetEndLocation(node.Children[^1])); // Using C# ^ for last element + // } + // + // return endLocation; + // } + + public static Doc PrintBetweenLine(XmlNode prevNode, XmlNode nextNode) + { + return Doc.Line; + + // if (prevNode is XmlText && nextNode is XmlText) + // { + // if (prevNode.IsTrailingSpaceSensitive) + // { + // return prevNode.HasTrailingSpaces + // ? PreferHardlineAsLeadingSpaces(nextNode) + // ? Doc.HardLine + // : Line() + // : Doc.Empty; + // } + // return PreferHardlineAsLeadingSpaces(nextNode) ? Doc.HardLine : Doc.SoftLine; + // } + // + // return ShouldBreakBetweenNodes(prevNode, nextNode) ? Doc.HardLine + // : nextNode.HasLeadingSpaces ? Line() + // : Doc.SoftLine; + } +} diff --git a/Src/CSharpier/SyntaxPrinter/FormattingContext.cs b/Src/CSharpier/SyntaxPrinter/FormattingContext.cs index 810ce602c..cee102fc1 100644 --- a/Src/CSharpier/SyntaxPrinter/FormattingContext.cs +++ b/Src/CSharpier/SyntaxPrinter/FormattingContext.cs @@ -10,6 +10,7 @@ internal class FormattingContext public required bool UseTabs { get; init; } // TODO the rest of these go into State + // context.State.PrintingDepth public int PrintingDepth { get; set; } public bool NextTriviaNeedsLine { get; set; } From 25ce1442d9f89d6e17a64a6ee9165906c24e0526 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 16 Sep 2024 21:12:17 -0500 Subject: [PATCH 21/21] add note for looking into the xml plugin to see if it is easier --- Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs index 305acbbc1..60f201d6d 100644 --- a/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs +++ b/Src/CSharpier/Formatters/Xml/XmlNodePrinters/Element.cs @@ -2,6 +2,9 @@ namespace CSharpier.Formatters.Xml.XmlNodePrinters; +// TODO it may be worth looking +// at how this works instead of the html one +// https://github.com/prettier/plugin-xml/blob/main/src/printer.js internal static class Element { internal static Doc Print(XmlElement node)