├── .github ├── ISSUE_TEMPLATE │ ├── formatting-issue.md │ └── other-request.md ├── dependabot.yml └── workflows │ ├── publish.yml │ └── test-package.yml ├── .gitignore ├── AUTHORS ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── benchmark ├── case │ ├── block.expect │ ├── block.expect_short │ ├── block.unit │ ├── chain.expect │ ├── chain.expect_short │ ├── chain.unit │ ├── collection.expect │ ├── collection.expect_short │ ├── collection.unit │ ├── collection_large.expect │ ├── collection_large.expect_short │ ├── collection_large.unit │ ├── conditional.expect │ ├── conditional.expect_short │ ├── conditional.unit │ ├── curry.expect │ ├── curry.expect_short │ ├── curry.unit │ ├── curry_2.expect │ ├── curry_2.expect_short │ ├── curry_2.unit │ ├── ffi.expect │ ├── ffi.expect_short │ ├── ffi.unit │ ├── flutter_popup_menu_test.expect │ ├── flutter_popup_menu_test.expect_short │ ├── flutter_popup_menu_test.unit │ ├── flutter_scrollbar_test.expect │ ├── flutter_scrollbar_test.expect_short │ ├── flutter_scrollbar_test.unit │ ├── function_call.expect │ ├── function_call.expect_short │ ├── function_call.unit │ ├── infix_large.expect │ ├── infix_large.expect_short │ ├── infix_large.unit │ ├── infix_small.expect │ ├── infix_small.expect_short │ ├── infix_small.unit │ ├── interpolation.expect │ ├── interpolation.expect_short │ ├── interpolation.unit │ ├── interpolation_1516.expect │ ├── interpolation_1516.expect_short │ ├── interpolation_1516.unit │ ├── large.expect │ ├── large.expect_short │ ├── large.unit │ ├── top_level.expect │ ├── top_level.expect_short │ └── top_level.unit ├── directory.dart └── run.dart ├── bin └── format.dart ├── dist └── dart-style.d.ts ├── example └── format.dart ├── lib ├── dart_style.dart └── src │ ├── analysis_options │ ├── analysis_options_file.dart │ ├── file_system.dart │ ├── io_file_system.dart │ └── merge_options.dart │ ├── ast_extensions.dart │ ├── back_end │ ├── code.dart │ ├── code_writer.dart │ ├── solution.dart │ ├── solution_cache.dart │ └── solver.dart │ ├── cli │ ├── format_command.dart │ ├── formatter_options.dart │ ├── output.dart │ ├── show.dart │ └── summary.dart │ ├── comment_type.dart │ ├── config_cache.dart │ ├── constants.dart │ ├── dart_formatter.dart │ ├── debug.dart │ ├── exceptions.dart │ ├── fast_hash.dart │ ├── front_end │ ├── ast_node_visitor.dart │ ├── chain_builder.dart │ ├── comment_writer.dart │ ├── delimited_list_builder.dart │ ├── expression_contents.dart │ ├── piece_factory.dart │ ├── piece_writer.dart │ └── sequence_builder.dart │ ├── io.dart │ ├── piece │ ├── adjacent.dart │ ├── assign.dart │ ├── assign_v37.dart │ ├── case.dart │ ├── chain.dart │ ├── clause.dart │ ├── constructor.dart │ ├── control_flow.dart │ ├── for.dart │ ├── grouping.dart │ ├── if_case.dart │ ├── infix.dart │ ├── leading_comment.dart │ ├── list.dart │ ├── piece.dart │ ├── prefix.dart │ ├── sequence.dart │ ├── text.dart │ ├── type.dart │ ├── type_parameter_bound.dart │ └── variable.dart │ ├── profile.dart │ ├── short │ ├── argument_list_visitor.dart │ ├── call_chain_visitor.dart │ ├── chunk.dart │ ├── chunk_builder.dart │ ├── line_splitting │ │ ├── line_splitter.dart │ │ ├── rule_set.dart │ │ ├── solve_state.dart │ │ └── solve_state_queue.dart │ ├── line_writer.dart │ ├── marking_scheme.dart │ ├── nesting_builder.dart │ ├── nesting_level.dart │ ├── rule │ │ ├── argument.dart │ │ ├── combinator.dart │ │ ├── rule.dart │ │ └── type_argument.dart │ ├── selection.dart │ ├── source_comment.dart │ └── source_visitor.dart │ ├── source_code.dart │ ├── string_compare.dart │ └── testing │ ├── benchmark.dart │ ├── test_file.dart │ └── test_file_system.dart ├── pubspec.yaml ├── test ├── README.md ├── analysis_options │ ├── analysis_options_file_test.dart │ ├── io_file_system_test.dart │ └── merge_options_test.dart ├── cli │ ├── cli_test.dart │ ├── language_version_test.dart │ ├── output_test.dart │ ├── page_width_test.dart │ ├── stdin_test.dart │ └── trailing_commas_test.dart ├── config_cache_test.dart ├── dart_formatter_test.dart ├── io_test.dart ├── short │ ├── comments │ │ ├── cascades.stmt │ │ ├── classes.unit │ │ ├── enums.unit │ │ ├── expressions.stmt │ │ ├── extensions.unit │ │ ├── functions.unit │ │ ├── generic_methods.unit │ │ ├── lists.stmt │ │ ├── maps.stmt │ │ ├── mixed.unit │ │ ├── patterns.stmt │ │ ├── records.stmt │ │ ├── sets.stmt │ │ ├── statements.stmt │ │ ├── switch.stmt │ │ ├── top_level.unit │ │ └── variables.stmt │ ├── regression │ │ ├── 1000 │ │ │ ├── 1010.unit │ │ │ └── 1029.unit │ │ ├── 1100 │ │ │ ├── 1181.stmt │ │ │ ├── 1190.unit │ │ │ ├── 1197.unit │ │ │ └── 1198.stmt │ │ ├── 1200 │ │ │ ├── 1205.stmt │ │ │ ├── 1212.unit │ │ │ ├── 1213.unit │ │ │ ├── 1215.stmt │ │ │ ├── 1249.unit │ │ │ └── 1254.unit │ │ ├── 1300 │ │ │ └── 1321.unit │ │ ├── 1400 │ │ │ └── 1404.stmt │ │ ├── 1500 │ │ │ └── 1544.unit │ │ ├── 0000 │ │ │ ├── 0000.stmt │ │ │ ├── 0005.stmt │ │ │ ├── 0006.stmt │ │ │ ├── 0009.unit │ │ │ ├── 0013.unit │ │ │ ├── 0014.unit │ │ │ ├── 0019.stmt │ │ │ ├── 0021.stmt │ │ │ ├── 0022.stmt │ │ │ ├── 0023.stmt │ │ │ ├── 0025.stmt │ │ │ ├── 0026.stmt │ │ │ ├── 0027.stmt │ │ │ ├── 0028.unit │ │ │ ├── 0029.stmt │ │ │ ├── 0031.stmt │ │ │ ├── 0033.stmt │ │ │ ├── 0036.unit │ │ │ ├── 0037.stmt │ │ │ ├── 0038.stmt │ │ │ ├── 0039.stmt │ │ │ ├── 0040.stmt │ │ │ ├── 0041.stmt │ │ │ ├── 0042.unit │ │ │ ├── 0043.stmt │ │ │ ├── 0044.stmt │ │ │ ├── 0045.stmt │ │ │ ├── 0046.stmt │ │ │ ├── 0047.unit │ │ │ ├── 0049.stmt │ │ │ ├── 0050.stmt │ │ │ ├── 0054.stmt │ │ │ ├── 0055.unit │ │ │ ├── 0056.stmt │ │ │ ├── 0057.stmt │ │ │ ├── 0058.unit │ │ │ ├── 0060.stmt │ │ │ ├── 0061.unit │ │ │ ├── 0066.stmt │ │ │ ├── 0068.stmt │ │ │ ├── 0069.stmt │ │ │ ├── 0070.stmt │ │ │ ├── 0071.unit │ │ │ ├── 0072.unit │ │ │ ├── 0075.unit │ │ │ ├── 0076.unit │ │ │ ├── 0077.stmt │ │ │ ├── 0080.unit │ │ │ ├── 0081.unit │ │ │ ├── 0082.stmt │ │ │ ├── 0083.unit │ │ │ ├── 0084.unit │ │ │ ├── 0085.unit │ │ │ ├── 0086.unit │ │ │ ├── 0087.unit │ │ │ ├── 0089.unit │ │ │ ├── 0090.stmt │ │ │ ├── 0091.stmt │ │ │ ├── 0095.unit │ │ │ ├── 0096.unit │ │ │ ├── 0098.stmt │ │ │ └── 0099.stmt │ │ ├── 0100 │ │ │ ├── 0100.stmt │ │ │ ├── 0102.stmt │ │ │ ├── 0108.unit │ │ │ ├── 0109.unit │ │ │ ├── 0110.stmt │ │ │ ├── 0111.unit │ │ │ ├── 0112.stmt │ │ │ ├── 0113.unit │ │ │ ├── 0114.unit │ │ │ ├── 0115.stmt │ │ │ ├── 0119.stmt │ │ │ ├── 0121.stmt │ │ │ ├── 0122.unit │ │ │ ├── 0130.unit │ │ │ ├── 0132.stmt │ │ │ ├── 0135.stmt │ │ │ ├── 0137.stmt │ │ │ ├── 0139.unit │ │ │ ├── 0140.stmt │ │ │ ├── 0141.unit │ │ │ ├── 0142.stmt │ │ │ ├── 0144.unit │ │ │ ├── 0146.unit │ │ │ ├── 0151.unit │ │ │ ├── 0152.unit │ │ │ ├── 0154.stmt │ │ │ ├── 0155.stmt │ │ │ ├── 0156.unit │ │ │ ├── 0158.unit │ │ │ ├── 0161.stmt │ │ │ ├── 0162.stmt │ │ │ ├── 0168.unit │ │ │ ├── 0170.unit │ │ │ ├── 0171.unit │ │ │ ├── 0176.unit │ │ │ ├── 0177.stmt │ │ │ ├── 0178.unit │ │ │ ├── 0184.unit │ │ │ ├── 0185.stmt │ │ │ ├── 0186.stmt │ │ │ ├── 0187.stmt │ │ │ ├── 0189.stmt │ │ │ ├── 0192.unit │ │ │ ├── 0197.unit │ │ │ ├── 0198.stmt │ │ │ └── 0199.stmt │ │ ├── 0200 │ │ │ ├── 0200.stmt │ │ │ ├── 0201.stmt │ │ │ ├── 0203.stmt │ │ │ ├── 0204.stmt │ │ │ ├── 0205.stmt │ │ │ ├── 0206.stmt │ │ │ ├── 0211.unit │ │ │ ├── 0212.stmt │ │ │ ├── 0217.stmt │ │ │ ├── 0218.stmt │ │ │ ├── 0221.unit │ │ │ ├── 0222.stmt │ │ │ ├── 0223.stmt │ │ │ ├── 0224.stmt │ │ │ ├── 0226.stmt │ │ │ ├── 0228.unit │ │ │ ├── 0229.unit │ │ │ ├── 0232.unit │ │ │ ├── 0235.unit │ │ │ ├── 0236.unit │ │ │ ├── 0237.unit │ │ │ ├── 0238.unit │ │ │ ├── 0241.unit │ │ │ ├── 0242.unit │ │ │ ├── 0243.stmt │ │ │ ├── 0247.unit │ │ │ ├── 0249.stmt │ │ │ ├── 0250.unit │ │ │ ├── 0255.stmt │ │ │ ├── 0256.unit │ │ │ ├── 0257.unit │ │ │ ├── 0258.unit │ │ │ └── 0259.unit │ │ ├── 0300 │ │ │ ├── 0357.stmt │ │ │ ├── 0360.stmt │ │ │ ├── 0361.unit │ │ │ ├── 0364.unit │ │ │ ├── 0366.stmt │ │ │ ├── 0367.stmt │ │ │ ├── 0368.unit │ │ │ ├── 0369.stmt │ │ │ ├── 0370.stmt │ │ │ ├── 0373.unit │ │ │ ├── 0374.stmt │ │ │ ├── 0375.stmt │ │ │ ├── 0377.stmt │ │ │ ├── 0378.stmt │ │ │ ├── 0379.stmt │ │ │ ├── 0380.unit │ │ │ ├── 0381.unit │ │ │ ├── 0383.unit │ │ │ ├── 0384.stmt │ │ │ ├── 0387.unit │ │ │ ├── 0388.unit │ │ │ ├── 0389.unit │ │ │ ├── 0391.stmt │ │ │ ├── 0394.stmt │ │ │ ├── 0398.stmt │ │ │ └── 0399.unit │ │ ├── 0400 │ │ │ ├── 0404.stmt │ │ │ ├── 0407.unit │ │ │ ├── 0410.stmt │ │ │ ├── 0413.unit │ │ │ ├── 0420.unit │ │ │ ├── 0421.unit │ │ │ ├── 0422.unit │ │ │ ├── 0424.stmt │ │ │ ├── 0429.stmt │ │ │ ├── 0434.unit │ │ │ ├── 0436.unit │ │ │ ├── 0437.unit │ │ │ ├── 0438.stmt │ │ │ ├── 0439.stmt │ │ │ ├── 0441.unit │ │ │ ├── 0443.unit │ │ │ ├── 0444.unit │ │ │ ├── 0448.stmt │ │ │ ├── 0449.stmt │ │ │ ├── 0454.unit │ │ │ ├── 0461.stmt │ │ │ ├── 0462.unit │ │ │ ├── 0463.unit │ │ │ ├── 0465.stmt │ │ │ ├── 0466.unit │ │ │ ├── 0467.unit │ │ │ ├── 0474.unit │ │ │ ├── 0475.unit │ │ │ ├── 0478.stmt │ │ │ ├── 0479.stmt │ │ │ ├── 0480.unit │ │ │ ├── 0481.unit │ │ │ ├── 0484.stmt │ │ │ ├── 0488.stmt │ │ │ ├── 0489.stmt │ │ │ ├── 0494.unit │ │ │ └── 0497.unit │ │ ├── 0500 │ │ │ ├── 0500.unit │ │ │ ├── 0503.unit │ │ │ ├── 0506.unit │ │ │ ├── 0511.unit │ │ │ ├── 0513.unit │ │ │ ├── 0514.unit │ │ │ ├── 0519.stmt │ │ │ ├── 0520.unit │ │ │ ├── 0527.stmt │ │ │ ├── 0529.unit │ │ │ ├── 0541.unit │ │ │ ├── 0543.unit │ │ │ ├── 0548.stmt │ │ │ ├── 0566.unit │ │ │ ├── 0571.unit │ │ │ ├── 0582.unit │ │ │ ├── 0584.unit │ │ │ ├── 0585.unit │ │ │ ├── 0589.unit │ │ │ └── 0591.unit │ │ ├── 0600 │ │ │ ├── 0606.unit │ │ │ ├── 0613.unit │ │ │ ├── 0616.unit │ │ │ ├── 0619.unit │ │ │ ├── 0621.stmt │ │ │ ├── 0648.stmt │ │ │ ├── 0658.unit │ │ │ ├── 0665.stmt │ │ │ └── 0680.stmt │ │ ├── 0700 │ │ │ ├── 0704.unit │ │ │ ├── 0705.stmt │ │ │ ├── 0707.stmt │ │ │ ├── 0711.stmt │ │ │ ├── 0713.stmt │ │ │ ├── 0720.unit │ │ │ ├── 0722.stmt │ │ │ ├── 0782.unit │ │ │ └── 0799.unit │ │ ├── 0800 │ │ │ ├── 0802.unit │ │ │ ├── 0831.unit │ │ │ ├── 0837.unit │ │ │ ├── 0855.unit │ │ │ ├── 0862.unit │ │ │ ├── 0869.stmt │ │ │ ├── 0881.unit │ │ │ └── 0888.unit │ │ ├── 0900 │ │ │ ├── 0900.stmt │ │ │ ├── 0927.unit │ │ │ ├── 0960.unit │ │ │ └── 0966.stmt │ │ └── other │ │ │ ├── analysis_server.unit │ │ │ ├── analyzer.unit │ │ │ ├── angular.unit │ │ │ ├── block_comment.unit │ │ │ ├── cascades.unit │ │ │ ├── chains.stmt │ │ │ ├── chunk_refactor.unit │ │ │ ├── dart2js.unit │ │ │ ├── enhanced_enum.unit │ │ │ ├── flutter.unit │ │ │ ├── misc.unit │ │ │ ├── null_safety.unit │ │ │ ├── pkg.stmt │ │ │ ├── pkg.unit │ │ │ └── pub.stmt │ ├── selections │ │ ├── selections.stmt │ │ └── selections.unit │ ├── splitting │ │ ├── annotations.unit │ │ ├── arguments.stmt │ │ ├── arrows.stmt │ │ ├── arrows.unit │ │ ├── assignments.stmt │ │ ├── classes.unit │ │ ├── constructors.unit │ │ ├── enums.unit │ │ ├── exports.unit │ │ ├── expressions.stmt │ │ ├── extensions.unit │ │ ├── function_arguments.stmt │ │ ├── function_types.unit │ │ ├── generic_method_arguments.stmt │ │ ├── generic_method_parameters.unit │ │ ├── if_case.stmt │ │ ├── imports.unit │ │ ├── invocations.stmt │ │ ├── list_arguments.stmt │ │ ├── list_collection_for.stmt │ │ ├── list_collection_if.stmt │ │ ├── lists.stmt │ │ ├── loops.stmt │ │ ├── map_arguments.stmt │ │ ├── map_collection_for.stmt │ │ ├── map_collection_if.stmt │ │ ├── maps.stmt │ │ ├── members.unit │ │ ├── metadata.stmt │ │ ├── mixed.stmt │ │ ├── mixins.unit │ │ ├── parameters.stmt │ │ ├── parameters.unit │ │ ├── part.unit │ │ ├── patterns.stmt │ │ ├── record_types.unit │ │ ├── records.stmt │ │ ├── set_collection_for.stmt │ │ ├── set_collection_if.stmt │ │ ├── sets.stmt │ │ ├── statements.stmt │ │ ├── strings.stmt │ │ ├── switch.stmt │ │ ├── switch_expression.stmt │ │ ├── type_arguments.stmt │ │ ├── type_parameters.unit │ │ ├── typedef.unit │ │ └── variables.stmt │ └── whitespace │ │ ├── adjacent_strings.stmt │ │ ├── blocks.stmt │ │ ├── cascades.stmt │ │ ├── classes.unit │ │ ├── collections.stmt │ │ ├── compilation_unit.unit │ │ ├── constructors.unit │ │ ├── directives.unit │ │ ├── do.stmt │ │ ├── enums.unit │ │ ├── expressions.stmt │ │ ├── extension_types.unit │ │ ├── extensions.unit │ │ ├── external.unit │ │ ├── for.stmt │ │ ├── function_types.unit │ │ ├── functions.unit │ │ ├── if.stmt │ │ ├── metadata.unit │ │ ├── methods.unit │ │ ├── mixins.unit │ │ ├── multiline_string_first_list.stmt │ │ ├── native.unit │ │ ├── patterns.stmt │ │ ├── record_types.unit │ │ ├── script.unit │ │ ├── statements.stmt │ │ ├── strings.stmt │ │ ├── switch.stmt │ │ ├── trailing.unit │ │ ├── try.stmt │ │ ├── type_arguments.stmt │ │ ├── type_parameters.unit │ │ ├── typedef.unit │ │ ├── unicode.unit │ │ ├── variables.stmt │ │ └── while.stmt ├── short_format_test.dart ├── source_code_test.dart ├── string_compare_test.dart ├── tall │ ├── declaration │ │ ├── class.unit │ │ ├── class_clause.unit │ │ ├── class_comment.unit │ │ ├── class_type_parameter.unit │ │ ├── constructor.unit │ │ ├── constructor_assert.unit │ │ ├── constructor_comment.unit │ │ ├── constructor_initializer.unit │ │ ├── constructor_parameter.unit │ │ ├── enum.unit │ │ ├── enum_clause.unit │ │ ├── enum_comment.unit │ │ ├── enum_member.unit │ │ ├── enum_member_comment.unit │ │ ├── enum_metadata.unit │ │ ├── extension.unit │ │ ├── extension_type.unit │ │ ├── extension_type_comment.unit │ │ ├── external.unit │ │ ├── field.unit │ │ ├── member.unit │ │ ├── member_comment.unit │ │ ├── member_metadata.unit │ │ ├── metadata.unit │ │ ├── metadata_comment.unit │ │ ├── method.unit │ │ ├── mixin.unit │ │ ├── mixin_application_class.unit │ │ ├── mixin_clause.unit │ │ ├── native.unit │ │ ├── typedef.unit │ │ └── typedef_comment.unit │ ├── expression │ │ ├── assignment.stmt │ │ ├── assignment_comment.stmt │ │ ├── assignment_pattern.stmt │ │ ├── binary.stmt │ │ ├── binary_comment.stmt │ │ ├── collection_for.stmt │ │ ├── collection_for_comment.stmt │ │ ├── collection_for_in.stmt │ │ ├── collection_for_metadata.stmt │ │ ├── collection_for_spread_list.stmt │ │ ├── collection_for_spread_map.stmt │ │ ├── collection_for_spread_set.stmt │ │ ├── collection_if.stmt │ │ ├── collection_if_case.stmt │ │ ├── collection_if_comment.stmt │ │ ├── collection_if_spread_list.stmt │ │ ├── collection_if_spread_map.stmt │ │ ├── collection_if_spread_set.stmt │ │ ├── collection_null_aware.stmt │ │ ├── collection_null_aware_comment.stmt │ │ ├── collection_spread.stmt │ │ ├── condition.stmt │ │ ├── condition_comment.stmt │ │ ├── function_reference.stmt │ │ ├── interpolation.stmt │ │ ├── list.stmt │ │ ├── list_comment.stmt │ │ ├── list_nested.stmt │ │ ├── list_preserve_newlines.stmt │ │ ├── logical.stmt │ │ ├── map.stmt │ │ ├── map_comment.stmt │ │ ├── map_nested.stmt │ │ ├── map_preserve_newlines.stmt │ │ ├── other.stmt │ │ ├── postfix.stmt │ │ ├── prefix.stmt │ │ ├── record.stmt │ │ ├── record_comment.stmt │ │ ├── record_nested.stmt │ │ ├── record_preserve_newlines.stmt │ │ ├── set.stmt │ │ ├── set_comment.stmt │ │ ├── set_nested.stmt │ │ ├── set_preserve_newlines.stmt │ │ ├── string.stmt │ │ ├── string_adjacent.stmt │ │ ├── string_adjacent_comment.stmt │ │ ├── string_comment.stmt │ │ ├── switch.stmt │ │ ├── switch_comment.stmt │ │ ├── switch_guard.stmt │ │ ├── type_test.stmt │ │ └── type_test_comment.stmt │ ├── function │ │ ├── block_body.unit │ │ ├── comment.unit │ │ ├── default_value.unit │ │ ├── expression.stmt │ │ ├── expression_body.unit │ │ ├── generic.unit │ │ ├── getter.unit │ │ ├── local.stmt │ │ ├── metadata.unit │ │ ├── operator.unit │ │ ├── other.unit │ │ ├── parameter.unit │ │ └── setter.unit │ ├── invocation │ │ ├── block_argument_comment.stmt │ │ ├── block_argument_description.stmt │ │ ├── block_argument_kind.stmt │ │ ├── block_argument_multiple.stmt │ │ ├── block_argument_named.stmt │ │ ├── block_argument_other.stmt │ │ ├── block_argument_string.stmt │ │ ├── cascade.stmt │ │ ├── cascade_comment.stmt │ │ ├── cascade_mixed.stmt │ │ ├── chain.stmt │ │ ├── chain_block.stmt │ │ ├── chain_comment.stmt │ │ ├── chain_postfix.stmt │ │ ├── chain_property.stmt │ │ ├── chain_target.stmt │ │ ├── comma_comment.stmt │ │ ├── comment.stmt │ │ ├── constructor.stmt │ │ ├── function.stmt │ │ ├── invocation_expression.stmt │ │ ├── named_argument.stmt │ │ ├── nested.stmt │ │ ├── null_aware.stmt │ │ ├── other.stmt │ │ └── super.stmt │ ├── other │ │ ├── format_off.unit │ │ ├── format_off_selection.unit │ │ ├── format_width.unit │ │ ├── selection.stmt │ │ ├── selection.unit │ │ ├── selection_comma.stmt │ │ ├── selection_comment.stmt │ │ ├── trailing_whitespace.unit │ │ └── unicode.unit │ ├── pattern │ │ ├── cast.stmt │ │ ├── cast_comment.stmt │ │ ├── constant.stmt │ │ ├── declared_variable.stmt │ │ ├── declared_variable_comment.stmt │ │ ├── list.stmt │ │ ├── list_comment.stmt │ │ ├── logic.stmt │ │ ├── logic_comment.stmt │ │ ├── map.stmt │ │ ├── map_comment.stmt │ │ ├── object.stmt │ │ ├── object_comment.stmt │ │ ├── other.stmt │ │ ├── other_comment.stmt │ │ ├── record.stmt │ │ ├── record_comment.stmt │ │ ├── relational.stmt │ │ └── relational_comment.stmt │ ├── preserve_trailing_commas │ │ ├── collection_for.stmt │ │ ├── constructor.unit │ │ ├── enum.unit │ │ ├── for.stmt │ │ ├── function_call.stmt │ │ ├── list_literal.stmt │ │ ├── list_pattern.stmt │ │ ├── map_literal.stmt │ │ ├── map_pattern.stmt │ │ ├── member.unit │ │ ├── metadata.unit │ │ ├── object_pattern.stmt │ │ ├── parameter.unit │ │ ├── record_literal.stmt │ │ ├── record_pattern.stmt │ │ ├── set_literal.stmt │ │ ├── super_call.stmt │ │ ├── switch_expression.stmt │ │ └── typedef.unit │ ├── regression │ │ ├── 1000 │ │ │ ├── 1008.unit │ │ │ ├── 1010.unit │ │ │ ├── 1022.stmt │ │ │ ├── 1029.unit │ │ │ ├── 1071.unit │ │ │ ├── 1082.unit │ │ │ ├── 1083.unit │ │ │ ├── 1085.unit │ │ │ ├── 1090.stmt │ │ │ └── 1092.unit │ │ ├── 1100 │ │ │ ├── 1107.unit │ │ │ ├── 1118.unit │ │ │ ├── 1119.unit │ │ │ ├── 1121.unit │ │ │ ├── 1135.stmt │ │ │ ├── 1143.unit │ │ │ ├── 1175.unit │ │ │ ├── 1181.stmt │ │ │ ├── 1190.unit │ │ │ ├── 1197.unit │ │ │ └── 1198.stmt │ │ ├── 1200 │ │ │ ├── 1202.stmt │ │ │ ├── 1205.stmt │ │ │ ├── 1212.unit │ │ │ ├── 1213.unit │ │ │ ├── 1215.stmt │ │ │ ├── 1232.unit │ │ │ ├── 1237.unit │ │ │ ├── 1249.unit │ │ │ ├── 1253.unit │ │ │ └── 1254.unit │ │ ├── 1300 │ │ │ ├── 1321.unit │ │ │ ├── 1331.stmt │ │ │ ├── 1348.unit │ │ │ └── 1354.stmt │ │ ├── 1400 │ │ │ ├── 1404.stmt │ │ │ ├── 1415.unit │ │ │ ├── 1429.stmt │ │ │ ├── 1441.unit │ │ │ ├── 1463.unit │ │ │ └── 1469.stmt │ │ ├── 1500 │ │ │ ├── 1505.unit │ │ │ ├── 1516.unit │ │ │ ├── 1521.unit │ │ │ ├── 1525.stmt │ │ │ ├── 1526.stmt │ │ │ ├── 1526.unit │ │ │ ├── 1527.unit │ │ │ ├── 1528.stmt │ │ │ ├── 1529.stmt │ │ │ ├── 1531.stmt │ │ │ ├── 1533.unit │ │ │ ├── 1534.unit │ │ │ ├── 1536.unit │ │ │ ├── 1543.unit │ │ │ ├── 1544.unit │ │ │ ├── 1545.unit │ │ │ ├── 1568.unit │ │ │ ├── 1584.unit │ │ │ ├── 1585.unit │ │ │ └── 1586.unit │ │ ├── 1600 │ │ │ ├── 1602.stmt │ │ │ ├── 1603.stmt │ │ │ ├── 1604.unit │ │ │ ├── 1606.unit │ │ │ ├── 1611.unit │ │ │ ├── 1621.unit │ │ │ ├── 1628.unit │ │ │ ├── 1639.unit │ │ │ ├── 1645.unit │ │ │ ├── 1651.unit │ │ │ ├── 1667.unit │ │ │ ├── 1668.unit │ │ │ ├── 1679.unit │ │ │ └── 1685.stmt │ │ ├── 1700 │ │ │ └── 1712.unit │ │ ├── 0000 │ │ │ ├── 0000.stmt │ │ │ ├── 0005.stmt │ │ │ ├── 0006.stmt │ │ │ ├── 0009.unit │ │ │ ├── 0013.unit │ │ │ ├── 0014.unit │ │ │ ├── 0019.stmt │ │ │ ├── 0021.stmt │ │ │ ├── 0022.stmt │ │ │ ├── 0023.stmt │ │ │ ├── 0025.stmt │ │ │ ├── 0026.stmt │ │ │ ├── 0027.stmt │ │ │ ├── 0028.unit │ │ │ ├── 0029.stmt │ │ │ ├── 0031.stmt │ │ │ ├── 0033.stmt │ │ │ ├── 0036.unit │ │ │ ├── 0037.stmt │ │ │ ├── 0038.stmt │ │ │ ├── 0039.stmt │ │ │ ├── 0040.stmt │ │ │ ├── 0041.stmt │ │ │ ├── 0042.unit │ │ │ ├── 0043.stmt │ │ │ ├── 0044.stmt │ │ │ ├── 0045.stmt │ │ │ ├── 0046.stmt │ │ │ ├── 0047.unit │ │ │ ├── 0049.stmt │ │ │ ├── 0050.stmt │ │ │ ├── 0054.stmt │ │ │ ├── 0055.unit │ │ │ ├── 0056.stmt │ │ │ ├── 0057.stmt │ │ │ ├── 0058.unit │ │ │ ├── 0060.stmt │ │ │ ├── 0061.unit │ │ │ ├── 0066.stmt │ │ │ ├── 0068.stmt │ │ │ ├── 0069.stmt │ │ │ ├── 0070.stmt │ │ │ ├── 0071.unit │ │ │ ├── 0072.unit │ │ │ ├── 0075.unit │ │ │ ├── 0076.unit │ │ │ ├── 0077.stmt │ │ │ ├── 0080.unit │ │ │ ├── 0081.unit │ │ │ ├── 0082.stmt │ │ │ ├── 0083.unit │ │ │ ├── 0084.unit │ │ │ ├── 0085.unit │ │ │ ├── 0086.unit │ │ │ ├── 0087.unit │ │ │ ├── 0089.unit │ │ │ ├── 0090.stmt │ │ │ ├── 0091.stmt │ │ │ ├── 0095.unit │ │ │ ├── 0096.unit │ │ │ ├── 0098.stmt │ │ │ └── 0099.stmt │ │ ├── 0100 │ │ │ ├── 0100.stmt │ │ │ ├── 0102.stmt │ │ │ ├── 0108.unit │ │ │ ├── 0109.unit │ │ │ ├── 0110.stmt │ │ │ ├── 0111.unit │ │ │ ├── 0112.stmt │ │ │ ├── 0113.unit │ │ │ ├── 0114.unit │ │ │ ├── 0115.stmt │ │ │ ├── 0119.stmt │ │ │ ├── 0121.stmt │ │ │ ├── 0122.unit │ │ │ ├── 0130.unit │ │ │ ├── 0132.stmt │ │ │ ├── 0133.stmt │ │ │ ├── 0135.stmt │ │ │ ├── 0137.stmt │ │ │ ├── 0139.unit │ │ │ ├── 0140.stmt │ │ │ ├── 0141.unit │ │ │ ├── 0142.stmt │ │ │ ├── 0144.unit │ │ │ ├── 0146.unit │ │ │ ├── 0151.unit │ │ │ ├── 0152.unit │ │ │ ├── 0154.stmt │ │ │ ├── 0155.stmt │ │ │ ├── 0156.unit │ │ │ ├── 0158.unit │ │ │ ├── 0161.stmt │ │ │ ├── 0162.stmt │ │ │ ├── 0168.unit │ │ │ ├── 0170.unit │ │ │ ├── 0171.unit │ │ │ ├── 0176.unit │ │ │ ├── 0177.stmt │ │ │ ├── 0178.unit │ │ │ ├── 0184.unit │ │ │ ├── 0185.stmt │ │ │ ├── 0186.stmt │ │ │ ├── 0187.stmt │ │ │ ├── 0188.stmt │ │ │ ├── 0189.stmt │ │ │ ├── 0192.unit │ │ │ ├── 0197.unit │ │ │ ├── 0198.stmt │ │ │ └── 0199.stmt │ │ ├── 0200 │ │ │ ├── 0200.stmt │ │ │ ├── 0201.stmt │ │ │ ├── 0203.stmt │ │ │ ├── 0204.stmt │ │ │ ├── 0205.stmt │ │ │ ├── 0206.stmt │ │ │ ├── 0211.unit │ │ │ ├── 0212.stmt │ │ │ ├── 0217.stmt │ │ │ ├── 0218.stmt │ │ │ ├── 0220.stmt │ │ │ ├── 0221.unit │ │ │ ├── 0222.stmt │ │ │ ├── 0223.stmt │ │ │ ├── 0224.stmt │ │ │ ├── 0226.stmt │ │ │ ├── 0228.unit │ │ │ ├── 0229.unit │ │ │ ├── 0232.unit │ │ │ ├── 0235.unit │ │ │ ├── 0236.unit │ │ │ ├── 0237.unit │ │ │ ├── 0238.unit │ │ │ ├── 0241.unit │ │ │ ├── 0242.unit │ │ │ ├── 0243.stmt │ │ │ ├── 0247.unit │ │ │ ├── 0249.stmt │ │ │ ├── 0250.unit │ │ │ ├── 0255.stmt │ │ │ ├── 0256.unit │ │ │ ├── 0257.unit │ │ │ ├── 0258.unit │ │ │ └── 0259.unit │ │ ├── 0300 │ │ │ ├── 0357.stmt │ │ │ ├── 0360.stmt │ │ │ ├── 0361.unit │ │ │ ├── 0364.unit │ │ │ ├── 0366.stmt │ │ │ ├── 0367.stmt │ │ │ ├── 0368.unit │ │ │ ├── 0369.stmt │ │ │ ├── 0370.stmt │ │ │ ├── 0373.unit │ │ │ ├── 0374.stmt │ │ │ ├── 0375.stmt │ │ │ ├── 0377.stmt │ │ │ ├── 0378.stmt │ │ │ ├── 0379.stmt │ │ │ ├── 0380.unit │ │ │ ├── 0381.unit │ │ │ ├── 0382.unit │ │ │ ├── 0383.unit │ │ │ ├── 0384.stmt │ │ │ ├── 0387.unit │ │ │ ├── 0388.unit │ │ │ ├── 0389.unit │ │ │ ├── 0391.stmt │ │ │ ├── 0394.stmt │ │ │ ├── 0398.stmt │ │ │ └── 0399.unit │ │ ├── 0400 │ │ │ ├── 0404.stmt │ │ │ ├── 0407.unit │ │ │ ├── 0409.stmt │ │ │ ├── 0410.stmt │ │ │ ├── 0413.unit │ │ │ ├── 0420.unit │ │ │ ├── 0421.unit │ │ │ ├── 0422.unit │ │ │ ├── 0424.stmt │ │ │ ├── 0429.stmt │ │ │ ├── 0434.unit │ │ │ ├── 0436.unit │ │ │ ├── 0437.unit │ │ │ ├── 0438.stmt │ │ │ ├── 0439.stmt │ │ │ ├── 0441.unit │ │ │ ├── 0443.unit │ │ │ ├── 0444.unit │ │ │ ├── 0448.stmt │ │ │ ├── 0449.stmt │ │ │ ├── 0454.unit │ │ │ ├── 0456.unit │ │ │ ├── 0461.stmt │ │ │ ├── 0462.unit │ │ │ ├── 0463.unit │ │ │ ├── 0465.stmt │ │ │ ├── 0466.unit │ │ │ ├── 0467.unit │ │ │ ├── 0474.unit │ │ │ ├── 0475.unit │ │ │ ├── 0478.stmt │ │ │ ├── 0479.stmt │ │ │ ├── 0480.unit │ │ │ ├── 0481.unit │ │ │ ├── 0484.stmt │ │ │ ├── 0488.stmt │ │ │ ├── 0489.stmt │ │ │ ├── 0494.unit │ │ │ ├── 0496.stmt │ │ │ └── 0497.unit │ │ ├── 0500 │ │ │ ├── 0500.unit │ │ │ ├── 0503.unit │ │ │ ├── 0506.unit │ │ │ ├── 0511.unit │ │ │ ├── 0513.unit │ │ │ ├── 0514.unit │ │ │ ├── 0519.stmt │ │ │ ├── 0520.unit │ │ │ ├── 0527.stmt │ │ │ ├── 0529.unit │ │ │ ├── 0541.unit │ │ │ ├── 0543.unit │ │ │ ├── 0548.stmt │ │ │ ├── 0557.unit │ │ │ ├── 0558.unit │ │ │ ├── 0566.unit │ │ │ ├── 0568.unit │ │ │ ├── 0571.unit │ │ │ ├── 0581.stmt │ │ │ ├── 0582.unit │ │ │ ├── 0584.unit │ │ │ ├── 0585.unit │ │ │ ├── 0589.unit │ │ │ ├── 0591.unit │ │ │ ├── 0594.stmt │ │ │ └── 0596.stmt │ │ ├── 0600 │ │ │ ├── 0606.unit │ │ │ ├── 0613.unit │ │ │ ├── 0616.unit │ │ │ ├── 0619.unit │ │ │ ├── 0620.unit │ │ │ ├── 0621.stmt │ │ │ ├── 0624.unit │ │ │ ├── 0648.stmt │ │ │ ├── 0658.unit │ │ │ ├── 0665.stmt │ │ │ ├── 0679.unit │ │ │ ├── 0680.stmt │ │ │ └── 0684.stmt │ │ ├── 0700 │ │ │ ├── 0704.unit │ │ │ ├── 0705.stmt │ │ │ ├── 0711.stmt │ │ │ ├── 0713.stmt │ │ │ ├── 0721.unit │ │ │ ├── 0722.stmt │ │ │ ├── 0731.stmt │ │ │ ├── 0755.unit │ │ │ ├── 0760.stmt │ │ │ ├── 0765.stmt │ │ │ ├── 0771.unit │ │ │ ├── 0782.unit │ │ │ ├── 0785.unit │ │ │ ├── 0792.unit │ │ │ ├── 0796.unit │ │ │ ├── 0798.stmt │ │ │ └── 0799.unit │ │ ├── 0800 │ │ │ ├── 0802.unit │ │ │ ├── 0809.unit │ │ │ ├── 0831.unit │ │ │ ├── 0837.unit │ │ │ ├── 0843.stmt │ │ │ ├── 0855.unit │ │ │ ├── 0860.unit │ │ │ ├── 0861.unit │ │ │ ├── 0862.unit │ │ │ ├── 0869.stmt │ │ │ ├── 0881.unit │ │ │ └── 0888.unit │ │ ├── 0900 │ │ │ ├── 0900.stmt │ │ │ ├── 0927.unit │ │ │ ├── 0960.unit │ │ │ ├── 0966.stmt │ │ │ ├── 0987.stmt │ │ │ ├── 0989.stmt │ │ │ └── 0999.unit │ │ └── other │ │ │ ├── dart.unit │ │ │ ├── flutter.unit │ │ │ ├── large.stmt │ │ │ ├── misc.stmt │ │ │ ├── misc.unit │ │ │ └── tall_prototype.unit │ ├── statement │ │ ├── assert.stmt │ │ ├── block.stmt │ │ ├── block_comment.stmt │ │ ├── do_while.stmt │ │ ├── expression.stmt │ │ ├── for.stmt │ │ ├── for_comment.stmt │ │ ├── for_declaration.stmt │ │ ├── for_in.stmt │ │ ├── for_in_comment.stmt │ │ ├── for_initializer.stmt │ │ ├── for_metadata.stmt │ │ ├── if.stmt │ │ ├── if_case.stmt │ │ ├── if_case_comment.stmt │ │ ├── if_comment.stmt │ │ ├── other.stmt │ │ ├── other_comment.stmt │ │ ├── return.stmt │ │ ├── return_comment.stmt │ │ ├── switch.stmt │ │ ├── switch_comment.stmt │ │ ├── switch_guard.stmt │ │ ├── switch_legacy.stmt │ │ ├── try.stmt │ │ ├── try_comment.stmt │ │ ├── while.stmt │ │ └── while_comment.stmt │ ├── top_level │ │ ├── comment.unit │ │ ├── export.unit │ │ ├── import.unit │ │ ├── import_comment.unit │ │ ├── library.unit │ │ ├── library_comment.unit │ │ ├── metadata.unit │ │ ├── mixed.unit │ │ ├── part.unit │ │ ├── script.unit │ │ ├── script_comment.unit │ │ ├── show_hide.unit │ │ └── whitespace.unit │ ├── type │ │ ├── function.stmt │ │ ├── function_comment.stmt │ │ ├── metadata.stmt │ │ ├── named.stmt │ │ ├── record.stmt │ │ ├── record_comment.stmt │ │ └── type_argument.stmt │ └── variable │ │ ├── local.stmt │ │ ├── local_comment.stmt │ │ ├── metadata.unit │ │ ├── metadata_comment.unit │ │ ├── pattern.stmt │ │ ├── top_level.unit │ │ └── top_level_comment.unit ├── tall_format_test.dart └── utils.dart └── tool ├── change_metrics.dart ├── grind.dart └── update_tests.dart /.github/ISSUE_TEMPLATE/other-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug or feature request 3 | about: A bug, crash, feature request, or API change request 4 | title: "[Bug or feature request]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | If the bug is about the formatter producing output you don't like, please use the "Formatting issue" template. 11 | 12 | **Describe the issue** 13 | 14 | A clear and concise description of what the problem is... 15 | 16 | **To Reproduce** 17 | 18 | Steps to reproduce the behavior... 19 | 20 | **Expected behavior** 21 | 22 | A clear and concise description of what you expected to happen... 23 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | # A CI configuration to auto-publish pub packages. 2 | 3 | name: Publish 4 | 5 | on: 6 | pull_request: 7 | branches: [ main ] 8 | types: [opened, synchronize, reopened, labeled, unlabeled] 9 | push: 10 | tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] 11 | 12 | jobs: 13 | publish: 14 | uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main 15 | permissions: 16 | id-token: write 17 | pull-requests: write 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # https://dart.dev/guides/libraries/private-files 2 | .dart_tool/ 3 | pubspec.lock 4 | 5 | # Don't commit the baseline file since it's used for local performance 6 | # measurement and comparison. 7 | benchmark/baseline.json 8 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file with this pattern: 2 | # 3 | # For individuals: 4 | # Name 5 | # 6 | # For organizations: 7 | # Organization 8 | # 9 | Google Inc. <*@google.com> -------------------------------------------------------------------------------- /benchmark/case/curry.unit: -------------------------------------------------------------------------------- 1 | // Test deeply nested lambdas. 2 | main() { 3 | success((x1) => (x2) => (x3) => (x4) => (x5) => (x6) => (x7) => (x8) => (x9) => 4 | (x10) => (x11) => (x12) => (x13) => (x14) => (x15) => (x16) => [x1, x2, x3, x4, 5 | x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16]) * p1 * p2 * p3 * p4 * 6 | p5 * p6 * p7 * p8 * p9 * p10 * p11 * p12 * p13 * p14 * p15 * p16; 7 | } -------------------------------------------------------------------------------- /benchmark/case/curry_2.expect_short: -------------------------------------------------------------------------------- 1 | typedef Map1 = R Function(T1 arg1); 2 | 3 | typedef Map8 = R Function( 4 | T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); 5 | 6 | extension Curry8 7 | on Map8 { 8 | Map1< 9 | T1, 10 | Map1>>>>>>> 12 | get curry => (T1 arg1) => (T2 arg2) => (T3 arg3) => (T4 arg4) => 13 | (T5 arg5) => (T6 arg6) => (T7 arg7) => 14 | (T8 arg8) => this(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); 15 | } 16 | -------------------------------------------------------------------------------- /benchmark/case/curry_2.unit: -------------------------------------------------------------------------------- 1 | typedef Map1 = R Function(T1 arg1); 2 | 3 | typedef Map8 = R Function( 4 | T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); 5 | 6 | extension Curry8 7 | on Map8 { 8 | Map1< 9 | T1, 10 | Map1>>>>>>> 12 | get curry => (T1 arg1) => (T2 arg2) => (T3 arg3) => (T4 arg4) => 13 | (T5 arg5) => (T6 arg6) => (T7 arg7) => 14 | (T8 arg8) => this(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); 15 | } 16 | -------------------------------------------------------------------------------- /dist/dart-style.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for dart-style 2 | 3 | interface FormatResult { 4 | code?: string; 5 | error?: string; 6 | } 7 | 8 | export function formatCode(code: string): FormatResult; 9 | -------------------------------------------------------------------------------- /lib/dart_style.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | export 'src/dart_formatter.dart'; 5 | export 'src/exceptions.dart'; 6 | export 'src/source_code.dart'; 7 | -------------------------------------------------------------------------------- /lib/src/short/marking_scheme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// A mixin for marking classes. 6 | mixin Markable { 7 | bool _isMarked = false; 8 | 9 | bool mark() { 10 | if (_isMarked) return false; 11 | _isMarked = true; 12 | return true; 13 | } 14 | 15 | bool get isMarked => _isMarked; 16 | 17 | void unmark() { 18 | _isMarked = false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/short/regression/0000/0005.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var overlapping = _directories.keys.where((directory) => 3 | path.isWithin(directory, rootDirectory) || 4 | path.isWithin(rootDirectory, directory)).toList(); 5 | <<< 6 | var overlapping = _directories.keys 7 | .where((directory) => 8 | path.isWithin(directory, rootDirectory) || 9 | path.isWithin(rootDirectory, directory)) 10 | .toList(); 11 | >>> 12 | return isLoopback(server.address.host) == isLoopback(url.host) || 13 | server.address.host == url.host; 14 | <<< 15 | return isLoopback(server.address.host) == isLoopback(url.host) || 16 | server.address.host == url.host; -------------------------------------------------------------------------------- /test/short/regression/0000/0006.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | return _provideDirectorySources(graph.packages[package], "bin").then((_) => BarbackServer.bind( 3 | this, _hostname, 0, package: package, rootDirectory: "bin")); 4 | <<< 5 | return _provideDirectorySources(graph.packages[package], "bin").then((_) => 6 | BarbackServer.bind(this, _hostname, 0, 7 | package: package, rootDirectory: "bin")); 8 | >>> 9 | messageMentionsAsset(id) => 10 | messageMentions(id.toString()) || 11 | messageMentions(path.fromUri(entry.assetId.path)); 12 | <<< 13 | messageMentionsAsset(id) => 14 | messageMentions(id.toString()) || 15 | messageMentions(path.fromUri(entry.assetId.path)); -------------------------------------------------------------------------------- /test/short/regression/0000/0009.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | List> _stageTransformers( 3 | Map> transformerDependencies) {} 4 | <<< 5 | List> _stageTransformers( 6 | Map> transformerDependencies) {} -------------------------------------------------------------------------------- /test/short/regression/0000/0013.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> no trailing whitespace before initializer comment 3 | class A { 4 | A() 5 | // comment 6 | : field = value; 7 | } 8 | <<< 9 | class A { 10 | A() 11 | // comment 12 | : field = value; 13 | } 14 | >>> no trailing whitespace before initializer comment when params wrap 15 | class A { 16 | A(some, very, long, parameter, list, that, wraps) 17 | // comment 18 | : field = value; 19 | } 20 | <<< 21 | class A { 22 | A(some, very, long, parameter, list, 23 | that, wraps) 24 | // comment 25 | : field = value; 26 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0014.unit: -------------------------------------------------------------------------------- 1 | >>> https://github.com/dart-lang/dart_style/issues/14 2 | class A { 3 | final Map x; 4 | A() : x = { 5 | // comment 6 | 'foo': 1, 7 | 'bar': 2, 8 | }; 9 | } 10 | <<< 11 | class A { 12 | final Map x; 13 | A() 14 | : x = { 15 | // comment 16 | 'foo': 1, 17 | 'bar': 2, 18 | }; 19 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0026.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | experimentalBootstrap = document 3 | .querySelectorAll('link') 4 | .any((link) => link.attributes['rel'] == 5 | 'import' && link.attributes['href'] == POLYMER_EXPERIMENTAL_HTML); 6 | <<< 7 | experimentalBootstrap = document.querySelectorAll('link').any((link) => 8 | link.attributes['rel'] == 'import' && 9 | link.attributes['href'] == POLYMER_EXPERIMENTAL_HTML); -------------------------------------------------------------------------------- /test/short/regression/0000/0027.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | if (tag == 'style' || tag == 'script' && 3 | (type == null || type == TYPE_JS || type == TYPE_DART) || 4 | tag == 'link' && (rel == 'stylesheet' || rel == 'import')) {} 5 | <<< 6 | if (tag == 'style' || 7 | tag == 'script' && 8 | (type == null || type == TYPE_JS || type == TYPE_DART) || 9 | tag == 'link' && (rel == 'stylesheet' || rel == 'import')) {} -------------------------------------------------------------------------------- /test/short/regression/0000/0028.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool _hasLibraryDirective(String code) => 3 | parseDirectives(code, suppressErrors: true) 4 | .directives.any((d) => d is LibraryDirective); 5 | <<< 6 | bool _hasLibraryDirective(String code) => 7 | parseDirectives(code, suppressErrors: true) 8 | .directives 9 | .any((d) => d is LibraryDirective); -------------------------------------------------------------------------------- /test/short/regression/0000/0033.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | if (maximumIntegerDigits > 3 | 1 && maximumIntegerDigits > minimumIntegerDigits) {} 4 | <<< 5 | if (maximumIntegerDigits > 1 && 6 | maximumIntegerDigits > minimumIntegerDigits) {} 7 | >>> (indent 4) 8 | while (fractionCodes[fractionLength - 9 | 1] == _zero && fractionLength > minimumFractionDigits + 1) {} 10 | <<< 11 | while (fractionCodes[fractionLength - 1] == _zero && 12 | fractionLength > minimumFractionDigits + 1) {} -------------------------------------------------------------------------------- /test/short/regression/0000/0036.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | String prologue(String locale) => """ 3 | /** 4 | * DO NOT EDIT. This is code generated via pkg/intl/generate_localized.dart 5 | * This is a library that provides messages for a $locale locale. All the 6 | ... 7 | """; 8 | <<< 9 | String prologue(String locale) => """ 10 | /** 11 | * DO NOT EDIT. This is code generated via pkg/intl/generate_localized.dart 12 | * This is a library that provides messages for a $locale locale. All the 13 | ... 14 | """; -------------------------------------------------------------------------------- /test/short/regression/0000/0039.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | var serialization1 = new Serialization(format: format) 3 | ..addRules(rules.values); 4 | <<< 5 | var serialization1 = new Serialization(format: format) 6 | ..addRules(rules.values); -------------------------------------------------------------------------------- /test/short/regression/0000/0040.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var s = new Serialization() 3 | ..addRuleFor(Various, constructor: "Foo", constructorFields: [ 4 | "d", 5 | "e" 6 | ]); 7 | <<< 8 | var s = new Serialization() 9 | ..addRuleFor(Various, constructor: "Foo", constructorFields: ["d", "e"]); 10 | >>> (indent 6) 11 | var s = new Serialization() 12 | ..addRuleFor(Various, constructor: "Foo", constructorFields: [ 13 | "d", 14 | "e" 15 | ]); 16 | <<< 17 | var s = new Serialization() 18 | ..addRuleFor(Various, 19 | constructor: "Foo", constructorFields: ["d", "e"]); -------------------------------------------------------------------------------- /test/short/regression/0000/0041.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | return new Serialization.blank()..namedObjects['Node'] =reflect(new Node('')).type; 3 | <<< 4 | return new Serialization.blank() 5 | ..namedObjects['Node'] = reflect(new Node('')).type; -------------------------------------------------------------------------------- /test/short/regression/0000/0042.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | import 'dart:io' show Alphabet, Bookings, Calendar, Dentist, Elephant; 4 | <<< 5 | import 'dart:io' 6 | show 7 | Alphabet, 8 | Bookings, 9 | Calendar, 10 | Dentist, 11 | Elephant; -------------------------------------------------------------------------------- /test/short/regression/0000/0045.stmt: -------------------------------------------------------------------------------- 1 | >>> doesn't wrap after condition on single-line ifs 2 | foo() { 3 | if (xxxxxxxxxxxxxxxx || xxxxxxxxxxxxxxxxxxxxx) 4 | return xxxxxxxxxxxxxx ? xxxxxxxxxxxxxxxxxxxx : xxxxxxxxxxxxxxxxxxxxxxxxxx; 5 | } 6 | <<< 7 | foo() { 8 | if (xxxxxxxxxxxxxxxx || xxxxxxxxxxxxxxxxxxxxx) 9 | return xxxxxxxxxxxxxx ? xxxxxxxxxxxxxxxxxxxx : xxxxxxxxxxxxxxxxxxxxxxxxxx; 10 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0046.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() { 3 | if (true) 4 | // comment! 5 | return 0; 6 | } 7 | <<< 8 | foo() { 9 | if (true) 10 | // comment! 11 | return 0; 12 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0047.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | String say(String from, String msg, 3 | [String device='carrier pigeon', String mood]) {} 4 | <<< 5 | String say(String from, String msg, 6 | [String device = 'carrier pigeon', String mood]) {} -------------------------------------------------------------------------------- /test/short/regression/0000/0049.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var hawaiianBeaches = { 3 | 'oahu' : ['waikiki', 'kailua', 'waimanalo'], 4 | 'big island' : ['wailea bay', 'pololu beach'], 5 | 'kauai' : ['hanalei', 'poipu'] 6 | }; 7 | <<< 8 | var hawaiianBeaches = { 9 | 'oahu': ['waikiki', 'kailua', 'waimanalo'], 10 | 'big island': ['wailea bay', 'pololu beach'], 11 | 'kauai': ['hanalei', 'poipu'] 12 | }; -------------------------------------------------------------------------------- /test/short/regression/0000/0050.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | inputStream 3 | .transform(utf8.decoder) 4 | .transform(new LineSplitter()) 5 | .listen( 6 | (String line) { 7 | print('Got ${line.length} characters from stream'); 8 | }, 9 | onDone: () { print('file is now closed'); }, 10 | onError: (e) { print(e.toString()); }); 11 | <<< 12 | inputStream.transform(utf8.decoder).transform(new LineSplitter()).listen( 13 | (String line) { 14 | print('Got ${line.length} characters from stream'); 15 | }, onDone: () { 16 | print('file is now closed'); 17 | }, onError: (e) { 18 | print(e.toString()); 19 | }); -------------------------------------------------------------------------------- /test/short/regression/0000/0054.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | httpClient.getUrl(url) 3 | .then((HttpClientRequest request) { 4 | print('have request'); 5 | return request.close(); 6 | }) 7 | .then((HttpClientResponse response) { 8 | body; 9 | }); 10 | <<< 11 | httpClient.getUrl(url).then((HttpClientRequest request) { 12 | print('have request'); 13 | return request.close(); 14 | }).then((HttpClientResponse response) { 15 | body; 16 | }); -------------------------------------------------------------------------------- /test/short/regression/0000/0056.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | _sources[uri] = src = new _MockSdkSource(uri, 'library dart.${uri.path};'); 3 | <<< 4 | _sources[uri] = 5 | src = new _MockSdkSource(uri, 'library dart.${uri.path};'); -------------------------------------------------------------------------------- /test/short/regression/0000/0057.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | embeddedPlural2(n) => Intl.message( 3 | "${Intl.plural(n, 4 | zero: 'none', one: 'one', other: 'some')} plus some text.", 5 | name: 'embeddedPlural2', desc: 'An embedded plural', args: [n]); 6 | <<< 7 | embeddedPlural2(n) => Intl.message( 8 | "${Intl.plural(n, zero: 'none', one: 'one', other: 'some')} plus some text.", 9 | name: 'embeddedPlural2', 10 | desc: 'An embedded plural', 11 | args: [n]); -------------------------------------------------------------------------------- /test/short/regression/0000/0058.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool doStuff(String firstArgX, {String secondArg, String arg3foo, Map anotherArg, bool yetAnotherArg: false, bool tooManyArgs: true}) {} 4 | <<< 5 | bool doStuff(String firstArgX, 6 | {String secondArg, 7 | String arg3foo, 8 | Map anotherArg, 9 | bool yetAnotherArg: false, 10 | bool tooManyArgs: true}) {} -------------------------------------------------------------------------------- /test/short/regression/0000/0060.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var paths = new Directory(inputDir).listSync() 3 | .where((f) => f is File).map((f) => f.path) 4 | .where((p) => p.endsWith('.dart') && filePattern.hasMatch(p)); 5 | <<< 6 | var paths = new Directory(inputDir) 7 | .listSync() 8 | .where((f) => f is File) 9 | .map((f) => f.path) 10 | .where((p) => p.endsWith('.dart') && filePattern.hasMatch(p)); -------------------------------------------------------------------------------- /test/short/regression/0000/0061.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo extends Bar { 3 | qux(n) { 4 | // Do some stuff 5 | if (x != null && x.y == n.z 6 | // and some other stuff. 7 | && n.parent.x != y) { 8 | // 9 | } 10 | } 11 | } 12 | <<< 13 | class Foo extends Bar { 14 | qux(n) { 15 | // Do some stuff 16 | if (x != null && 17 | x.y == n.z 18 | // and some other stuff. 19 | && 20 | n.parent.x != y) { 21 | // 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0066.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | void _queriesTest(HttpRequest request) { 3 | var queries = _parseInt(request.uri.queryParameters['queries']).clamp(1, 500); 4 | } 5 | <<< 6 | void _queriesTest(HttpRequest request) { 7 | var queries = _parseInt(request.uri.queryParameters['queries']).clamp(1, 500); 8 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0069.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var x = foo(""" 3 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 4 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 5 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 6 | """); 7 | <<< 8 | var x = foo(""" 9 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 10 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 11 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 12 | """); 13 | >>> 14 | var map = { 15 | 'key------': ''' 16 | ----------------- 17 | ----------------- 18 | ----------------- 19 | ''', 20 | }; 21 | <<< 22 | var map = { 23 | 'key------': ''' 24 | ----------------- 25 | ----------------- 26 | ----------------- 27 | ''', 28 | }; -------------------------------------------------------------------------------- /test/short/regression/0000/0070.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | bool isSdkDir(String dirname) => new File( 3 | path.join(dirname, 'lib', '_internal', 'libraries.dart')).existsSync(); 4 | <<< 5 | bool isSdkDir(String dirname) => 6 | new File(path.join(dirname, 'lib', '_internal', 'libraries.dart')) 7 | .existsSync(); -------------------------------------------------------------------------------- /test/short/regression/0000/0071.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | expect(testFiles.containsKey('/main.dart'), isTrue, 4 | reason: '`/main.dart` is missing in testFiles'); 5 | } 6 | <<< 7 | void main() { 8 | expect(testFiles.containsKey('/main.dart'), isTrue, 9 | reason: '`/main.dart` is missing in testFiles'); 10 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0072.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class A { 3 | foo() { 4 | // comment #1 5 | if (comment != null && comment.end == token.offset 6 | // comment #2 7 | && node.parent.beginToken != token) { 8 | } 9 | } 10 | } 11 | <<< 12 | class A { 13 | foo() { 14 | // comment #1 15 | if (comment != null && 16 | comment.end == token.offset 17 | // comment #2 18 | && 19 | node.parent.beginToken != token) {} 20 | } 21 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0077.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var results = blablablabla(uri, sdkDir: shouldMockSdk ? null : 3 | dartSdkPath, mockSdkSources: shouldBlaBlab ? someBlaBlablab : 4 | null, someargn: args['blalbala'], fooBazzzz: fooBazzzz); 5 | <<< 6 | var results = blablablabla(uri, 7 | sdkDir: shouldMockSdk ? null : dartSdkPath, 8 | mockSdkSources: shouldBlaBlab ? someBlaBlablab : null, 9 | someargn: args['blalbala'], 10 | fooBazzzz: fooBazzzz); -------------------------------------------------------------------------------- /test/short/regression/0000/0081.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | var aLocalVar12 = new APrettyClass(APrettyClass.aStaticMethodOnIt(anArgument)); 3 | <<< 4 | var aLocalVar12 = 5 | new APrettyClass(APrettyClass.aStaticMethodOnIt(anArgument)); 6 | >>> 7 | main() { 8 | variableName.methodName( 9 | level, span.message(error.message, color: colorOf(severity.name))); 10 | } 11 | <<< 12 | main() { 13 | variableName.methodName( 14 | level, span.message(error.message, color: colorOf(severity.name))); 15 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0082.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var mymap = { 3 | // foo 4 | 'key': ''' 5 | value value value value value value value value value value value value 6 | value value value value value value value value value 7 | ''', 8 | }; 9 | <<< 10 | var mymap = { 11 | // foo 12 | 'key': ''' 13 | value value value value value value value value value value value value 14 | value value value value value value value value value 15 | ''', 16 | }; -------------------------------------------------------------------------------- /test/short/regression/0000/0083.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | test('some string here', () { 4 | return aVeryLongFunctionThatNeedsToWrap(toASecondLine, wrapWap, onThe, 5 | argsHere).then((_) { 6 | someLongFunctionHereToo( 7 | 'value value value value value value valvalue value value value'); 8 | }); 9 | }); 10 | } 11 | <<< 12 | main() { 13 | test('some string here', () { 14 | return aVeryLongFunctionThatNeedsToWrap( 15 | toASecondLine, wrapWap, onThe, argsHere) 16 | .then((_) { 17 | someLongFunctionHereToo( 18 | 'value value value value value value valvalue value value value'); 19 | }); 20 | }); 21 | } -------------------------------------------------------------------------------- /test/short/regression/0000/0085.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @MyGlobal() 3 | final SomeType type; 4 | <<< 5 | @MyGlobal() 6 | final SomeType type; -------------------------------------------------------------------------------- /test/short/regression/0000/0086.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'package:analyzer/src/generated/element.dart' show LibraryElement, CompilationUnitElement; 3 | <<< 4 | import 'package:analyzer/src/generated/element.dart' 5 | show LibraryElement, CompilationUnitElement; -------------------------------------------------------------------------------- /test/short/regression/0000/0089.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | #!/usr/bin/env dart 3 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 4 | // for details. All rights reserved. Use of this source code is governed by a 5 | // BSD-style license that can be found in the LICENSE file. 6 | <<< 7 | #!/usr/bin/env dart 8 | 9 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 10 | // for details. All rights reserved. Use of this source code is governed by a 11 | // BSD-style license that can be found in the LICENSE file. -------------------------------------------------------------------------------- /test/short/regression/0000/0091.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | expect(Bidi.guardBracketInHtml(strWithRtl2), 3 | equals("\u05d0 a (asc:))")); 4 | <<< 5 | expect(Bidi.guardBracketInHtml(strWithRtl2), 6 | equals("\u05d0 a (asc:))")); -------------------------------------------------------------------------------- /test/short/regression/0000/0095.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | String lookupMessage( 3 | String message_str, [final String desc = '', final Map examples = const { 4 | }, String locale, String name, List args, String meaning]) => 5 | message_str; 6 | <<< 7 | String lookupMessage(String message_str, 8 | [final String desc = '', 9 | final Map examples = const {}, 10 | String locale, 11 | String name, 12 | List args, 13 | String meaning]) => 14 | message_str; -------------------------------------------------------------------------------- /test/short/regression/0000/0098.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var camelSuperClass = 3 | superClass.split('-').map((e) => _toCamelCase(e)).join(''); 4 | <<< 5 | var camelSuperClass = 6 | superClass.split('-').map((e) => _toCamelCase(e)).join(''); -------------------------------------------------------------------------------- /test/short/regression/0000/0099.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | String html = ''' 3 | some long string that does not fit in one line along with the type 4 | '''; 5 | <<< 6 | String html = ''' 7 | some long string that does not fit in one line along with the type 8 | '''; -------------------------------------------------------------------------------- /test/short/regression/0100/0100.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | void incrementalAdd(Constraint c) { 3 | int mark = newMark(); 4 | for (Constraint overridden = c.satisfy(mark); 5 | overridden != null; 6 | overridden = overridden.satisfy(mark)); 7 | } 8 | <<< 9 | void incrementalAdd(Constraint c) { 10 | int mark = newMark(); 11 | for (Constraint overridden = c.satisfy(mark); 12 | overridden != null; 13 | overridden = overridden.satisfy(mark)); 14 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0102.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | isTwoWay = !isEvent && bindings.isWhole && (isCustomTag || 3 | tag == 'input' && (name == 'value' || name =='checked') || 4 | tag == 'select' && (name == 'selectedindex' || name == 'value') || 5 | tag == 'textarea' && name == 'value'); 6 | <<< 7 | isTwoWay = !isEvent && 8 | bindings.isWhole && 9 | (isCustomTag || 10 | tag == 'input' && (name == 'value' || name == 'checked') || 11 | tag == 'select' && (name == 'selectedindex' || name == 'value') || 12 | tag == 'textarea' && name == 'value'); -------------------------------------------------------------------------------- /test/short/regression/0100/0109.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | library x.y.z; 3 | <<< 4 | library x.y.z; -------------------------------------------------------------------------------- /test/short/regression/0100/0110.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var long___________________________________________________________name = 3 | const Foo.named('long string long string long string', 'second arg').split( 4 | ','); 5 | <<< 6 | var long___________________________________________________________name = 7 | const Foo.named('long string long string long string', 'second arg') 8 | .split(','); -------------------------------------------------------------------------------- /test/short/regression/0100/0113.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() { 3 | // comment 4 | f() + 1; 5 | } 6 | <<< 7 | foo() { 8 | // comment 9 | f() + 1; 10 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0119.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | boardData 3 | ..drawPixels(op.getBitmapData('game_board_side_top'), tbr, new Point( 4 | 112 + i * 80, 0)); 5 | <<< 6 | boardData 7 | ..drawPixels(op.getBitmapData('game_board_side_top'), tbr, 8 | new Point(112 + i * 80, 0)); 9 | >>> (indent 6) 10 | var initialOffset = new Vector( 11 | SquareElement.SIZE * c.x, SquareElement.SIZE * c.y); 12 | <<< 13 | var initialOffset = 14 | new Vector(SquareElement.SIZE * c.x, SquareElement.SIZE * c.y); -------------------------------------------------------------------------------- /test/short/regression/0100/0130.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | int get screenY => window.screenTop + window.outerHeight - 3 | window.innerHeight - 4 | _borderWidth + 5 | clientY; 6 | <<< 7 | int get screenY => 8 | window.screenTop + 9 | window.outerHeight - 10 | window.innerHeight - 11 | _borderWidth + 12 | clientY; -------------------------------------------------------------------------------- /test/short/regression/0100/0132.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | for (; i < words.length; i++) { 3 | buffer.write(' '); 4 | buffer.write(words[i]); 5 | } 6 | <<< 7 | for (; i < words.length; i++) { 8 | buffer.write(' '); 9 | buffer.write(words[i]); 10 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0135.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var handler = new Cascade() 3 | .add((_) => new Response.notFound('handler 1')) 4 | .add((_) => new Response.ok('handler 2')).handler; 5 | <<< 6 | var handler = new Cascade() 7 | .add((_) => new Response.notFound('handler 1')) 8 | .add((_) => new Response.ok('handler 2')) 9 | .handler; -------------------------------------------------------------------------------- /test/short/regression/0100/0140.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | localsHandler.directLocals[localsHandler 3 | .getTypeVariableAsLocal(typeVariable)] = param; 4 | <<< 5 | localsHandler.directLocals[ 6 | localsHandler.getTypeVariableAsLocal(typeVariable)] = param; -------------------------------------------------------------------------------- /test/short/regression/0100/0141.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | void buildComplexSwitchStatement(ast.SwitchStatement node, 3 | Map constants, 4 | Map caseIndex, 5 | bool hasDefault) { 6 | ; 7 | } 8 | <<< 9 | void buildComplexSwitchStatement( 10 | ast.SwitchStatement node, 11 | Map constants, 12 | Map caseIndex, 13 | bool hasDefault) { 14 | ; 15 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0146.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | foo([1, 2, 4, 5, 6, 7, 8, 20], argument, argument, argument, argument, argument); 4 | } 5 | <<< 6 | main() { 7 | foo([1, 2, 4, 5, 6, 7, 8, 20], argument, argument, argument, argument, 8 | argument); 9 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0151.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Foo(int longArg1, int longArg2, int longArg3, int longArg4, int longArg5, 4 | int longArg6) : this._(longArg1); 5 | 6 | Foo._(int a); 7 | } 8 | <<< 9 | class Foo { 10 | Foo(int longArg1, int longArg2, int longArg3, int longArg4, int longArg5, 11 | int longArg6) 12 | : this._(longArg1); 13 | 14 | Foo._(int a); 15 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0152.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | someReallyLongFunctionName('a really really really really long argument', 4 | 'a really really really really long argument'); 5 | } 6 | <<< 7 | main() { 8 | someReallyLongFunctionName('a really really really really long argument', 9 | 'a really really really really long argument'); 10 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0154.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() async { 3 | await for(var x in y) { 4 | } 5 | } 6 | <<< 7 | foo() async { 8 | await for (var x in y) {} 9 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0155.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var from = node.baseType, to = node.convertedType; 3 | <<< 4 | var from = node.baseType, to = node.convertedType; -------------------------------------------------------------------------------- /test/short/regression/0100/0156.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | final bar; 4 | final baz; 5 | Foo(int this.bar(), this.baz); 6 | } 7 | <<< 8 | class Foo { 9 | final bar; 10 | final baz; 11 | Foo(int this.bar(), this.baz); 12 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0161.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var partOf = unit.directives.firstWhere((d) => d is PartOfDirective, 3 | orElse: () => null); 4 | <<< 5 | var partOf = unit.directives 6 | .firstWhere((d) => d is PartOfDirective, orElse: () => null); -------------------------------------------------------------------------------- /test/short/regression/0100/0168.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo {} 3 | class Bar {} 4 | <<< 5 | class Foo {} 6 | 7 | class Bar {} -------------------------------------------------------------------------------- /test/short/regression/0100/0170.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | print(- -2); 4 | } 5 | <<< 6 | main() { 7 | print(- -2); 8 | } 9 | >>> 10 | main() { 11 | var x = - --y; 12 | } 13 | <<< 14 | main() { 15 | var x = - --y; 16 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0176.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | Iterable generate() sync* { 3 | int i = 0; 4 | 5 | while (i++ < 100) { 6 | yield new Task(i, rnd.nextInt(100), calc); 7 | } 8 | } 9 | <<< 10 | Iterable generate() sync* { 11 | int i = 0; 12 | 13 | while (i++ < 100) { 14 | yield new Task(i, rnd.nextInt(100), calc); 15 | } 16 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0177.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | List l0 = /*info:InferredTypeLiteral*/[]; 3 | <<< 4 | List l0 = /*info:InferredTypeLiteral*/ []; -------------------------------------------------------------------------------- /test/short/regression/0100/0178.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'dart:async'; /* soup */ import 'dart:io'; 3 | 4 | void main() { 5 | print('hi'); 6 | } 7 | <<< 8 | import 'dart:async'; 9 | /* soup */ import 'dart:io'; 10 | 11 | void main() { 12 | print('hi'); 13 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0192.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | /// test 4 | Foo(); 5 | } 6 | <<< 7 | class Foo { 8 | /// test 9 | Foo(); 10 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0197.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class FormatterBugTest { 3 | final String _test; 4 | 5 | FormatterBugTest(@deprecated this._test); 6 | } 7 | <<< 8 | class FormatterBugTest { 9 | final String _test; 10 | 11 | FormatterBugTest(@deprecated this._test); 12 | } -------------------------------------------------------------------------------- /test/short/regression/0100/0199.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | final monitorTimeout = (utcTime.millisecondsSinceEpoch + 3 | 3 * Duration.MILLISECONDS_PER_MINUTE) / 4 | 1000; 5 | <<< 6 | final monitorTimeout = (utcTime.millisecondsSinceEpoch + 7 | 3 * Duration.MILLISECONDS_PER_MINUTE) / 8 | 1000; -------------------------------------------------------------------------------- /test/short/regression/0200/0200.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | final confirmationFuture = _dialogService.showConfirmationDialog( 3 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', 4 | new DialogSettings() 5 | ..primaryButton = DialogSettings.BUTTON_CANCEL 6 | ..okButtonText = 'OK' 7 | ..cancelButtonText = 'Kittens'); 8 | <<< 9 | final confirmationFuture = _dialogService.showConfirmationDialog( 10 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', 11 | new DialogSettings() 12 | ..primaryButton = DialogSettings.BUTTON_CANCEL 13 | ..okButtonText = 'OK' 14 | ..cancelButtonText = 'Kittens'); -------------------------------------------------------------------------------- /test/short/regression/0200/0201.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | var s = 4 | 'qsmdlfkjqlsdf mlqdskf mlqkds flq fdmlqk mqlfk ' 'mlfqks dflq sdmlfkjqmlsdkjf mlqks mfdlq smlf ' 'mqlskdjf mlqksd jfmlqkj dmflkq mdslk jfmqds kf'; 5 | } 6 | <<< 7 | main() { 8 | var s = 'qsmdlfkjqlsdf mlqdskf mlqkds flq fdmlqk mqlfk ' 9 | 'mlfqks dflq sdmlfkjqmlsdkjf mlqks mfdlq smlf ' 10 | 'mqlskdjf mlqksd jfmlqkj dmflkq mdslk jfmqds kf'; 11 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0203.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var constructedRequest = new Request() 3 | ..campaignId = 4 | (rollup.campaignId == null ? new Int64(0) : rollup.campaignId); 5 | <<< 6 | var constructedRequest = new Request() 7 | ..campaignId = (rollup.campaignId == null ? new Int64(0) : rollup.campaignId); 8 | >>> (indent 2) 9 | var constructedRequest = new Request() 10 | ..campaignId = 11 | (rollup.campaignId == null ? new Int64(0) : rollup.campaignId); 12 | <<< 13 | var constructedRequest = new Request() 14 | ..campaignId = 15 | (rollup.campaignId == null ? new Int64(0) : rollup.campaignId); -------------------------------------------------------------------------------- /test/short/regression/0200/0205.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | activity 3 | ..parameters[ 4 | requestDeserialization] = '${stopwatch.elapsedMilliseconds}'; 5 | <<< 6 | activity 7 | ..parameters[requestDeserialization] = '${stopwatch.elapsedMilliseconds}'; 8 | >>> (indent 6) 9 | activity 10 | ..parameters[ 11 | requestDeserialization] = '${stopwatch.elapsedMilliseconds}'; 12 | <<< 13 | activity 14 | ..parameters[requestDeserialization] = 15 | '${stopwatch.elapsedMilliseconds}'; -------------------------------------------------------------------------------- /test/short/regression/0200/0206.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | when(mockLoader.loadData(expectedRequestMetricInitialDateCTR)) 3 | .thenReturn( 4 | _buildMinimalResponseFuture(MetricType.CTR, metricRequest)); 5 | <<< 6 | when(mockLoader.loadData(expectedRequestMetricInitialDateCTR)) 7 | .thenReturn(_buildMinimalResponseFuture(MetricType.CTR, metricRequest)); -------------------------------------------------------------------------------- /test/short/regression/0200/0218.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | var player = body.animate( 3 | [{"font-size": "500px"}, {"font-size": fontSize}], {"duration": 100}); 4 | <<< 5 | var player = body.animate([ 6 | {"font-size": "500px"}, 7 | {"font-size": fontSize} 8 | ], { 9 | "duration": 100 10 | }); -------------------------------------------------------------------------------- /test/short/regression/0200/0222.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | clientParams.forEach((k, v) => log.info(() => 3 | "&${k}${(v != null) ? '=${v}' : ''}")); 4 | <<< 5 | clientParams 6 | .forEach((k, v) => log.info(() => "&${k}${(v != null) ? '=${v}' : ''}")); 7 | >>> (indent 4) 8 | clientParams.forEach((k, v) => log.info(() => 9 | "&${k}${(v != null) ? '=${v}' : ''}")); 10 | <<< 11 | clientParams.forEach( 12 | (k, v) => log.info(() => "&${k}${(v != null) ? '=${v}' : ''}")); -------------------------------------------------------------------------------- /test/short/regression/0200/0223.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | Foo barBaz() => new Quux({ 3 | 'alpha.beta.gamma': [ 4 | new Zuul({'yarrr': Abracadabra.OPEN_SESAME,}, { 5 | 'toil': {'trouble': {'fireBurn': {'cauldronBubble': EYE_OF_NEWT,}}} 6 | }) 7 | ] 8 | }); 9 | <<< 10 | Foo barBaz() => new Quux({ 11 | 'alpha.beta.gamma': [ 12 | new Zuul({ 13 | 'yarrr': Abracadabra.OPEN_SESAME, 14 | }, { 15 | 'toil': { 16 | 'trouble': { 17 | 'fireBurn': { 18 | 'cauldronBubble': EYE_OF_NEWT, 19 | } 20 | } 21 | } 22 | }) 23 | ] 24 | }); -------------------------------------------------------------------------------- /test/short/regression/0200/0226.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | test('Bad Request${(detail!='' ? ': ' : '')}$detail'); 3 | <<< 4 | test('Bad Request${(detail != '' ? ': ' : '')}$detail'); -------------------------------------------------------------------------------- /test/short/regression/0200/0228.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class SomeLongNameForAComponent implements AttachAware, ShadowRootAware, 3 | DetachAware, SomeExternalViewFactory, AnotherInterface { 4 | // ... 5 | } 6 | <<< 7 | class SomeLongNameForAComponent 8 | implements 9 | AttachAware, 10 | ShadowRootAware, 11 | DetachAware, 12 | SomeExternalViewFactory, 13 | AnotherInterface { 14 | // ... 15 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0229.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class SomeLongNameForAComponent { 3 | SomeLongNameForAComponent(DirectiveInjector injector, 4 | RenderSyncZoneAccess zoneAccess, 5 | this._formatters, 6 | this._element, 7 | this._scope); 8 | } 9 | <<< 10 | class SomeLongNameForAComponent { 11 | SomeLongNameForAComponent( 12 | DirectiveInjector injector, 13 | RenderSyncZoneAccess zoneAccess, 14 | this._formatters, 15 | this._element, 16 | this._scope); 17 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0232.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @Component( 3 | selector: 'foo-dialog', 4 | templateUrl: 'package:path.to.cool.foo/foo_dialog.html', 5 | exportExpressions: const [ 6 | 'nnnnnnnnState', 7 | 'mmmmmmmmTypeName', 8 | 'blockingId', 9 | 'closeTab', 10 | 'formIsValid', 11 | 'zzzzzzzzzNote' 12 | ]) 13 | class Foo {} 14 | <<< 15 | @Component( 16 | selector: 'foo-dialog', 17 | templateUrl: 'package:path.to.cool.foo/foo_dialog.html', 18 | exportExpressions: const [ 19 | 'nnnnnnnnState', 20 | 'mmmmmmmmTypeName', 21 | 'blockingId', 22 | 'closeTab', 23 | 'formIsValid', 24 | 'zzzzzzzzzNote' 25 | ]) 26 | class Foo {} -------------------------------------------------------------------------------- /test/short/regression/0200/0235.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class _MultiSelectionModelImpl 3 | extends ChangeNotifier 4 | with SelectionChangeNotifier 5 | implements SelectionModel { 6 | // ... 7 | } 8 | <<< 9 | class _MultiSelectionModelImpl extends ChangeNotifier 10 | with SelectionChangeNotifier 11 | implements SelectionModel { 12 | // ... 13 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0237.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Bar { 3 | void foo() { 4 | blah.method(someLongArgument, andAnotherOne, andAThirdOne, andOneMore) 5 | .then((var x) { 6 | var y = x * 2; 7 | }); 8 | } 9 | } 10 | <<< 11 | class Bar { 12 | void foo() { 13 | blah 14 | .method(someLongArgument, andAnotherOne, andAThirdOne, andOneMore) 15 | .then((var x) { 16 | var y = x * 2; 17 | }); 18 | } 19 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0238.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class ObjectBenchmark extends ObservationBenchmarkBase { 3 | ObjectBenchmark(int objectCount, int mutationCount, String config) : super( 4 | 'ObjectBenchmark:$objectCount:$mutationCount:$config', objectCount, 5 | mutationCount, config); 6 | } 7 | <<< 8 | class ObjectBenchmark extends ObservationBenchmarkBase { 9 | ObjectBenchmark(int objectCount, int mutationCount, String config) 10 | : super('ObjectBenchmark:$objectCount:$mutationCount:$config', 11 | objectCount, mutationCount, config); 12 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0242.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class PartyOrganizerInterviewer { 3 | PartyOrganizerInterviewer(@MinimumAgeRequirement int minAge) 4 | : isChampaignIncluded = partyModel 5 | .isPropertyTrue(Properties.IS_CHAMPAIGN_AVAILABLE) { 6 | this.isFoodIncluded = 7 | partyModel.isPropertyTrue(Properties.IS_FOOD_AVAILABLE); 8 | } 9 | } 10 | <<< 11 | class PartyOrganizerInterviewer { 12 | PartyOrganizerInterviewer(@MinimumAgeRequirement int minAge) 13 | : isChampaignIncluded = 14 | partyModel.isPropertyTrue(Properties.IS_CHAMPAIGN_AVAILABLE) { 15 | this.isFoodIncluded = 16 | partyModel.isPropertyTrue(Properties.IS_FOOD_AVAILABLE); 17 | } 18 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0249.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | clip.onTransitionEnd 3 | .where((TransitionEvent e) => e.propertyName == 'height') 4 | .first.then((_) => clip.classes.add('expanded')); 5 | <<< 6 | clip.onTransitionEnd 7 | .where((TransitionEvent e) => e.propertyName == 'height') 8 | .first 9 | .then((_) => clip.classes.add('expanded')); -------------------------------------------------------------------------------- /test/short/regression/0200/0250.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class VeryInterestingThing { 3 | factory VeryInterestingThing.fromJson( 4 | mylibrarythathasalongname.JsonData jsonData) => new VeryInterestingThing( 5 | otherlibrary.InterestingState.fromJson(jsonData.encodedState)); 6 | } 7 | <<< 8 | class VeryInterestingThing { 9 | factory VeryInterestingThing.fromJson( 10 | mylibrarythathasalongname.JsonData jsonData) => 11 | new VeryInterestingThing( 12 | otherlibrary.InterestingState.fromJson(jsonData.encodedState)); 13 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0255.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 10) 2 | return new Rewriter(code, codegen, 3 | mirrorMode: mirrorMode, writeStaticInit: writeStaticInit).rewrite( 4 | parseCompilationUnit(code, 5 | name: reflectionEntryPointPath, parseFunctionBodies: false)); 6 | <<< 7 | return new Rewriter(code, codegen, 8 | mirrorMode: mirrorMode, writeStaticInit: writeStaticInit) 9 | .rewrite(parseCompilationUnit(code, 10 | name: reflectionEntryPointPath, parseFunctionBodies: false)); -------------------------------------------------------------------------------- /test/short/regression/0200/0256.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | static final UNKNOWN_ERROR = new MapsEngineStatus._('UNKNOWN_ERROR', context[ 4 | 'google']['maps']['visualization']['MapsEngineStatus']['UNKNOWN_ERROR']); 5 | } 6 | <<< 7 | class Foo { 8 | static final UNKNOWN_ERROR = new MapsEngineStatus._( 9 | 'UNKNOWN_ERROR', 10 | context['google']['maps']['visualization']['MapsEngineStatus'] 11 | ['UNKNOWN_ERROR']); 12 | } -------------------------------------------------------------------------------- /test/short/regression/0200/0257.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class FooConstructor { 3 | FooConstructor(Object bar) 4 | : foo = (bar == null) 5 | ? 'bar is null this is a very long string that causes a split' 6 | : bar.myField; 7 | } 8 | <<< 9 | class FooConstructor { 10 | FooConstructor(Object bar) 11 | : foo = (bar == null) 12 | ? 'bar is null this is a very long string that causes a split' 13 | : bar.myField; 14 | } -------------------------------------------------------------------------------- /test/short/regression/0300/0357.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | bool theMethodNameGoesHere(ParameterTyp result) => reallyLongIdentifier 3 | .any((MyClass myParam) => myParam.id == result.myParam.id); 4 | <<< 5 | bool theMethodNameGoesHere(ParameterTyp result) => reallyLongIdentifier 6 | .any((MyClass myParam) => myParam.id == result.myParam.id); -------------------------------------------------------------------------------- /test/short/regression/0300/0364.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | static bool _identityEquality(JsObject a, JsObject b) native "JsObject_identityEquality"; 4 | 5 | static bool short(JsObject a, JsObject b) native "JsObject_identityEquality"; 6 | } 7 | <<< 8 | class Foo { 9 | static bool _identityEquality(JsObject a, JsObject b) 10 | native "JsObject_identityEquality"; 11 | 12 | static bool short(JsObject a, JsObject b) native "JsObject_identityEquality"; 13 | } -------------------------------------------------------------------------------- /test/short/regression/0300/0366.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | zoop( 3 | "zoop description here", 4 | spang(() { 5 | ; 6 | })); 7 | <<< 8 | zoop("zoop description here", spang(() { 9 | ; 10 | })); -------------------------------------------------------------------------------- /test/short/regression/0300/0373.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | TreeNode lookupEntity(Iterable iterable, int entity) => iterable 3 | .firstWhere((node) => (node.entity == entity), orElse: () => null); 4 | <<< 5 | TreeNode lookupEntity(Iterable iterable, int entity) => iterable 6 | .firstWhere((node) => (node.entity == entity), orElse: () => null); -------------------------------------------------------------------------------- /test/short/regression/0300/0374.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | shadowRoot.querySelector("#slide-out")..onKeyDown.listen(_hideOnEsc)..onClick.listen(hide); 3 | <<< 4 | shadowRoot.querySelector("#slide-out") 5 | ..onKeyDown.listen(_hideOnEsc) 6 | ..onClick.listen(hide); -------------------------------------------------------------------------------- /test/short/regression/0300/0375.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | for (int inputIndex = 1, statementIndex = 0; 3 | inputIndex < inputs.length; 4 | statementIndex++) {} 5 | <<< 6 | for (int inputIndex = 1, statementIndex = 0; 7 | inputIndex < inputs.length; 8 | statementIndex++) {} -------------------------------------------------------------------------------- /test/short/regression/0300/0377.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | for (int i = 0; 3 | i < positionalArgumentCount; 4 | arguments = arguments.tail, i++) {} 5 | <<< 6 | for (int i = 0; 7 | i < positionalArgumentCount; 8 | arguments = arguments.tail, i++) {} -------------------------------------------------------------------------------- /test/short/regression/0300/0378.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | return new js.Fun(parameters, body, asyncModifier: asyncModifier) 3 | .withSourceInformation(sourceInformationFactory.forContext(element) 4 | .buildDeclaration(element)); 5 | <<< 6 | return new js.Fun(parameters, body, asyncModifier: asyncModifier) 7 | .withSourceInformation(sourceInformationFactory 8 | .forContext(element) 9 | .buildDeclaration(element)); -------------------------------------------------------------------------------- /test/short/regression/0300/0379.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | Type___ variable___ = querySelector(' ') 4 | ..setInnerHtml(' ', 5 | validator: new Validator___________() 6 | ..method______(' ')); 7 | } 8 | <<< 9 | void main() { 10 | Type___ variable___ = querySelector(' ') 11 | ..setInnerHtml(' ', 12 | validator: new Validator___________() 13 | ..method______(' ')); 14 | } -------------------------------------------------------------------------------- /test/short/regression/0300/0380.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | test() { 3 | var fooService, 4 | ids, 5 | objectName, 6 | results; 7 | 8 | var futures = ids 9 | .map((id) => fooService 10 | .getItem(objectName, id) 11 | .then((item) => results.add(item.name.value))) 12 | .toList(); 13 | } 14 | <<< 15 | test() { 16 | var fooService, ids, objectName, results; 17 | 18 | var futures = ids 19 | .map((id) => fooService 20 | .getItem(objectName, id) 21 | .then((item) => results.add(item.name.value))) 22 | .toList(); 23 | } -------------------------------------------------------------------------------- /test/short/regression/0300/0381.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'package:ads.acx2.components.material_expansionpanel.examples/examples.dart' deferred as expansion; 3 | <<< 4 | import 'package:ads.acx2.components.material_expansionpanel.examples/examples.dart' 5 | deferred as expansion; -------------------------------------------------------------------------------- /test/short/regression/0300/0383.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class MummyMatchers { 3 | MummyMatchers([List publishers]) : publishers = publishers != 4 | null ? publishers : defaultPublishers.add(unittestPublisher); 5 | } 6 | <<< 7 | class MummyMatchers { 8 | MummyMatchers([List publishers]) 9 | : publishers = publishers != null 10 | ? publishers 11 | : defaultPublishers.add(unittestPublisher); 12 | } -------------------------------------------------------------------------------- /test/short/regression/0300/0384.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | (scubaMatchers.publishers[ 3 | ErrorCollectingPublisher] as ErrorCollectingPublisher).verify(); 4 | <<< 5 | (scubaMatchers.publishers[ErrorCollectingPublisher] 6 | as ErrorCollectingPublisher) 7 | .verify(); -------------------------------------------------------------------------------- /test/short/regression/0300/0398.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | children.add(new DrawerHeader(children: [ 3 | new Flex([avatar, username], 4 | justifyContent: FlexJustifyContent.center, 5 | direction: FlexDirection.vertical)])); 6 | <<< 7 | children.add(new DrawerHeader(children: [ 8 | new Flex([avatar, username], 9 | justifyContent: FlexJustifyContent.center, 10 | direction: FlexDirection.vertical) 11 | ])); -------------------------------------------------------------------------------- /test/short/regression/0300/0399.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | Optional getCookie(String name) => new Optional.fromNullable(_driver 3 | .cookies 4 | .all.firstWhere((cookie) => cookie.name == name, orElse: () => null)); 5 | <<< 6 | Optional getCookie(String name) => 7 | new Optional.fromNullable(_driver.cookies.all 8 | .firstWhere((cookie) => cookie.name == name, orElse: () => null)); -------------------------------------------------------------------------------- /test/short/regression/0400/0404.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | group('((prevent timeout))', () { 3 | setUp(() => ensureImageExists()); 4 | 5 | test('((dummy))', () { 6 | }, timeout: const Timeout(const Duration(seconds: 300))); 7 | }); 8 | <<< 9 | group('((prevent timeout))', () { 10 | setUp(() => ensureImageExists()); 11 | 12 | test('((dummy))', () {}, 13 | timeout: const Timeout(const Duration(seconds: 300))); 14 | }); -------------------------------------------------------------------------------- /test/short/regression/0400/0413.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | List get bindings => [ 3 | bind(const StaticFilePath()) 4 | .toValue(_staticFilePath.isEmpty ? _libRoot : _staticFilePath) 5 | ]; 6 | <<< 7 | List get bindings => [ 8 | bind(const StaticFilePath()) 9 | .toValue(_staticFilePath.isEmpty ? _libRoot : _staticFilePath) 10 | ]; -------------------------------------------------------------------------------- /test/short/regression/0400/0422.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void allTests() { 3 | describe('inliner', () { 4 | it('should inline `templateUrl` values', () async { 5 | expect(view.namedParameters 6 | .firstWhere((p) => p.name == 'templateUrl') 7 | .value).toContain('template.html'); 8 | }); 9 | }); 10 | } 11 | <<< 12 | void allTests() { 13 | describe('inliner', () { 14 | it('should inline `templateUrl` values', () async { 15 | expect(view.namedParameters 16 | .firstWhere((p) => p.name == 'templateUrl') 17 | .value) 18 | .toContain('template.html'); 19 | }); 20 | }); 21 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0424.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | obj.functionWithTwoParameters(firstParameterGenerator() 3 | ..id = myId 4 | ..teamId = myTeamId 5 | ..startTime = new Time(getEndOfDate(clock.currentTime()).millisecondsSinceEpoch), secondParameterGenerator()); 6 | <<< 7 | obj.functionWithTwoParameters( 8 | firstParameterGenerator() 9 | ..id = myId 10 | ..teamId = myTeamId 11 | ..startTime = 12 | new Time(getEndOfDate(clock.currentTime()).millisecondsSinceEpoch), 13 | secondParameterGenerator()); -------------------------------------------------------------------------------- /test/short/regression/0400/0429.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | final Map _campaignSkinSubtypes = 4 | new Map.fromIterable(SummaryTabDataRequest_CampaignSkinSubtype.values, 5 | key: (campaignSkinSubtype) => campaignSkinSubtype.name, 6 | value: (campaignSkinSubtype) => campaignSkinSubtype); 7 | <<< 8 | final Map 9 | _campaignSkinSubtypes = new Map.fromIterable( 10 | SummaryTabDataRequest_CampaignSkinSubtype.values, 11 | key: (campaignSkinSubtype) => campaignSkinSubtype.name, 12 | value: (campaignSkinSubtype) => campaignSkinSubtype); -------------------------------------------------------------------------------- /test/short/regression/0400/0434.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | @eventHandler 3 | bool computeChangePasswordDisabled( 4 | String email, String password, String newPassword) => 5 | email == null || 6 | email.isEmpty || 7 | password == null || 8 | password.isEmpty || 9 | newPassword == null || 10 | newPassword.isEmpty; 11 | <<< 12 | @eventHandler 13 | bool computeChangePasswordDisabled( 14 | String email, String password, String newPassword) => 15 | email == null || 16 | email.isEmpty || 17 | password == null || 18 | password.isEmpty || 19 | newPassword == null || 20 | newPassword.isEmpty; -------------------------------------------------------------------------------- /test/short/regression/0400/0436.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | void main() { 4 | List typeParameterElements = interfaceTypeContext 5 | .element != 6 | null ? interfaceTypeContext.element.typeParameters : null; 7 | } 8 | } 9 | <<< 10 | class Foo { 11 | void main() { 12 | List typeParameterElements = 13 | interfaceTypeContext.element != null 14 | ? interfaceTypeContext.element.typeParameters 15 | : null; 16 | } 17 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0438.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | final JsFunction _setDartInstance = context['Polymer']['PolymerInterop'] 3 | ['setDartInstance']; 4 | <<< 5 | final JsFunction _setDartInstance = 6 | context['Polymer']['PolymerInterop']['setDartInstance']; -------------------------------------------------------------------------------- /test/short/regression/0400/0441.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | getSomeFoo( 3 | {fooooooooooooooooooooo: const [ 4 | 'baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 5 | ]}) { 6 | return 'rhubarb'; 7 | } 8 | <<< 9 | getSomeFoo( 10 | {fooooooooooooooooooooo: const [ 11 | 'baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 12 | ]}) { 13 | return 'rhubarb'; 14 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0443.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @sg.GeneratedPart('package:injection/generator.dart') 3 | part 'app.injection.dart'; 4 | <<< 5 | @sg.GeneratedPart('package:injection/generator.dart') 6 | part 'app.injection.dart'; -------------------------------------------------------------------------------- /test/short/regression/0400/0449.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | for (int i = 0; i < variables.length; ++i) 3 | performance.updateVariable(variables[i]); 4 | <<< 5 | for (int i = 0; i < variables.length; ++i) 6 | performance.updateVariable(variables[i]); -------------------------------------------------------------------------------- /test/short/regression/0400/0454.unit: -------------------------------------------------------------------------------- 1 | >>> original bug report actually did fit in 80 2 | class F { 3 | List< 4 | AVeryLongTypeNameTHatTheUserCannotChange____________> aDescriptiveName__; 5 | } 6 | <<< 7 | class F { 8 | List aDescriptiveName__; 9 | } 10 | >>> 11 | class F { 12 | List< 13 | AVeryLongTypeNameTHatTheUserCannotChange_____________> aDescriptiveName__; 14 | } 15 | <<< 16 | class F { 17 | List 18 | aDescriptiveName__; 19 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0461.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | receiver___________.property________.add( 3 | new SomeClass___________________.someNamedConstructor_____________________()); 4 | <<< 5 | receiver___________.property________.add(new SomeClass___________________ 6 | .someNamedConstructor_____________________()); 7 | >>> (indent 4) 8 | new SomeClass___________________.someNamedConstructor_____________________(); 9 | <<< 10 | new SomeClass___________________ 11 | .someNamedConstructor_____________________(); -------------------------------------------------------------------------------- /test/short/regression/0400/0466.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | Future get identifier________ async { 3 | var id = identifier________.identifier__; 4 | 5 | return identifier_____________[ 6 | id] ??= await identifier_______.identifier____________________( 7 | identifier___________________________.create()..identifier____ = id); 8 | } 9 | <<< 10 | Future get identifier________ async { 11 | var id = identifier________.identifier__; 12 | 13 | return identifier_____________[id] ??= 14 | await identifier_______.identifier____________________( 15 | identifier___________________________.create() 16 | ..identifier____ = id); 17 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0475.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class ListResultDescriptor { 3 | factory ListResultDescriptor(String name, List defaultValue, 4 | {ResultCachingPolicy< 5 | List> cachingPolicy}) = ListResultDescriptorImpl; 6 | } 7 | <<< 8 | class ListResultDescriptor { 9 | factory ListResultDescriptor(String name, List defaultValue, 10 | {ResultCachingPolicy> cachingPolicy}) = 11 | ListResultDescriptorImpl; 12 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0479.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | _actions..insert.listen(_insert)..delete.listen(_delete)..editable.listen(_makeEditable); 3 | <<< 4 | _actions 5 | ..insert.listen(_insert) 6 | ..delete.listen(_delete) 7 | ..editable.listen(_makeEditable); -------------------------------------------------------------------------------- /test/short/regression/0400/0481.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Car extends Vehicle with Doors, Windows, Wheels, Tires, 3 | Motor, Hood, Trunk, Roof, Pedals, Gas, Seats, LotsOfFun { 4 | // ... 5 | } 6 | <<< 7 | class Car extends Vehicle 8 | with 9 | Doors, 10 | Windows, 11 | Wheels, 12 | Tires, 13 | Motor, 14 | Hood, 15 | Trunk, 16 | Roof, 17 | Pedals, 18 | Gas, 19 | Seats, 20 | LotsOfFun { 21 | // ... 22 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0488.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | { 3 | fn(x) { ; } 4 | items.forEach(fn); 5 | } 6 | <<< 7 | { 8 | fn(x) { 9 | ; 10 | } 11 | 12 | items.forEach(fn); 13 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0489.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | longerNamedFoo..items.add(new Foo() 3 | ..name = bar.toto 4 | ..placeUrl = place.toString()); 5 | <<< 6 | longerNamedFoo 7 | ..items.add(new Foo() 8 | ..name = bar.toto 9 | ..placeUrl = place.toString()); -------------------------------------------------------------------------------- /test/short/regression/0400/0494.unit: -------------------------------------------------------------------------------- 1 | >>> (note: output is weird, but that's ok. the bug was that an assertion failed) 2 | main() { 3 | for (int i = 0; i < 10; i++) 4 | for (int j = 0; j < 3; j++) { 5 | print(''); 6 | } 7 | } 8 | <<< 9 | main() { 10 | for (int i = 0; i < 10; i++) 11 | for (int j = 0; j < 3; j++) { 12 | print(''); 13 | } 14 | } -------------------------------------------------------------------------------- /test/short/regression/0400/0497.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Stream< 4 | api 5 | .CreateRecipientSourceFromGroupResponse> createRecipientSourceFromGroup( 6 | String groupName, int campaignId, String languagePreference); 7 | } 8 | <<< 9 | class Foo { 10 | Stream 11 | createRecipientSourceFromGroup( 12 | String groupName, int campaignId, String languagePreference); 13 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0503.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Stream< 4 | api 5 | .ReallySuperExtremelyLooooooongTypeName> veryExtremelyLoooongMethodName( 6 | String parameter, int parameter2, String thirdParameter) { 7 | ; 8 | } 9 | } 10 | <<< 11 | class Foo { 12 | Stream 13 | veryExtremelyLoooongMethodName( 14 | String parameter, int parameter2, String thirdParameter) { 15 | ; 16 | } 17 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0511.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode( 4 | 'FINAL_NOT_INITIALIZED', 5 | "The final variable '{0}' must be initialized", /*correction:*/ null, /*strongModeError:*/ false); 6 | } 7 | <<< 8 | class Foo { 9 | static const StaticWarningCode FINAL_NOT_INITIALIZED = 10 | const StaticWarningCode( 11 | 'FINAL_NOT_INITIALIZED', 12 | "The final variable '{0}' must be initialized", 13 | /*correction:*/ null, 14 | /*strongModeError:*/ false); 15 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0513.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | #!script 3 | 4 | 5 | library x; 6 | <<< 7 | #!script 8 | 9 | library x; 10 | >>> 11 | #!script 12 | 13 | library x; 14 | <<< 15 | #!script 16 | 17 | library x; -------------------------------------------------------------------------------- /test/short/regression/0500/0514.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | someFunction() { 3 | myFunc(namedParam: complexFunc( 4 | complexParam1: "someValue", complexParam2: "anotherValue")); 5 | } 6 | <<< 7 | someFunction() { 8 | myFunc( 9 | namedParam: complexFunc( 10 | complexParam1: "someValue", complexParam2: "anotherValue")); 11 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0519.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | < 3 | int>[1, 2, 3, 4].forEach((int value) { 4 | print(value); 5 | }); 6 | <<< 7 | [1, 2, 3, 4].forEach((int value) { 8 | print(value); 9 | }); -------------------------------------------------------------------------------- /test/short/regression/0500/0520.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'package:meta/meta.dart'; 3 | 4 | class Foo { 5 | final int bar; 6 | Foo({ 7 | @required this.bar, 8 | }); 9 | } 10 | <<< 11 | import 'package:meta/meta.dart'; 12 | 13 | class Foo { 14 | final int bar; 15 | Foo({ 16 | @required this.bar, 17 | }); 18 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0527.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | for (int i = 0; i < variables.length; ++i) performance.updateVariable(variables[i]); 3 | <<< 4 | for (int i = 0; i < variables.length; ++i) 5 | performance.updateVariable(variables[i]); -------------------------------------------------------------------------------- /test/short/regression/0500/0529.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | enum _ElementLifecycle { 3 | initial, 4 | active, 5 | inactive, 6 | defunct, 7 | } 8 | <<< 9 | enum _ElementLifecycle { 10 | initial, 11 | active, 12 | inactive, 13 | defunct, 14 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0541.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | String A() native ; 3 | <<< 4 | String A() native; -------------------------------------------------------------------------------- /test/short/regression/0500/0571.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @Timeout(const Duration(minutes: 1)) 3 | 4 | import "package:test/test.dart"; 5 | <<< 6 | @Timeout(const Duration(minutes: 1)) 7 | 8 | import "package:test/test.dart"; -------------------------------------------------------------------------------- /test/short/regression/0500/0582.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void fn() { 3 | List a; 4 | // NOTICE THE TYPE PARAMETER 5 | a.fold(0, (memo, s) { 6 | return max(memo, s.length); 7 | }); 8 | } 9 | <<< 10 | void fn() { 11 | List a; 12 | // NOTICE THE TYPE PARAMETER 13 | a.fold(0, (memo, s) { 14 | return max(memo, s.length); 15 | }); 16 | } -------------------------------------------------------------------------------- /test/short/regression/0500/0584.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool 3 | listEquals(List a, List b) => const ListEquality().equals(a, b); 4 | <<< 5 | bool listEquals(List a, List b) => 6 | const ListEquality().equals(a, b); -------------------------------------------------------------------------------- /test/short/regression/0500/0585.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | A___________ r___________________________( 3 | R______________________________ r______________________________, 4 | R_________________________________ r_________________________________) => 5 | new A___________( 6 | [r______________________________, r_________________________________]); 7 | <<< 8 | A___________ r___________________________( 9 | R______________________________ r______________________________, 10 | R_________________________________ 11 | r_________________________________) => 12 | new A___________( 13 | [r______________________________, r_________________________________]); -------------------------------------------------------------------------------- /test/short/regression/0600/0613.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void takeIdentityFunction(T id(T x)) {} 3 | <<< 4 | void takeIdentityFunction(T id(T x)) {} -------------------------------------------------------------------------------- /test/short/regression/0600/0616.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import "package:expect/expect.dart"; 3 | int Function() x = () => 42; 4 | int Function(int Function()) y = (int Function() x) => x(); 5 | List l = [()=>42, x]; 6 | main() { 7 | Expect.equals(42, y(l[1])); 8 | } 9 | <<< 10 | import "package:expect/expect.dart"; 11 | 12 | int Function() x = () => 42; 13 | int Function(int Function()) y = (int Function() x) => x(); 14 | List l = [() => 42, x]; 15 | main() { 16 | Expect.equals(42, y(l[1])); 17 | } -------------------------------------------------------------------------------- /test/short/regression/0600/0619.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | typedef F = void Function(T); 3 | <<< 4 | typedef F = void Function(T); -------------------------------------------------------------------------------- /test/short/regression/0600/0621.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var x = (f as dynamic)(40, 2); 3 | <<< 4 | var x = (f as dynamic)(40, 2); 5 | >>> 6 | var y = (f as dynamic)('hi', '!'); 7 | <<< 8 | var y = (f as dynamic)('hi', '!'); -------------------------------------------------------------------------------- /test/short/regression/0600/0648.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | for (@nullCheck var i in codePoints) {} 3 | <<< 4 | for (@nullCheck var i in codePoints) {} -------------------------------------------------------------------------------- /test/short/regression/0600/0658.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class A { 3 | A( 4 | int a, 5 | ) 6 | : super(); 7 | } 8 | <<< 9 | class A { 10 | A( 11 | int a, 12 | ) : super(); 13 | } 14 | >>> 15 | class Foo { 16 | Foo({ 17 | Bar bar, 18 | Baz baz, 19 | }) 20 | : assert(bar != null), 21 | super(baz); 22 | } 23 | <<< 24 | class Foo { 25 | Foo({ 26 | Bar bar, 27 | Baz baz, 28 | }) : assert(bar != null), 29 | super(baz); 30 | } -------------------------------------------------------------------------------- /test/short/regression/0600/0665.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | when( 3 | runner.call( 4 | typed(captureAny), 5 | typed(captureAny), 6 | workingDirectory: typed(captureAny, named: "workingDirectory"), 7 | ), 8 | ) 9 | .thenReturn(new Future.value(new MockProcessResult())); 10 | <<< 11 | when( 12 | runner.call( 13 | typed(captureAny), 14 | typed(captureAny), 15 | workingDirectory: typed(captureAny, named: "workingDirectory"), 16 | ), 17 | ).thenReturn(new Future.value(new MockProcessResult())); -------------------------------------------------------------------------------- /test/short/regression/0700/0705.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | final _appUrl = Platform.isIOS 3 | ? 'https://itunes.apple.com/us/app/google-adwords/id1037457231' 4 | : 'https://play.google.com/store/apps/details?id=com.google.android.apps.' 5 | 'adwords'; 6 | <<< 7 | final _appUrl = Platform.isIOS 8 | ? 'https://itunes.apple.com/us/app/google-adwords/id1037457231' 9 | : 'https://play.google.com/store/apps/details?id=com.google.android.apps.' 10 | 'adwords'; -------------------------------------------------------------------------------- /test/short/regression/0700/0707.stmt: -------------------------------------------------------------------------------- 1 | ### This test used to test --fix behavior but since that feature was removed, 2 | ### the test now just verifies that the formatter preserves the original code. 3 | >>> (indent 4) 4 | sink.write('FILE ACCESSED ${new DateTime.now()}\n'); 5 | <<< 6 | sink.write('FILE ACCESSED ${new DateTime.now()}\n'); -------------------------------------------------------------------------------- /test/short/regression/0700/0711.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var str = '''${""" 3 | a 4 | b 5 | c 6 | """}'''; 7 | <<< 8 | var str = '''${""" 9 | a 10 | b 11 | c 12 | """}'''; -------------------------------------------------------------------------------- /test/short/regression/0700/0713.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | String type = status == 'OK' 3 | ? 'notices' 4 | : status == 'NO' ? 'warnings' : status == 'BAD' ? 'errors' : ''; 5 | <<< 6 | String type = status == 'OK' 7 | ? 'notices' 8 | : status == 'NO' 9 | ? 'warnings' 10 | : status == 'BAD' 11 | ? 'errors' 12 | : ''; -------------------------------------------------------------------------------- /test/short/regression/0700/0720.unit: -------------------------------------------------------------------------------- 1 | ### This test used to test --fix behavior but since that feature was removed, 2 | ### the test now just verifies that the formatter preserves the original code. 3 | >>> 4 | @meta(const Foo(const [])) 5 | library foo; 6 | <<< 7 | @meta(const Foo(const [])) 8 | library foo; 9 | >>> 10 | @meta(const Foo(const [])) 11 | import 'foo.dart'; 12 | <<< 13 | @meta(const Foo(const [])) 14 | import 'foo.dart'; -------------------------------------------------------------------------------- /test/short/regression/0700/0799.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @ShouldThrow( 3 | 'Could not generate `toJson` code for `watch`.\n' 4 | 'None of the provided `TypeHelper` instances support the defined type.', 5 | configurations: ['default'], 6 | ) 7 | class C {} 8 | <<< 9 | @ShouldThrow( 10 | 'Could not generate `toJson` code for `watch`.\n' 11 | 'None of the provided `TypeHelper` instances support the defined type.', 12 | configurations: ['default'], 13 | ) 14 | class C {} -------------------------------------------------------------------------------- /test/short/regression/0800/0831.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() { 3 | final bar = [ 4 | if (longVariableName == 'do nothing but be long') ...[] else if (longVariableName == 5 | 'show the welcome message') 6 | 'Hello' 7 | ]; 8 | } 9 | <<< 10 | foo() { 11 | final bar = [ 12 | if (longVariableName == 'do nothing but be long') 13 | ...[] 14 | else if (longVariableName == 'show the welcome message') 15 | 'Hello' 16 | ]; 17 | } -------------------------------------------------------------------------------- /test/short/regression/0800/0869.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var failed = [ 3 | for (var e in _restResultEvents) if (!e.isSuccess) e.message, 4 | ]; 5 | <<< 6 | var failed = [ 7 | for (var e in _restResultEvents) 8 | if (!e.isSuccess) e.message, 9 | ]; -------------------------------------------------------------------------------- /test/short/regression/0900/0900.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | final f = stdin.readLineSync, 4 | p = int.parse, 5 | n = p(f()), 6 | ranges = List.generate(n, (_) { 7 | final t = f().split(' '), a = p(t[0]), b = a + p(t[1]); 8 | return [a, b]; 9 | }), 10 | dp = List(n); 11 | } 12 | <<< 13 | void main() { 14 | final f = stdin.readLineSync, 15 | p = int.parse, 16 | n = p(f()), 17 | ranges = List.generate(n, (_) { 18 | final t = f().split(' '), a = p(t[0]), b = a + p(t[1]); 19 | return [a, b]; 20 | }), 21 | dp = List(n); 22 | } -------------------------------------------------------------------------------- /test/short/regression/0900/0927.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | int get currentAngleDigits => _currentSunAngleDeg < 0 ? 1 : _currentSunAngleDeg < 10 ? 2 : 3; 4 | } 5 | <<< 6 | class C { 7 | int get currentAngleDigits => _currentSunAngleDeg < 0 8 | ? 1 9 | : _currentSunAngleDeg < 10 10 | ? 2 11 | : 3; 12 | } -------------------------------------------------------------------------------- /test/short/regression/0900/0960.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | const m = 0; 3 | 4 | class C { 5 | var z, w, u, v; 6 | C({@m int this.v()?}); 7 | } 8 | 9 | void main() {} 10 | <<< 11 | const m = 0; 12 | 13 | class C { 14 | var z, w, u, v; 15 | C({@m int this.v()?}); 16 | } 17 | 18 | void main() {} -------------------------------------------------------------------------------- /test/short/regression/0900/0966.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | return [ 3 | for (final x in exampleList) 4 | if (conditionA) 5 | ItemConstructorA() 6 | // Sample multi-line comment 7 | // which broke the formatter 8 | else if (conditionB) 9 | ItemConstructorB() 10 | else 11 | ItemConstructorC() 12 | ]; 13 | <<< 14 | return [ 15 | for (final x in exampleList) 16 | if (conditionA) 17 | ItemConstructorA() 18 | // Sample multi-line comment 19 | // which broke the formatter 20 | else if (conditionB) 21 | ItemConstructorB() 22 | else 23 | ItemConstructorC() 24 | ]; -------------------------------------------------------------------------------- /test/short/regression/1000/1029.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | try { 4 | doSomething(); 5 | } on Exception catch (e) {} finally { 6 | cleanupSomething(); 7 | } 8 | } 9 | <<< 10 | void main() { 11 | try { 12 | doSomething(); 13 | } on Exception catch (e) { 14 | } finally { 15 | cleanupSomething(); 16 | } 17 | } 18 | >>> 19 | void main() { 20 | try { 21 | doSomething(); 22 | } on FooException {} on BarException { 23 | doSomething(); 24 | } 25 | } 26 | <<< 27 | void main() { 28 | try { 29 | doSomething(); 30 | } on FooException { 31 | } on BarException { 32 | doSomething(); 33 | } 34 | } -------------------------------------------------------------------------------- /test/short/regression/1100/1181.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | switch (e) { 3 | case E.e1: 4 | break; 5 | case E.e2: 6 | } 7 | <<< 8 | switch (e) { 9 | case E.e1: 10 | break; 11 | case E.e2: 12 | } -------------------------------------------------------------------------------- /test/short/regression/1100/1198.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | switch (e) {} 4 | <<< 5 | switch (e) {} 6 | >>> 7 | switch ("a long string that must wrap") {} 8 | <<< 9 | switch ( 10 | "a long string that must wrap") {} 11 | >>> 12 | switch ([1,]) {} 13 | <<< 14 | switch ([ 15 | 1, 16 | ]) {} 17 | >>> 18 | e = switch (e) {}; 19 | <<< 20 | e = switch (e) {}; 21 | >>> 22 | e = switch ("a long string that must wrap") {}; 23 | <<< 24 | e = switch ( 25 | "a long string that must wrap") {}; 26 | >>> 27 | e = switch ([1,]) {}; 28 | <<< 29 | e = switch ([ 30 | 1, 31 | ]) {}; -------------------------------------------------------------------------------- /test/short/regression/1200/1205.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | error( 3 | offset: 10, 4 | ( 5 | code: 'unclosed-block', 6 | message: 'Block was left open', 7 | )); 8 | <<< 9 | error(offset: 10, ( 10 | code: 'unclosed-block', 11 | message: 'Block was left open', 12 | )); -------------------------------------------------------------------------------- /test/short/regression/1200/1213.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | final a = ( 4 | element, 5 | element, 6 | ) 7 | .getter; 8 | 9 | final b = [ 10 | element, 11 | element, 12 | ].getter; 13 | } 14 | <<< 15 | main() { 16 | final a = ( 17 | element, 18 | element, 19 | ).getter; 20 | 21 | final b = [ 22 | element, 23 | element, 24 | ].getter; 25 | } -------------------------------------------------------------------------------- /test/short/regression/1200/1215.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | return switch (level) { 3 | 0 => a, 4 | // Comment. 5 | 1 6 | when flag => 7 | b, 8 | }; 9 | <<< 10 | return switch (level) { 11 | 0 => a, 12 | // Comment. 13 | 1 when flag => b, 14 | }; -------------------------------------------------------------------------------- /test/short/regression/1200/1249.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | late final _callocPtr = _lookup< 4 | ffi 5 | .NativeFunction>( 6 | 'calloc'); 7 | } 8 | <<< 9 | class C { 10 | late final _callocPtr = _lookup< 11 | ffi.NativeFunction< 12 | ffi_Pointer_ffi_Void_ Function(ffi_Size__ffi_Size)>>('calloc'); 13 | } 14 | -------------------------------------------------------------------------------- /test/short/regression/1200/1254.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | enum EE { 3 | a, 4 | b, // 'b' 5 | c 6 | } 7 | <<< 8 | enum EE { 9 | a, 10 | b, // 'b' 11 | c 12 | } -------------------------------------------------------------------------------- /test/short/regression/other/analyzer.unit: -------------------------------------------------------------------------------- 1 | >>> work around bug in record type annotation end token 2 | var x = foo<(int, int)?, int>(); 3 | <<< 4 | var x = foo<(int, int)?, int>(); -------------------------------------------------------------------------------- /test/short/regression/other/null_safety.unit: -------------------------------------------------------------------------------- 1 | >>> issues found when migrating to null safety 2 | void main() => print('first: ${first([1, 2, 3])}'); 3 | <<< 4 | void main() => print('first: ${first([1, 2, 3])}'); 5 | >>> 6 | var x = '${jsonEncode([ 7 | 1, 8 | ])}'; 9 | <<< 10 | var x = '${jsonEncode([ 11 | 1, 12 | ])}'; 13 | >>> 14 | main() { 15 | patch..[entityId].removeWhere(); 16 | } 17 | <<< 18 | main() { 19 | patch..[entityId].removeWhere(); 20 | } -------------------------------------------------------------------------------- /test/short/regression/other/pkg.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | expect(wktGeographic.parseAll(wktTest, range: Range(start: 2)), 3 | [ 4 | GeoPoint2.from([3, 3]), 5 | GeoPoint2.from([4, 4]), 6 | GeoPoint2.from([5, 5]), 7 | ]); 8 | <<< 9 | expect( 10 | wktGeographic.parseAll(wktTest, range: Range(start: 2)), 11 | [ 12 | GeoPoint2.from([3, 3]), 13 | GeoPoint2.from([4, 4]), 14 | GeoPoint2.from([5, 5]), 15 | ]); -------------------------------------------------------------------------------- /test/short/splitting/arrows.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | myFunction() => argument + anotherArgument; 4 | <<< 5 | myFunction() => 6 | argument + anotherArgument; -------------------------------------------------------------------------------- /test/short/splitting/metadata.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> on pattern variable, moves to own line 3 | @meta var (x, y) = o; 4 | <<< 5 | @meta 6 | var (x, y) = o; -------------------------------------------------------------------------------- /test/short/splitting/part.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> part of with uri that fits 3 | part of "uri.dart"; 4 | <<< 5 | part of "uri.dart"; 6 | >>> part of with uri does not split on long line 7 | part of "very_very_very_very_long_uri.dart"; 8 | <<< 9 | part of "very_very_very_very_long_uri.dart"; -------------------------------------------------------------------------------- /test/short/whitespace/do.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> empty 3 | do {} while (true); 4 | <<< 5 | do {} while (true); 6 | >>> indented body 7 | do 8 | {;} while (true); 9 | <<< 10 | do { 11 | ; 12 | } while (true); -------------------------------------------------------------------------------- /test/short/whitespace/function_types.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | Function ( ) f; 4 | <<< 5 | Function() f; 6 | >>> 7 | void Function( int i, String s) f; 8 | <<< 9 | void Function(int i, String s) f; 10 | >>> 11 | Function( int i, [ String s, bool b ] ) f; 12 | <<< 13 | Function(int i, [String s, bool b]) f; 14 | >>> 15 | Function( int i, { String s, bool b } ) f; 16 | <<< 17 | Function(int i, {String s, bool b}) f; 18 | >>> 19 | Function < T extends S > () f; 20 | <<< 21 | Function() f; 22 | >>> 23 | int ? Function(int ? i, {String ? s}) ? f; 24 | <<< 25 | int? Function(int? i, {String? s})? f; -------------------------------------------------------------------------------- /test/short/whitespace/mixins.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | mixin M1 on UnaryNum { } 4 | <<< 5 | mixin M1 on UnaryNum {} 6 | >>> 7 | mixin M2 on UnaryNum ,UnaryInt{ } 8 | <<< 9 | mixin M2 on UnaryNum, UnaryInt {} 10 | >>> 11 | mixin M1 on UnaryNum { 12 | 13 | 14 | 15 | 16 | member() {} 17 | 18 | 19 | } 20 | <<< 21 | mixin M1 on UnaryNum { 22 | member() {} 23 | } 24 | >>> generic 25 | mixin M< A ,B >on C implements D{ } 26 | <<< 27 | mixin M on C implements D {} 28 | >>> base modifier 29 | base mixin M {} 30 | <<< 31 | base mixin M {} -------------------------------------------------------------------------------- /test/short/whitespace/native.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> members without strings 3 | class Foo { 4 | Foo() native ; 5 | int bar() native ; 6 | } 7 | <<< 8 | class Foo { 9 | Foo() native; 10 | int bar() native; 11 | } 12 | >>> members with strings 13 | class Foo { 14 | Foo() native "Foo" ; 15 | int bar() native "bar" ; 16 | } 17 | <<< 18 | class Foo { 19 | Foo() native "Foo"; 20 | int bar() native "bar"; 21 | } 22 | >>> class 23 | class Foo native "Foo" { } 24 | <<< 25 | class Foo native "Foo" {} -------------------------------------------------------------------------------- /test/short/whitespace/statements.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> multiple labels 3 | a: b:c:d: 4 | 5 | 6 | 7 | e: 8 | 9 | foo(); 10 | <<< 11 | a: 12 | b: 13 | c: 14 | d: 15 | e: 16 | foo(); 17 | >>> label in block 18 | {a:foo();} 19 | <<< 20 | { 21 | a: 22 | foo(); 23 | } -------------------------------------------------------------------------------- /test/short/whitespace/strings.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | "a" "b" "c"; 4 | <<< 5 | "a" "b" "c"; 6 | >>> empty multi-line 7 | """""" ''''''; 8 | <<< 9 | """""" ''''''; 10 | >>> blank lines in multi-line string 11 | ''' 12 | 13 | 14 | two before 15 | 16 | one 17 | 18 | 19 | two 20 | 21 | 22 | '''; 23 | <<< 24 | ''' 25 | 26 | 27 | two before 28 | 29 | one 30 | 31 | 32 | two 33 | 34 | 35 | '''; -------------------------------------------------------------------------------- /test/short/whitespace/trailing.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> remove after line comment 3 | // trailing spaces after here:×20×20×20×20 4 | <<< 5 | // trailing spaces after here: 6 | >>> remove from empty line comment 7 | //×20×20×20 8 | <<< 9 | // 10 | >>> keep inside block comment lines 11 | /* one×20×20 12 | two×20 13 | ×20×20×20 14 | three×20×20×20×20 15 | */×20×20 16 | <<< 17 | /* one×20×20 18 | two×20 19 | ×20×20×20 20 | three×20×20×20×20 21 | */ 22 | >>> after code 23 | main() {×20×20 24 | ×20 25 | veryLongExpression +×20×20×20 26 | veryLongStatement;×20×20 27 | }×20×20×20×20 28 | <<< 29 | main() { 30 | veryLongExpression + 31 | veryLongStatement; 32 | } -------------------------------------------------------------------------------- /test/short/whitespace/try.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | try { 4 | doSomething(); 5 | } catch (e) { 6 | print(e); 7 | } 8 | <<< 9 | try { 10 | doSomething(); 11 | } catch (e) { 12 | print(e); 13 | } 14 | >>> 15 | try{ 16 | doSomething(); 17 | }on Exception catch (e){ 18 | print(e); 19 | } 20 | <<< 21 | try { 22 | doSomething(); 23 | } on Exception catch (e) { 24 | print(e); 25 | } -------------------------------------------------------------------------------- /test/short/whitespace/type_parameters.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> no spaces around braces 3 | class Foo< T > {} 4 | <<< 5 | class Foo {} 6 | >>> space between names 7 | class Foo< A,B, C,D> {} 8 | <<< 9 | class Foo {} 10 | >>> nullable in bounds 11 | class A {} 12 | <<< 13 | class A {} -------------------------------------------------------------------------------- /test/short/whitespace/while.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> empty body 3 | while (true); 4 | <<< 5 | while (true); -------------------------------------------------------------------------------- /test/short_format_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('vm') 6 | library; 7 | 8 | import 'package:test/test.dart'; 9 | 10 | import 'utils.dart'; 11 | 12 | void main() async { 13 | await testDirectory('short/comments'); 14 | await testDirectory('short/regression'); 15 | await testDirectory('short/selections'); 16 | await testDirectory('short/splitting'); 17 | await testDirectory('short/whitespace'); 18 | 19 | await testBenchmarks(useTallStyle: false); 20 | } 21 | -------------------------------------------------------------------------------- /test/tall/declaration/native.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Without strings. 3 | class Foo { 4 | Foo() native ; 5 | int bar() native ; 6 | } 7 | <<< 8 | class Foo { 9 | Foo() native; 10 | int bar() native; 11 | } 12 | >>> With strings. 13 | class Foo { 14 | Foo() native "Foo" ; 15 | int bar() native "bar" ; 16 | } 17 | <<< 18 | class Foo { 19 | Foo() native "Foo"; 20 | int bar() native "bar"; 21 | } 22 | >>> class 23 | class Foo native "Foo" { } 24 | <<< 25 | class Foo native "Foo" {} -------------------------------------------------------------------------------- /test/tall/declaration/typedef_comment.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Line comment after `typedef`. 3 | typedef // c 4 | Alias = Type; 5 | <<< 6 | typedef // c 7 | Alias = Type; 8 | >>> Line comment after name. 9 | typedef Alias // c 10 | = Type; 11 | <<< 12 | typedef Alias // c 13 | = Type; 14 | >>> Line comment after `=`. 15 | typedef Alias = // c 16 | Type; 17 | <<< 18 | typedef Alias = // c 19 | Type; 20 | >>> Line comment after type. 21 | typedef Alias = Type // c 22 | ; 23 | <<< 24 | typedef Alias = 25 | Type // c 26 | ; 27 | >>> Line comment after `;`. 28 | typedef Alias = Type; // c 29 | <<< 30 | typedef Alias = Type; // c -------------------------------------------------------------------------------- /test/tall/expression/assignment_comment.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Line comment after value. 3 | a = 1 // comment 4 | ; 5 | <<< 6 | ### Weird, but users rarely write this. 7 | a = 8 | 1 // comment 9 | ; 10 | >>> Line comment after assignment and semicolon. 11 | a = 1; // comment 12 | <<< 13 | a = 1; // comment -------------------------------------------------------------------------------- /test/tall/expression/set_comment.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | ### Sets use most of the same formatting code as lists, so we don't test 3 | ### all of the edge cases here, just the basics. 4 | >>> Line comment in empty set. 5 | var set = { 6 | // comment 7 | }; 8 | <<< 9 | var set = { 10 | // comment 11 | }; 12 | >>> Inline block comment. 13 | var set = { /* comment */ }; 14 | <<< 15 | var set = {/* comment */}; 16 | >>> After element. 17 | ({element // comment 18 | }); 19 | <<< 20 | ({ 21 | element, // comment 22 | }); -------------------------------------------------------------------------------- /test/tall/function/block_body.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Empty block body. 3 | f ( ) { } 4 | <<< 5 | f() {} 6 | >>> Collapse empty body. 7 | void main() { } 8 | <<< 9 | void main() {} 10 | >>> 11 | void main() { 12 | 13 | 14 | 15 | } 16 | <<< 17 | void main() {} 18 | >>> Non-empty block body. 19 | f ( ) { body ; } 20 | <<< 21 | f() { 22 | body; 23 | } 24 | >>> Async. 25 | f ( ) async { } 26 | <<< 27 | f() async {} 28 | >>> Sync*. 29 | f ( ) sync * { } 30 | <<< 31 | f() sync* {} 32 | >>> Async*. 33 | f ( ) async * { } 34 | <<< 35 | f() async* {} -------------------------------------------------------------------------------- /test/tall/function/comment.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Indent line comment in body. 3 | ### Note: The old formatter had a special rule that line comments starting at 4 | ### column 1 would not be indented even if the surrounding code otherwise 5 | ### required it. The new style deliberately does not have that rule. 6 | main() { 7 | // comment 8 | { 9 | // block 10 | { 11 | // nested 12 | } 13 | } 14 | } 15 | <<< 16 | main() { 17 | // comment 18 | { 19 | // block 20 | { 21 | // nested 22 | } 23 | } 24 | } 25 | >>> Don't split return type if comment before. 26 | // Comment. 27 | int f() {;} 28 | <<< 29 | // Comment. 30 | int f() { 31 | ; 32 | } -------------------------------------------------------------------------------- /test/tall/function/getter.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Split before `get`. 3 | VeryLongTypeAnnotation get veryLongGetter => null; 4 | <<< 5 | VeryLongTypeAnnotation 6 | get veryLongGetter => null; -------------------------------------------------------------------------------- /test/tall/function/operator.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Operator declaration. 3 | class A { 4 | bool operator == ( Object other ) => true ; 5 | int operator + ( int other ) { return value + other ; } 6 | int operator - ( ) { return - value ; } 7 | } 8 | <<< 9 | class A { 10 | bool operator ==(Object other) => 11 | true; 12 | int operator +(int other) { 13 | return value + other; 14 | } 15 | 16 | int operator -() { 17 | return -value; 18 | } 19 | } -------------------------------------------------------------------------------- /test/tall/function/other.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> External function. 3 | external void printToConsole ( line ) ; 4 | <<< 5 | external void printToConsole(line); 6 | >>> Force blank line after non-empty top-level function. 7 | a() {;} 8 | var x = 1; 9 | 10 | 11 | c() {;}d(){;} 12 | <<< 13 | a() { 14 | ; 15 | } 16 | 17 | var x = 1; 18 | 19 | c() { 20 | ; 21 | } 22 | 23 | d() { 24 | ; 25 | } 26 | >>> Do not force blank line after empty top-level function. 27 | a() {} b() {} 28 | <<< 29 | a() {} 30 | b() {} 31 | >>> Do not force blank line after expression body top-level function. 32 | a() => null; b() => null; 33 | <<< 34 | a() => null; 35 | b() => null; -------------------------------------------------------------------------------- /test/tall/function/setter.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Split after `set`. 3 | VeryLongTypeAnnotation set veryLongSetter(v) {} 4 | <<< 5 | VeryLongTypeAnnotation 6 | set veryLongSetter(v) {} -------------------------------------------------------------------------------- /test/tall/invocation/null_aware.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Unsplit. 3 | receiver ?. method() ?. getter; 4 | <<< 5 | receiver?.method()?.getter; 6 | >>> In split method chain. 7 | object?.method().method()?.method().method(); 8 | <<< 9 | object 10 | ?.method() 11 | .method() 12 | ?.method() 13 | .method(); -------------------------------------------------------------------------------- /test/tall/pattern/record_comment.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Empty record pattern block comment. 3 | if (obj case ( /* comment */ )) {;} 4 | <<< 5 | if (obj case (/* comment */)) { 6 | ; 7 | } 8 | >>> Empty record pattern line comment. 9 | if (obj case ( // comment 10 | )) {;} 11 | <<< 12 | if (obj case ( 13 | // comment 14 | )) { 15 | ; 16 | } 17 | >>> Record line comment between fields. 18 | if (obj case ( first , // comment 19 | second)){;} 20 | <<< 21 | if (obj case ( 22 | first, // comment 23 | second, 24 | )) { 25 | ; 26 | } -------------------------------------------------------------------------------- /test/tall/pattern/relational_comment.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> After operator. 3 | if (obj case <= // c 4 | someConstant + anotherLongConstant) {;} 5 | <<< 6 | if (obj 7 | case <= // c 8 | someConstant + 9 | anotherLongConstant) { 10 | ; 11 | } 12 | >>> After operand. 13 | if (obj case <= someConstant + anotherLongConstant // c 14 | ) {;} 15 | <<< 16 | if (obj 17 | case <= someConstant + 18 | anotherLongConstant // c 19 | ) { 20 | ; 21 | } -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/collection_for.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Trailing comma in increments forces them to split. 4 | list = [ 5 | for (x = 1;true;x += 1, x += 2,) e 6 | ]; 7 | <<< 8 | list = [ 9 | for ( 10 | x = 1; 11 | true; 12 | x += 1, 13 | x += 2, 14 | ) 15 | e, 16 | ]; 17 | >>> Don't add trailing comma if updaters split. 18 | list = [ 19 | for (x = 1;true;variable += longValue, another += value) e 20 | ]; 21 | <<< 22 | list = [ 23 | for ( 24 | x = 1; 25 | true; 26 | variable += longValue, 27 | another += value 28 | ) 29 | e, 30 | ]; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/for.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Trailing comma in increments forces them to split. 4 | for (x = 1;true;x += 1, x += 2,) {stmt;} 5 | <<< 6 | for ( 7 | x = 1; 8 | true; 9 | x += 1, 10 | x += 2, 11 | ) { 12 | stmt; 13 | } 14 | >>> Don't add trailing comma if updaters split. 15 | for (x = 1;true;variable += longValue, another += value) {stmt;} 16 | <<< 17 | for ( 18 | x = 1; 19 | true; 20 | variable += longValue, 21 | another += value 22 | ) { 23 | stmt; 24 | } -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/function_call.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | function(1,); 5 | <<< 6 | function( 7 | 1, 8 | ); 9 | >>> Doesn't force split without trailing comma. 10 | function(1,2,3); 11 | <<< 12 | function(1, 2, 3); 13 | >>> May still split without trailing comma if doesn't fit. 14 | function(argument1, argument2, argument3); 15 | <<< 16 | function( 17 | argument1, 18 | argument2, 19 | argument3, 20 | ); 21 | >>> With named argument. 22 | function(name: 1,); 23 | <<< 24 | function( 25 | name: 1, 26 | ); -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/list_literal.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | [1,]; 5 | <<< 6 | [ 7 | 1, 8 | ]; 9 | >>> Doesn't force split without trailing comma. 10 | [1,2,3]; 11 | <<< 12 | [1, 2, 3]; 13 | >>> May still split without trailing comma if doesn't fit. 14 | [element1, element2, element3, element4]; 15 | <<< 16 | [ 17 | element1, 18 | element2, 19 | element3, 20 | element4, 21 | ]; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/list_pattern.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | var [x,] = list; 5 | <<< 6 | var [ 7 | x, 8 | ] = list; 9 | >>> Doesn't force split without trailing comma. 10 | var [x,y,z] = list; 11 | <<< 12 | var [x, y, z] = list; 13 | >>> May still split without trailing comma if doesn't fit. 14 | var [element1, element2, element3, element4] = list; 15 | <<< 16 | var [ 17 | element1, 18 | element2, 19 | element3, 20 | element4, 21 | ] = list; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/map_literal.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | map = {a:1,}; 5 | <<< 6 | map = { 7 | a: 1, 8 | }; 9 | >>> Doesn't force split without trailing comma. 10 | map = {a:1,b:2,c:3}; 11 | <<< 12 | map = {a: 1, b: 2, c: 3}; 13 | >>> May still split without trailing comma if doesn't fit. 14 | map = {a: value1, b: value2, c: value3, d: value4}; 15 | <<< 16 | map = { 17 | a: value1, 18 | b: value2, 19 | c: value3, 20 | d: value4, 21 | }; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/map_pattern.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | var {a: x,} = map; 5 | <<< 6 | var { 7 | a: x, 8 | } = map; 9 | >>> Doesn't force split without trailing comma. 10 | var {a:x,b:y,c:z} = map; 11 | <<< 12 | var {a: x, b: y, c: z} = map; 13 | >>> May still split without trailing comma if doesn't fit. 14 | var {a: element1, b: element2, c: element3} = map; 15 | <<< 16 | var { 17 | a: element1, 18 | b: element2, 19 | c: element3, 20 | } = map; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/metadata.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | @meta(1,) 5 | class A {} 6 | <<< 7 | @meta( 8 | 1, 9 | ) 10 | class A {} 11 | >>> Doesn't force split without trailing comma. 12 | @meta(1) 13 | class A {} 14 | <<< 15 | @meta(1) 16 | class A {} 17 | >>> May still split without trailing comma if doesn't fit. 18 | @meta(argument1, argument2, argument3, argument4) 19 | class A {} 20 | <<< 21 | @meta( 22 | argument1, 23 | argument2, 24 | argument3, 25 | argument4, 26 | ) 27 | class A {} -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/object_pattern.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | var C(a:x,) = obj; 5 | <<< 6 | var C( 7 | a: x, 8 | ) = obj; 9 | >>> Doesn't force split without trailing comma. 10 | var C(a:x,b:y,c:z) = obj; 11 | <<< 12 | var C(a: x, b: y, c: z) = obj; 13 | >>> May still split without trailing comma if doesn't fit. 14 | var C(a: element1, b: element2, c: element3) = obj; 15 | <<< 16 | var C( 17 | a: element1, 18 | b: element2, 19 | c: element3, 20 | ) = obj; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/set_literal.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | set = {1,}; 5 | <<< 6 | set = { 7 | 1, 8 | }; 9 | >>> Doesn't force split without trailing comma. 10 | set = {1,2,3}; 11 | <<< 12 | set = {1, 2, 3}; 13 | >>> May still split without trailing comma if doesn't fit. 14 | set = {element1, element2, element3, element4}; 15 | <<< 16 | set = { 17 | element1, 18 | element2, 19 | element3, 20 | element4, 21 | }; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/super_call.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | super(1,); 5 | <<< 6 | super( 7 | 1, 8 | ); 9 | >>> Doesn't force split without trailing comma. 10 | super(1,2,3); 11 | <<< 12 | super(1, 2, 3); 13 | >>> May still split without trailing comma if doesn't fit. 14 | super(argument1, argument2, argument3, argument4); 15 | <<< 16 | super( 17 | argument1, 18 | argument2, 19 | argument3, 20 | argument4, 21 | ); 22 | >>> Named super call. 23 | super.named(1,); 24 | <<< 25 | super.named( 26 | 1, 27 | ); -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/switch_expression.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | >>> Forces split with trailing comma. 4 | ### Note that switch expressions always split even when preserve trailing commas 5 | ### is off, so this test is redundant, but ensures that the option doesn't 6 | ### change how switch expressions behave. 7 | e = switch(y){0=>a,}; 8 | <<< 9 | e = switch (y) { 10 | 0 => a, 11 | }; -------------------------------------------------------------------------------- /test/tall/preserve_trailing_commas/typedef.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | (trailing_commas preserve) 3 | ### Old generic typedef syntax. 4 | >>> Forces split with trailing comma. 5 | typedef Foo(int x,); 6 | <<< 7 | typedef Foo( 8 | int x, 9 | ); 10 | >>> Doesn't force split without trailing comma. 11 | typedef Foo(int x); 12 | <<< 13 | typedef Foo(int x); 14 | >>> May still split without trailing comma if doesn't fit. 15 | typedef Foo(parameter1, parameter2, parameter3); 16 | <<< 17 | typedef Foo( 18 | parameter1, 19 | parameter2, 20 | parameter3, 21 | ); -------------------------------------------------------------------------------- /test/tall/regression/0000/0009.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | List> _stageTransformers( 3 | Map> transformerDependencies) {} 4 | <<< 5 | List> _stageTransformers( 6 | Map> transformerDependencies, 7 | ) {} -------------------------------------------------------------------------------- /test/tall/regression/0000/0013.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> no trailing whitespace before initializer comment 3 | class A { 4 | A() 5 | // comment 6 | : field = value; 7 | } 8 | <<< 9 | class A { 10 | A() 11 | // comment 12 | : field = value; 13 | } 14 | >>> no trailing whitespace before initializer comment when params wrap 15 | class A { 16 | A(some, very, long, parameter, list, that, wraps) 17 | // comment 18 | : field = value; 19 | } 20 | <<< 21 | class A { 22 | A( 23 | some, 24 | very, 25 | long, 26 | parameter, 27 | list, 28 | that, 29 | wraps, 30 | ) 31 | // comment 32 | : field = value; 33 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0014.unit: -------------------------------------------------------------------------------- 1 | >>> https://github.com/dart-lang/dart_style/issues/14 2 | class A { 3 | final Map x; 4 | A() : x = { 5 | // comment 6 | 'foo': 1, 7 | 'bar': 2, 8 | }; 9 | } 10 | <<< 11 | class A { 12 | final Map x; 13 | A() 14 | : x = { 15 | // comment 16 | 'foo': 1, 17 | 'bar': 2, 18 | }; 19 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0026.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | experimentalBootstrap = document 3 | .querySelectorAll('link') 4 | .any((link) => link.attributes['rel'] == 5 | 'import' && link.attributes['href'] == POLYMER_EXPERIMENTAL_HTML); 6 | <<< 7 | experimentalBootstrap = document 8 | .querySelectorAll('link') 9 | .any( 10 | (link) => 11 | link.attributes['rel'] == 'import' && 12 | link.attributes['href'] == POLYMER_EXPERIMENTAL_HTML, 13 | ); -------------------------------------------------------------------------------- /test/tall/regression/0000/0027.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | if (tag == 'style' || tag == 'script' && 3 | (type == null || type == TYPE_JS || type == TYPE_DART) || 4 | tag == 'link' && (rel == 'stylesheet' || rel == 'import')) {} 5 | <<< 6 | if (tag == 'style' || 7 | tag == 'script' && 8 | (type == null || type == TYPE_JS || type == TYPE_DART) || 9 | tag == 'link' && (rel == 'stylesheet' || rel == 'import')) {} -------------------------------------------------------------------------------- /test/tall/regression/0000/0028.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool _hasLibraryDirective(String code) => 3 | parseDirectives(code, suppressErrors: true) 4 | .directives.any((d) => d is LibraryDirective); 5 | <<< 6 | ### TODO(rnystrom): I think the before was better here. 7 | bool _hasLibraryDirective(String code) => parseDirectives( 8 | code, 9 | suppressErrors: true, 10 | ).directives.any((d) => d is LibraryDirective); -------------------------------------------------------------------------------- /test/tall/regression/0000/0033.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | if (maximumIntegerDigits > 3 | 1 && maximumIntegerDigits > minimumIntegerDigits) {} 4 | <<< 5 | if (maximumIntegerDigits > 1 && 6 | maximumIntegerDigits > minimumIntegerDigits) {} 7 | >>> (indent 4) 8 | while (fractionCodes[fractionLength - 9 | 1] == _zero && fractionLength > minimumFractionDigits + 1) {} 10 | <<< 11 | while (fractionCodes[fractionLength - 1] == _zero && 12 | fractionLength > minimumFractionDigits + 1) {} -------------------------------------------------------------------------------- /test/tall/regression/0000/0039.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | var serialization1 = new Serialization(format: format) 3 | ..addRules(rules.values); 4 | <<< 5 | var serialization1 = new Serialization(format: format) 6 | ..addRules(rules.values); -------------------------------------------------------------------------------- /test/tall/regression/0000/0041.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | return new Serialization.blank()..namedObjects['Node'] =reflect(new Node('')).type; 3 | <<< 4 | return new Serialization.blank() 5 | ..namedObjects['Node'] = reflect(new Node('')).type; -------------------------------------------------------------------------------- /test/tall/regression/0000/0042.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | import 'dart:io' show Alphabet, Bookings, Calendar, Dentist, Elephant; 4 | <<< 5 | import 'dart:io' 6 | show 7 | Alphabet, 8 | Bookings, 9 | Calendar, 10 | Dentist, 11 | Elephant; -------------------------------------------------------------------------------- /test/tall/regression/0000/0045.stmt: -------------------------------------------------------------------------------- 1 | >>> doesn't wrap after condition on single-line ifs 2 | foo() { 3 | if (xxxxxxxxxxxxxxxx || xxxxxxxxxxxxxxxxxxxxx) 4 | return xxxxxxxxxxxxxx ? xxxxxxxxxxxxxxxxxxxx : xxxxxxxxxxxxxxxxxxxxxxxxxx; 5 | } 6 | <<< 7 | foo() { 8 | if (xxxxxxxxxxxxxxxx || xxxxxxxxxxxxxxxxxxxxx) 9 | return xxxxxxxxxxxxxx ? xxxxxxxxxxxxxxxxxxxx : xxxxxxxxxxxxxxxxxxxxxxxxxx; 10 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0046.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() { 3 | if (true) 4 | // comment! 5 | return 0; 6 | } 7 | <<< 8 | foo() { 9 | if (true) 10 | // comment! 11 | return 0; 12 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0047.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | String say(String from, String msg, 3 | [String device='carrier pigeon', String mood]) {} 4 | <<< 5 | String say( 6 | String from, 7 | String msg, [ 8 | String device = 'carrier pigeon', 9 | String mood, 10 | ]) {} -------------------------------------------------------------------------------- /test/tall/regression/0000/0049.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var hawaiianBeaches = { 3 | 'oahu' : ['waikiki', 'kailua', 'waimanalo'], 4 | 'big island' : ['wailea bay', 'pololu beach'], 5 | 'kauai' : ['hanalei', 'poipu'] 6 | }; 7 | <<< 8 | var hawaiianBeaches = { 9 | 'oahu': ['waikiki', 'kailua', 'waimanalo'], 10 | 'big island': ['wailea bay', 'pololu beach'], 11 | 'kauai': ['hanalei', 'poipu'], 12 | }; -------------------------------------------------------------------------------- /test/tall/regression/0000/0054.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | httpClient.getUrl(url) 3 | .then((HttpClientRequest request) { 4 | print('have request'); 5 | return request.close(); 6 | }) 7 | .then((HttpClientResponse response) { 8 | body; 9 | }); 10 | <<< 11 | httpClient 12 | .getUrl(url) 13 | .then((HttpClientRequest request) { 14 | print('have request'); 15 | return request.close(); 16 | }) 17 | .then((HttpClientResponse response) { 18 | body; 19 | }); -------------------------------------------------------------------------------- /test/tall/regression/0000/0056.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | _sources[uri] = src = new _MockSdkSource(uri, 'library dart.${uri.path};'); 3 | <<< 4 | _sources[uri] = src = new _MockSdkSource( 5 | uri, 6 | 'library dart.${uri.path};', 7 | ); 8 | <<< 3.7 9 | _sources[uri] = 10 | src = new _MockSdkSource(uri, 'library dart.${uri.path};'); -------------------------------------------------------------------------------- /test/tall/regression/0000/0057.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | embeddedPlural2(n) => Intl.message( 3 | "${Intl.plural(n, 4 | zero: 'none', one: 'one', other: 'some')} plus some text.", 5 | name: 'embeddedPlural2', desc: 'An embedded plural', args: [n]); 6 | <<< 7 | embeddedPlural2(n) => Intl.message( 8 | "${Intl.plural(n, zero: 'none', one: 'one', other: 'some')} plus some text.", 9 | name: 'embeddedPlural2', 10 | desc: 'An embedded plural', 11 | args: [n], 12 | ); -------------------------------------------------------------------------------- /test/tall/regression/0000/0058.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool doStuff(String firstArgX, {String secondArg, String arg3foo, Map anotherArg, bool yetAnotherArg: false, bool tooManyArgs: true}) {} 4 | <<< 5 | bool doStuff( 6 | String firstArgX, { 7 | String secondArg, 8 | String arg3foo, 9 | Map anotherArg, 10 | bool yetAnotherArg: false, 11 | bool tooManyArgs: true, 12 | }) {} -------------------------------------------------------------------------------- /test/tall/regression/0000/0060.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var paths = new Directory(inputDir).listSync() 3 | .where((f) => f is File).map((f) => f.path) 4 | .where((p) => p.endsWith('.dart') && filePattern.hasMatch(p)); 5 | <<< 6 | var paths = new Directory(inputDir) 7 | .listSync() 8 | .where((f) => f is File) 9 | .map((f) => f.path) 10 | .where((p) => p.endsWith('.dart') && filePattern.hasMatch(p)); -------------------------------------------------------------------------------- /test/tall/regression/0000/0061.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo extends Bar { 3 | qux(n) { 4 | // Do some stuff 5 | if (x != null && x.y == n.z 6 | // and some other stuff. 7 | && n.parent.x != y) { 8 | // 9 | } 10 | } 11 | } 12 | <<< 13 | class Foo extends Bar { 14 | qux(n) { 15 | // Do some stuff 16 | if (x != null && 17 | x.y == n.z 18 | // and some other stuff. 19 | && 20 | n.parent.x != y) { 21 | // 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0066.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | void _queriesTest(HttpRequest request) { 3 | var queries = _parseInt(request.uri.queryParameters['queries']).clamp(1, 500); 4 | } 5 | <<< 6 | void _queriesTest(HttpRequest request) { 7 | var queries = _parseInt(request.uri.queryParameters['queries']).clamp(1, 500); 8 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0069.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var x = foo(""" 3 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 4 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 5 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 6 | """); 7 | <<< 8 | var x = foo(""" 9 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 10 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 11 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 12 | """); 13 | >>> 14 | var map = { 15 | 'key------': ''' 16 | ----------------- 17 | ----------------- 18 | ----------------- 19 | ''', 20 | }; 21 | <<< 22 | var map = { 23 | 'key------': ''' 24 | ----------------- 25 | ----------------- 26 | ----------------- 27 | ''', 28 | }; -------------------------------------------------------------------------------- /test/tall/regression/0000/0071.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | expect(testFiles.containsKey('/main.dart'), isTrue, 4 | reason: '`/main.dart` is missing in testFiles'); 5 | } 6 | <<< 7 | void main() { 8 | expect( 9 | testFiles.containsKey('/main.dart'), 10 | isTrue, 11 | reason: '`/main.dart` is missing in testFiles', 12 | ); 13 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0072.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class A { 3 | foo() { 4 | // comment #1 5 | if (comment != null && comment.end == token.offset 6 | // comment #2 7 | && node.parent.beginToken != token) { 8 | } 9 | } 10 | } 11 | <<< 12 | class A { 13 | foo() { 14 | // comment #1 15 | if (comment != null && 16 | comment.end == token.offset 17 | // comment #2 18 | && 19 | node.parent.beginToken != token) {} 20 | } 21 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0077.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var results = blablablabla(uri, sdkDir: shouldMockSdk ? null : 3 | dartSdkPath, mockSdkSources: shouldBlaBlab ? someBlaBlablab : 4 | null, someargn: args['blalbala'], fooBazzzz: fooBazzzz); 5 | <<< 6 | var results = blablablabla( 7 | uri, 8 | sdkDir: shouldMockSdk ? null : dartSdkPath, 9 | mockSdkSources: shouldBlaBlab ? someBlaBlablab : null, 10 | someargn: args['blalbala'], 11 | fooBazzzz: fooBazzzz, 12 | ); -------------------------------------------------------------------------------- /test/tall/regression/0000/0081.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | var aLocalVar12 = new APrettyClass(APrettyClass.aStaticMethodOnIt(anArgument)); 3 | <<< 4 | var aLocalVar12 = new APrettyClass( 5 | APrettyClass.aStaticMethodOnIt(anArgument), 6 | ); 7 | >>> 8 | main() { 9 | variableName.methodName( 10 | level, span.message(error.message, color: colorOf(severity.name))); 11 | } 12 | <<< 13 | main() { 14 | variableName.methodName( 15 | level, 16 | span.message(error.message, color: colorOf(severity.name)), 17 | ); 18 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0082.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var mymap = { 3 | // foo 4 | 'key': ''' 5 | value value value value value value value value value value value value 6 | value value value value value value value value value 7 | ''', 8 | }; 9 | <<< 10 | var mymap = { 11 | // foo 12 | 'key': ''' 13 | value value value value value value value value value value value value 14 | value value value value value value value value value 15 | ''', 16 | }; -------------------------------------------------------------------------------- /test/tall/regression/0000/0083.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | test('some string here', () { 4 | return aVeryLongFunctionThatNeedsToWrap(toASecondLine, wrapWap, onThe, 5 | argsHere).then((_) { 6 | someLongFunctionHereToo( 7 | 'value value value value value value valvalue value value value'); 8 | }); 9 | }); 10 | } 11 | <<< 12 | main() { 13 | test('some string here', () { 14 | return aVeryLongFunctionThatNeedsToWrap( 15 | toASecondLine, 16 | wrapWap, 17 | onThe, 18 | argsHere, 19 | ).then((_) { 20 | someLongFunctionHereToo( 21 | 'value value value value value value valvalue value value value', 22 | ); 23 | }); 24 | }); 25 | } -------------------------------------------------------------------------------- /test/tall/regression/0000/0085.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @MyGlobal() 3 | final SomeType type; 4 | <<< 5 | @MyGlobal() 6 | final SomeType type; -------------------------------------------------------------------------------- /test/tall/regression/0000/0086.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'package:analyzer/src/generated/element.dart' show LibraryElement, CompilationUnitElement; 3 | <<< 4 | import 'package:analyzer/src/generated/element.dart' 5 | show LibraryElement, CompilationUnitElement; -------------------------------------------------------------------------------- /test/tall/regression/0000/0089.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | #!/usr/bin/env dart 3 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 4 | // for details. All rights reserved. Use of this source code is governed by a 5 | // BSD-style license that can be found in the LICENSE file. 6 | <<< 7 | #!/usr/bin/env dart 8 | 9 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 10 | // for details. All rights reserved. Use of this source code is governed by a 11 | // BSD-style license that can be found in the LICENSE file. -------------------------------------------------------------------------------- /test/tall/regression/0000/0091.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | expect(Bidi.guardBracketInHtml(strWithRtl2), 3 | equals("\u05d0 a (asc:))")); 4 | <<< 5 | expect( 6 | Bidi.guardBracketInHtml(strWithRtl2), 7 | equals("\u05d0 a (asc:))"), 8 | ); -------------------------------------------------------------------------------- /test/tall/regression/0000/0095.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | String lookupMessage( 3 | String message_str, [final String desc = '', final Map examples = const { 4 | }, String locale, String name, List args, String meaning]) => 5 | message_str; 6 | <<< 7 | String lookupMessage( 8 | String message_str, [ 9 | final String desc = '', 10 | final Map examples = const {}, 11 | String locale, 12 | String name, 13 | List args, 14 | String meaning, 15 | ]) => message_str; -------------------------------------------------------------------------------- /test/tall/regression/0000/0098.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var camelSuperClass = 3 | superClass.split('-').map((e) => _toCamelCase(e)).join(''); 4 | <<< 5 | var camelSuperClass = superClass 6 | .split('-') 7 | .map((e) => _toCamelCase(e)) 8 | .join(''); -------------------------------------------------------------------------------- /test/tall/regression/0000/0099.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | String html = ''' 3 | some long string that does not fit in one line along with the type 4 | '''; 5 | <<< 6 | String html = ''' 7 | some long string that does not fit in one line along with the type 8 | '''; -------------------------------------------------------------------------------- /test/tall/regression/0100/0100.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | void incrementalAdd(Constraint c) { 3 | int mark = newMark(); 4 | for (Constraint overridden = c.satisfy(mark); 5 | overridden != null; 6 | overridden = overridden.satisfy(mark)); 7 | } 8 | <<< 9 | void incrementalAdd(Constraint c) { 10 | int mark = newMark(); 11 | for ( 12 | Constraint overridden = c.satisfy(mark); 13 | overridden != null; 14 | overridden = overridden.satisfy(mark) 15 | ) 16 | ; 17 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0102.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | isTwoWay = !isEvent && bindings.isWhole && (isCustomTag || 3 | tag == 'input' && (name == 'value' || name =='checked') || 4 | tag == 'select' && (name == 'selectedindex' || name == 'value') || 5 | tag == 'textarea' && name == 'value'); 6 | <<< 7 | isTwoWay = 8 | !isEvent && 9 | bindings.isWhole && 10 | (isCustomTag || 11 | tag == 'input' && (name == 'value' || name == 'checked') || 12 | tag == 'select' && (name == 'selectedindex' || name == 'value') || 13 | tag == 'textarea' && name == 'value'); -------------------------------------------------------------------------------- /test/tall/regression/0100/0109.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | library x.y.z; 3 | <<< 4 | library x.y.z; -------------------------------------------------------------------------------- /test/tall/regression/0100/0110.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var long___________________________________________________________name = 3 | const Foo.named('long string long string long string', 'second arg').split( 4 | ','); 5 | <<< 6 | var long___________________________________________________________name = 7 | const Foo.named( 8 | 'long string long string long string', 9 | 'second arg', 10 | ).split(','); -------------------------------------------------------------------------------- /test/tall/regression/0100/0113.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() { 3 | // comment 4 | f() + 1; 5 | } 6 | <<< 7 | foo() { 8 | // comment 9 | f() + 1; 10 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0119.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | boardData 3 | ..drawPixels(op.getBitmapData('game_board_side_top'), tbr, new Point( 4 | 112 + i * 80, 0)); 5 | <<< 6 | boardData..drawPixels( 7 | op.getBitmapData('game_board_side_top'), 8 | tbr, 9 | new Point(112 + i * 80, 0), 10 | ); 11 | >>> (indent 6) 12 | var initialOffset = new Vector( 13 | SquareElement.SIZE * c.x, SquareElement.SIZE * c.y); 14 | <<< 15 | var initialOffset = new Vector( 16 | SquareElement.SIZE * c.x, 17 | SquareElement.SIZE * c.y, 18 | ); -------------------------------------------------------------------------------- /test/tall/regression/0100/0130.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | int get screenY => window.screenTop + window.outerHeight - 3 | window.innerHeight - 4 | _borderWidth + 5 | clientY; 6 | <<< 7 | int get screenY => 8 | window.screenTop + 9 | window.outerHeight - 10 | window.innerHeight - 11 | _borderWidth + 12 | clientY; -------------------------------------------------------------------------------- /test/tall/regression/0100/0132.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | for (; i < words.length; i++) { 3 | buffer.write(' '); 4 | buffer.write(words[i]); 5 | } 6 | <<< 7 | for (; i < words.length; i++) { 8 | buffer.write(' '); 9 | buffer.write(words[i]); 10 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0133.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | testCase._error( 3 | 'Callback ${id}called ($actualCalls) after test case ' 4 | '${testCase.description} has already been marked as ' 5 | '${testCase.result}.$reason'); 6 | <<< 7 | testCase._error( 8 | 'Callback ${id}called ($actualCalls) after test case ' 9 | '${testCase.description} has already been marked as ' 10 | '${testCase.result}.$reason', 11 | ); -------------------------------------------------------------------------------- /test/tall/regression/0100/0135.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var handler = new Cascade() 3 | .add((_) => new Response.notFound('handler 1')) 4 | .add((_) => new Response.ok('handler 2')).handler; 5 | <<< 6 | var handler = new Cascade() 7 | .add((_) => new Response.notFound('handler 1')) 8 | .add((_) => new Response.ok('handler 2')) 9 | .handler; 10 | <<< 3.7 11 | var handler = 12 | new Cascade() 13 | .add((_) => new Response.notFound('handler 1')) 14 | .add((_) => new Response.ok('handler 2')) 15 | .handler; -------------------------------------------------------------------------------- /test/tall/regression/0100/0140.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | localsHandler.directLocals[localsHandler 3 | .getTypeVariableAsLocal(typeVariable)] = param; 4 | <<< 5 | localsHandler.directLocals[localsHandler.getTypeVariableAsLocal( 6 | typeVariable, 7 | )] = 8 | param; -------------------------------------------------------------------------------- /test/tall/regression/0100/0141.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | void buildComplexSwitchStatement(ast.SwitchStatement node, 3 | Map constants, 4 | Map caseIndex, 5 | bool hasDefault) { 6 | ; 7 | } 8 | <<< 9 | void buildComplexSwitchStatement( 10 | ast.SwitchStatement node, 11 | Map constants, 12 | Map caseIndex, 13 | bool hasDefault, 14 | ) { 15 | ; 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0146.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | foo([1, 2, 4, 5, 6, 7, 8, 20], argument, argument, argument, argument, argument); 4 | } 5 | <<< 6 | main() { 7 | foo( 8 | [1, 2, 4, 5, 6, 7, 8, 20], 9 | argument, 10 | argument, 11 | argument, 12 | argument, 13 | argument, 14 | ); 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0151.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Foo(int longArg1, int longArg2, int longArg3, int longArg4, int longArg5, 4 | int longArg6) : this._(longArg1); 5 | 6 | Foo._(int a); 7 | } 8 | <<< 9 | class Foo { 10 | Foo( 11 | int longArg1, 12 | int longArg2, 13 | int longArg3, 14 | int longArg4, 15 | int longArg5, 16 | int longArg6, 17 | ) : this._(longArg1); 18 | 19 | Foo._(int a); 20 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0152.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | someReallyLongFunctionName('a really really really really long argument', 4 | 'a really really really really long argument'); 5 | } 6 | <<< 7 | main() { 8 | someReallyLongFunctionName( 9 | 'a really really really really long argument', 10 | 'a really really really really long argument', 11 | ); 12 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0154.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() async { 3 | await for(var x in y) { 4 | } 5 | } 6 | <<< 7 | foo() async { 8 | await for (var x in y) {} 9 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0155.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var from = node.baseType, to = node.convertedType; 3 | <<< 4 | var from = node.baseType, to = node.convertedType; -------------------------------------------------------------------------------- /test/tall/regression/0100/0156.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | final bar; 4 | final baz; 5 | Foo(int this.bar(), this.baz); 6 | } 7 | <<< 8 | class Foo { 9 | final bar; 10 | final baz; 11 | Foo(int this.bar(), this.baz); 12 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0161.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | var partOf = unit.directives.firstWhere((d) => d is PartOfDirective, 3 | orElse: () => null); 4 | <<< 5 | var partOf = unit.directives.firstWhere( 6 | (d) => d is PartOfDirective, 7 | orElse: () => null, 8 | ); -------------------------------------------------------------------------------- /test/tall/regression/0100/0168.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo {} 3 | class Bar {} 4 | <<< 5 | class Foo {} 6 | 7 | class Bar {} -------------------------------------------------------------------------------- /test/tall/regression/0100/0170.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | print(- -2); 4 | } 5 | <<< 6 | main() { 7 | print(- -2); 8 | } 9 | >>> 10 | main() { 11 | var x = - --y; 12 | } 13 | <<< 14 | main() { 15 | var x = - --y; 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0176.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | Iterable generate() sync* { 3 | int i = 0; 4 | 5 | while (i++ < 100) { 6 | yield new Task(i, rnd.nextInt(100), calc); 7 | } 8 | } 9 | <<< 10 | Iterable generate() sync* { 11 | int i = 0; 12 | 13 | while (i++ < 100) { 14 | yield new Task(i, rnd.nextInt(100), calc); 15 | } 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0177.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | List l0 = /*info:InferredTypeLiteral*/[]; 3 | <<< 4 | List l0 = /*info:InferredTypeLiteral*/ []; -------------------------------------------------------------------------------- /test/tall/regression/0100/0178.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'dart:async'; /* soup */ import 'dart:io'; 3 | 4 | void main() { 5 | print('hi'); 6 | } 7 | <<< 8 | import 'dart:async'; /* soup */ 9 | import 'dart:io'; 10 | 11 | void main() { 12 | print('hi'); 13 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0184.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | abstract class Connection { 3 | // ... 4 | } 5 | <<< 6 | abstract class Connection< 7 | TLookupResponse, 8 | TLookupRequest, 9 | TRunQueryResponse, 10 | TRunQueryRequest, 11 | TBeginTransactionResponse, 12 | TBeginTransactionRequest, 13 | TCommitResponse, 14 | TCommitRequest, 15 | TRollbackResponse, 16 | TRollbackRequest, 17 | TAllocateIdsResponse, 18 | TAllocateIdsRequest 19 | > { 20 | // ... 21 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0192.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | /// test 4 | Foo(); 5 | } 6 | <<< 7 | class Foo { 8 | /// test 9 | Foo(); 10 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0197.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class FormatterBugTest { 3 | final String _test; 4 | 5 | FormatterBugTest(@deprecated this._test); 6 | } 7 | <<< 8 | class FormatterBugTest { 9 | final String _test; 10 | 11 | FormatterBugTest(@deprecated this._test); 12 | } -------------------------------------------------------------------------------- /test/tall/regression/0100/0199.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | final monitorTimeout = (utcTime.millisecondsSinceEpoch + 3 | 3 * Duration.MILLISECONDS_PER_MINUTE) / 4 | 1000; 5 | <<< 6 | final monitorTimeout = 7 | (utcTime.millisecondsSinceEpoch + 8 | 3 * Duration.MILLISECONDS_PER_MINUTE) / 9 | 1000; -------------------------------------------------------------------------------- /test/tall/regression/0200/0200.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | final confirmationFuture = _dialogService.showConfirmationDialog( 3 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', 4 | new DialogSettings() 5 | ..primaryButton = DialogSettings.BUTTON_CANCEL 6 | ..okButtonText = 'OK' 7 | ..cancelButtonText = 'Kittens'); 8 | <<< 9 | final confirmationFuture = _dialogService.showConfirmationDialog( 10 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', 11 | new DialogSettings() 12 | ..primaryButton = DialogSettings.BUTTON_CANCEL 13 | ..okButtonText = 'OK' 14 | ..cancelButtonText = 'Kittens', 15 | ); -------------------------------------------------------------------------------- /test/tall/regression/0200/0201.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | var s = 4 | 'qsmdlfkjqlsdf mlqdskf mlqkds flq fdmlqk mqlfk ' 'mlfqks dflq sdmlfkjqmlsdkjf mlqks mfdlq smlf ' 'mqlskdjf mlqksd jfmlqkj dmflkq mdslk jfmqds kf'; 5 | } 6 | <<< 7 | main() { 8 | var s = 9 | 'qsmdlfkjqlsdf mlqdskf mlqkds flq fdmlqk mqlfk ' 10 | 'mlfqks dflq sdmlfkjqmlsdkjf mlqks mfdlq smlf ' 11 | 'mqlskdjf mlqksd jfmlqkj dmflkq mdslk jfmqds kf'; 12 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0205.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | activity 3 | ..parameters[ 4 | requestDeserialization] = '${stopwatch.elapsedMilliseconds}'; 5 | <<< 6 | activity 7 | ..parameters[requestDeserialization] = '${stopwatch.elapsedMilliseconds}'; 8 | >>> (indent 6) 9 | activity 10 | ..parameters[ 11 | requestDeserialization] = '${stopwatch.elapsedMilliseconds}'; 12 | <<< 13 | activity 14 | ..parameters[requestDeserialization] = 15 | '${stopwatch.elapsedMilliseconds}'; -------------------------------------------------------------------------------- /test/tall/regression/0200/0206.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | when(mockLoader.loadData(expectedRequestMetricInitialDateCTR)) 3 | .thenReturn( 4 | _buildMinimalResponseFuture(MetricType.CTR, metricRequest)); 5 | <<< 6 | ### TODO(rnystrom): I think it would look better to split the method chain. 7 | when( 8 | mockLoader.loadData(expectedRequestMetricInitialDateCTR), 9 | ).thenReturn(_buildMinimalResponseFuture(MetricType.CTR, metricRequest)); -------------------------------------------------------------------------------- /test/tall/regression/0200/0218.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | var player = body.animate( 3 | [{"font-size": "500px"}, {"font-size": fontSize}], {"duration": 100}); 4 | <<< 5 | var player = body.animate( 6 | [ 7 | {"font-size": "500px"}, 8 | {"font-size": fontSize}, 9 | ], 10 | {"duration": 100}, 11 | ); -------------------------------------------------------------------------------- /test/tall/regression/0200/0222.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | clientParams.forEach((k, v) => log.info(() => 3 | "&${k}${(v != null) ? '=${v}' : ''}")); 4 | <<< 5 | clientParams.forEach( 6 | (k, v) => log.info(() => "&${k}${(v != null) ? '=${v}' : ''}"), 7 | ); 8 | >>> (indent 4) 9 | clientParams.forEach((k, v) => log.info(() => 10 | "&${k}${(v != null) ? '=${v}' : ''}")); 11 | <<< 12 | clientParams.forEach( 13 | (k, v) => log.info(() => "&${k}${(v != null) ? '=${v}' : ''}"), 14 | ); -------------------------------------------------------------------------------- /test/tall/regression/0200/0223.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | Foo barBaz() => new Quux({ 3 | 'alpha.beta.gamma': [ 4 | new Zuul({'yarrr': Abracadabra.OPEN_SESAME,}, { 5 | 'toil': {'trouble': {'fireBurn': {'cauldronBubble': EYE_OF_NEWT,}}} 6 | }) 7 | ] 8 | }); 9 | <<< 10 | Foo barBaz() => new Quux({ 11 | 'alpha.beta.gamma': [ 12 | new Zuul( 13 | {'yarrr': Abracadabra.OPEN_SESAME}, 14 | { 15 | 'toil': { 16 | 'trouble': { 17 | 'fireBurn': {'cauldronBubble': EYE_OF_NEWT}, 18 | }, 19 | }, 20 | }, 21 | ), 22 | ], 23 | }); -------------------------------------------------------------------------------- /test/tall/regression/0200/0226.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | test('Bad Request${(detail!='' ? ': ' : '')}$detail'); 3 | <<< 4 | test('Bad Request${(detail != '' ? ': ' : '')}$detail'); -------------------------------------------------------------------------------- /test/tall/regression/0200/0228.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class SomeLongNameForAComponent implements AttachAware, ShadowRootAware, 3 | DetachAware, SomeExternalViewFactory, AnotherInterface { 4 | // ... 5 | } 6 | <<< 7 | class SomeLongNameForAComponent 8 | implements 9 | AttachAware, 10 | ShadowRootAware, 11 | DetachAware, 12 | SomeExternalViewFactory, 13 | AnotherInterface { 14 | // ... 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0229.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class SomeLongNameForAComponent { 3 | SomeLongNameForAComponent(DirectiveInjector injector, 4 | RenderSyncZoneAccess zoneAccess, 5 | this._formatters, 6 | this._element, 7 | this._scope); 8 | } 9 | <<< 10 | class SomeLongNameForAComponent { 11 | SomeLongNameForAComponent( 12 | DirectiveInjector injector, 13 | RenderSyncZoneAccess zoneAccess, 14 | this._formatters, 15 | this._element, 16 | this._scope, 17 | ); 18 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0232.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @Component( 3 | selector: 'foo-dialog', 4 | templateUrl: 'package:path.to.cool.foo/foo_dialog.html', 5 | exportExpressions: const [ 6 | 'nnnnnnnnState', 7 | 'mmmmmmmmTypeName', 8 | 'blockingId', 9 | 'closeTab', 10 | 'formIsValid', 11 | 'zzzzzzzzzNote' 12 | ]) 13 | class Foo {} 14 | <<< 15 | @Component( 16 | selector: 'foo-dialog', 17 | templateUrl: 'package:path.to.cool.foo/foo_dialog.html', 18 | exportExpressions: const [ 19 | 'nnnnnnnnState', 20 | 'mmmmmmmmTypeName', 21 | 'blockingId', 22 | 'closeTab', 23 | 'formIsValid', 24 | 'zzzzzzzzzNote', 25 | ], 26 | ) 27 | class Foo {} -------------------------------------------------------------------------------- /test/tall/regression/0200/0235.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class _MultiSelectionModelImpl 3 | extends ChangeNotifier 4 | with SelectionChangeNotifier 5 | implements SelectionModel { 6 | // ... 7 | } 8 | <<< 9 | class _MultiSelectionModelImpl extends ChangeNotifier 10 | with SelectionChangeNotifier 11 | implements SelectionModel { 12 | // ... 13 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0237.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Bar { 3 | void foo() { 4 | blah.method(someLongArgument, andAnotherOne, andAThirdOne, andOneMore) 5 | .then((var x) { 6 | var y = x * 2; 7 | }); 8 | } 9 | } 10 | <<< 11 | class Bar { 12 | void foo() { 13 | blah.method(someLongArgument, andAnotherOne, andAThirdOne, andOneMore).then( 14 | (var x) { 15 | var y = x * 2; 16 | }, 17 | ); 18 | } 19 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0238.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class ObjectBenchmark extends ObservationBenchmarkBase { 3 | ObjectBenchmark(int objectCount, int mutationCount, String config) : super( 4 | 'ObjectBenchmark:$objectCount:$mutationCount:$config', objectCount, 5 | mutationCount, config); 6 | } 7 | <<< 8 | class ObjectBenchmark extends ObservationBenchmarkBase { 9 | ObjectBenchmark(int objectCount, int mutationCount, String config) 10 | : super( 11 | 'ObjectBenchmark:$objectCount:$mutationCount:$config', 12 | objectCount, 13 | mutationCount, 14 | config, 15 | ); 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0249.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | clip.onTransitionEnd 3 | .where((TransitionEvent e) => e.propertyName == 'height') 4 | .first.then((_) => clip.classes.add('expanded')); 5 | <<< 6 | clip.onTransitionEnd 7 | .where((TransitionEvent e) => e.propertyName == 'height') 8 | .first 9 | .then((_) => clip.classes.add('expanded')); -------------------------------------------------------------------------------- /test/tall/regression/0200/0250.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class VeryInterestingThing { 3 | factory VeryInterestingThing.fromJson( 4 | mylibrarythathasalongname.JsonData jsonData) => new VeryInterestingThing( 5 | otherlibrary.InterestingState.fromJson(jsonData.encodedState)); 6 | } 7 | <<< 8 | class VeryInterestingThing { 9 | factory VeryInterestingThing.fromJson( 10 | mylibrarythathasalongname.JsonData jsonData, 11 | ) => new VeryInterestingThing( 12 | otherlibrary.InterestingState.fromJson(jsonData.encodedState), 13 | ); 14 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0255.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 10) 2 | return new Rewriter(code, codegen, 3 | mirrorMode: mirrorMode, writeStaticInit: writeStaticInit).rewrite( 4 | parseCompilationUnit(code, 5 | name: reflectionEntryPointPath, parseFunctionBodies: false)); 6 | <<< 7 | return new Rewriter( 8 | code, 9 | codegen, 10 | mirrorMode: mirrorMode, 11 | writeStaticInit: writeStaticInit, 12 | ).rewrite( 13 | parseCompilationUnit( 14 | code, 15 | name: reflectionEntryPointPath, 16 | parseFunctionBodies: false, 17 | ), 18 | ); -------------------------------------------------------------------------------- /test/tall/regression/0200/0256.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | static final UNKNOWN_ERROR = new MapsEngineStatus._('UNKNOWN_ERROR', context[ 4 | 'google']['maps']['visualization']['MapsEngineStatus']['UNKNOWN_ERROR']); 5 | } 6 | <<< 7 | class Foo { 8 | static final UNKNOWN_ERROR = new MapsEngineStatus._( 9 | 'UNKNOWN_ERROR', 10 | context['google']['maps']['visualization']['MapsEngineStatus']['UNKNOWN_ERROR'], 11 | ); 12 | } -------------------------------------------------------------------------------- /test/tall/regression/0200/0257.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class FooConstructor { 3 | FooConstructor(Object bar) 4 | : foo = (bar == null) 5 | ? 'bar is null this is a very long string that causes a split' 6 | : bar.myField; 7 | } 8 | <<< 9 | class FooConstructor { 10 | FooConstructor(Object bar) 11 | : foo = (bar == null) 12 | ? 'bar is null this is a very long string that causes a split' 13 | : bar.myField; 14 | } 15 | <<< 3.7 16 | class FooConstructor { 17 | FooConstructor(Object bar) 18 | : foo = 19 | (bar == null) 20 | ? 'bar is null this is a very long string that causes a split' 21 | : bar.myField; 22 | } -------------------------------------------------------------------------------- /test/tall/regression/0300/0357.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | bool theMethodNameGoesHere(ParameterTyp result) => reallyLongIdentifier 3 | .any((MyClass myParam) => myParam.id == result.myParam.id); 4 | <<< 5 | bool theMethodNameGoesHere(ParameterTyp result) => reallyLongIdentifier.any( 6 | (MyClass myParam) => myParam.id == result.myParam.id, 7 | ); -------------------------------------------------------------------------------- /test/tall/regression/0300/0364.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | static bool _identityEquality(JsObject a, JsObject b) native "JsObject_identityEquality"; 4 | 5 | static bool short(JsObject a, JsObject b) native "JsObject_identityEquality"; 6 | } 7 | <<< 8 | class Foo { 9 | static bool _identityEquality( 10 | JsObject a, 11 | JsObject b, 12 | ) native "JsObject_identityEquality"; 13 | 14 | static bool short(JsObject a, JsObject b) native "JsObject_identityEquality"; 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0300/0366.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | zoop( 3 | "zoop description here", 4 | spang(() { 5 | ; 6 | })); 7 | <<< 8 | zoop( 9 | "zoop description here", 10 | spang(() { 11 | ; 12 | }), 13 | ); -------------------------------------------------------------------------------- /test/tall/regression/0300/0373.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | TreeNode lookupEntity(Iterable iterable, int entity) => iterable 3 | .firstWhere((node) => (node.entity == entity), orElse: () => null); 4 | <<< 5 | TreeNode lookupEntity(Iterable iterable, int entity) => iterable 6 | .firstWhere((node) => (node.entity == entity), orElse: () => null); -------------------------------------------------------------------------------- /test/tall/regression/0300/0374.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | shadowRoot.querySelector("#slide-out")..onKeyDown.listen(_hideOnEsc)..onClick.listen(hide); 3 | <<< 4 | shadowRoot.querySelector("#slide-out") 5 | ..onKeyDown.listen(_hideOnEsc) 6 | ..onClick.listen(hide); -------------------------------------------------------------------------------- /test/tall/regression/0300/0375.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | for (int inputIndex = 1, statementIndex = 0; 3 | inputIndex < inputs.length; 4 | statementIndex++) {} 5 | <<< 6 | for ( 7 | int inputIndex = 1, statementIndex = 0; 8 | inputIndex < inputs.length; 9 | statementIndex++ 10 | ) {} -------------------------------------------------------------------------------- /test/tall/regression/0300/0377.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | for (int i = 0; 3 | i < positionalArgumentCount; 4 | arguments = arguments.tail, i++) {} 5 | <<< 6 | for ( 7 | int i = 0; 8 | i < positionalArgumentCount; 9 | arguments = arguments.tail, i++ 10 | ) {} -------------------------------------------------------------------------------- /test/tall/regression/0300/0378.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | return new js.Fun(parameters, body, asyncModifier: asyncModifier) 3 | .withSourceInformation(sourceInformationFactory.forContext(element) 4 | .buildDeclaration(element)); 5 | <<< 6 | return new js.Fun( 7 | parameters, 8 | body, 9 | asyncModifier: asyncModifier, 10 | ).withSourceInformation( 11 | sourceInformationFactory.forContext(element).buildDeclaration(element), 12 | ); -------------------------------------------------------------------------------- /test/tall/regression/0300/0379.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | Type___ variable___ = querySelector(' ') 4 | ..setInnerHtml(' ', 5 | validator: new Validator___________() 6 | ..method______(' ')); 7 | } 8 | <<< 9 | void main() { 10 | Type___ variable___ = querySelector(' ') 11 | ..setInnerHtml( 12 | ' ', 13 | validator: new Validator___________()..method______(' '), 14 | ); 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0300/0381.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'package:ads.acx2.components.material_expansionpanel.examples/examples.dart' deferred as expansion; 3 | <<< 4 | import 'package:ads.acx2.components.material_expansionpanel.examples/examples.dart' 5 | deferred as expansion; -------------------------------------------------------------------------------- /test/tall/regression/0300/0382.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | Future doThing() => pool.withResource(() { 3 | // ... 4 | }); 5 | <<< 6 | Future doThing() => pool.withResource(() { 7 | // ... 8 | }); -------------------------------------------------------------------------------- /test/tall/regression/0300/0383.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class MummyMatchers { 3 | MummyMatchers([List publishers]) : publishers = publishers != 4 | null ? publishers : defaultPublishers.add(unittestPublisher); 5 | } 6 | <<< 7 | class MummyMatchers { 8 | MummyMatchers([List publishers]) 9 | : publishers = publishers != null 10 | ? publishers 11 | : defaultPublishers.add(unittestPublisher); 12 | } 13 | <<< 3.7 14 | class MummyMatchers { 15 | MummyMatchers([List publishers]) 16 | : publishers = 17 | publishers != null 18 | ? publishers 19 | : defaultPublishers.add(unittestPublisher); 20 | } -------------------------------------------------------------------------------- /test/tall/regression/0300/0384.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | (scubaMatchers.publishers[ 3 | ErrorCollectingPublisher] as ErrorCollectingPublisher).verify(); 4 | <<< 5 | (scubaMatchers.publishers[ErrorCollectingPublisher] 6 | as ErrorCollectingPublisher) 7 | .verify(); -------------------------------------------------------------------------------- /test/tall/regression/0300/0398.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | children.add(new DrawerHeader(children: [ 3 | new Flex([avatar, username], 4 | justifyContent: FlexJustifyContent.center, 5 | direction: FlexDirection.vertical)])); 6 | <<< 7 | children.add( 8 | new DrawerHeader( 9 | children: [ 10 | new Flex( 11 | [avatar, username], 12 | justifyContent: FlexJustifyContent.center, 13 | direction: FlexDirection.vertical, 14 | ), 15 | ], 16 | ), 17 | ); -------------------------------------------------------------------------------- /test/tall/regression/0300/0399.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | Optional getCookie(String name) => new Optional.fromNullable(_driver 3 | .cookies 4 | .all.firstWhere((cookie) => cookie.name == name, orElse: () => null)); 5 | <<< 6 | Optional getCookie(String name) => new Optional.fromNullable( 7 | _driver.cookies.all.firstWhere( 8 | (cookie) => cookie.name == name, 9 | orElse: () => null, 10 | ), 11 | ); -------------------------------------------------------------------------------- /test/tall/regression/0400/0404.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | group('((prevent timeout))', () { 3 | setUp(() => ensureImageExists()); 4 | 5 | test('((dummy))', () { 6 | }, timeout: const Timeout(const Duration(seconds: 300))); 7 | }); 8 | <<< 9 | group('((prevent timeout))', () { 10 | setUp(() => ensureImageExists()); 11 | 12 | test( 13 | '((dummy))', 14 | () {}, 15 | timeout: const Timeout(const Duration(seconds: 300)), 16 | ); 17 | }); -------------------------------------------------------------------------------- /test/tall/regression/0400/0409.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | it('should complete with an error if the name or website is null or both ' 3 | 'are unchanged', async(() { 4 | ICouldDoAnything(); 5 | })); 6 | <<< 7 | it( 8 | 'should complete with an error if the name or website is null or both ' 9 | 'are unchanged', 10 | async(() { 11 | ICouldDoAnything(); 12 | }), 13 | ); -------------------------------------------------------------------------------- /test/tall/regression/0400/0413.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | List get bindings => [ 3 | bind(const StaticFilePath()) 4 | .toValue(_staticFilePath.isEmpty ? _libRoot : _staticFilePath) 5 | ]; 6 | <<< 7 | List get bindings => [ 8 | bind( 9 | const StaticFilePath(), 10 | ).toValue(_staticFilePath.isEmpty ? _libRoot : _staticFilePath), 11 | ]; -------------------------------------------------------------------------------- /test/tall/regression/0400/0422.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void allTests() { 3 | describe('inliner', () { 4 | it('should inline `templateUrl` values', () async { 5 | expect(view.namedParameters 6 | .firstWhere((p) => p.name == 'templateUrl') 7 | .value).toContain('template.html'); 8 | }); 9 | }); 10 | } 11 | <<< 12 | void allTests() { 13 | describe('inliner', () { 14 | it('should inline `templateUrl` values', () async { 15 | expect( 16 | view.namedParameters.firstWhere((p) => p.name == 'templateUrl').value, 17 | ).toContain('template.html'); 18 | }); 19 | }); 20 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0424.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | obj.functionWithTwoParameters(firstParameterGenerator() 3 | ..id = myId 4 | ..teamId = myTeamId 5 | ..startTime = new Time(getEndOfDate(clock.currentTime()).millisecondsSinceEpoch), secondParameterGenerator()); 6 | <<< 7 | obj.functionWithTwoParameters( 8 | firstParameterGenerator() 9 | ..id = myId 10 | ..teamId = myTeamId 11 | ..startTime = new Time( 12 | getEndOfDate(clock.currentTime()).millisecondsSinceEpoch, 13 | ), 14 | secondParameterGenerator(), 15 | ); -------------------------------------------------------------------------------- /test/tall/regression/0400/0429.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 2) 2 | final Map _campaignSkinSubtypes = 4 | new Map.fromIterable(SummaryTabDataRequest_CampaignSkinSubtype.values, 5 | key: (campaignSkinSubtype) => campaignSkinSubtype.name, 6 | value: (campaignSkinSubtype) => campaignSkinSubtype); 7 | <<< 8 | final Map 9 | _campaignSkinSubtypes = new Map.fromIterable( 10 | SummaryTabDataRequest_CampaignSkinSubtype.values, 11 | key: (campaignSkinSubtype) => campaignSkinSubtype.name, 12 | value: (campaignSkinSubtype) => campaignSkinSubtype, 13 | ); -------------------------------------------------------------------------------- /test/tall/regression/0400/0438.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | final JsFunction _setDartInstance = context['Polymer']['PolymerInterop'] 3 | ['setDartInstance']; 4 | <<< 5 | final JsFunction _setDartInstance = 6 | context['Polymer']['PolymerInterop']['setDartInstance']; -------------------------------------------------------------------------------- /test/tall/regression/0400/0441.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | getSomeFoo( 3 | {fooooooooooooooooooooo: const [ 4 | 'baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 5 | ]}) { 6 | return 'rhubarb'; 7 | } 8 | <<< 9 | getSomeFoo({ 10 | fooooooooooooooooooooo: const ['baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'], 11 | }) { 12 | return 'rhubarb'; 13 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0443.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @sg.GeneratedPart('package:injection/generator.dart') 3 | part 'app.injection.dart'; 4 | <<< 5 | @sg.GeneratedPart('package:injection/generator.dart') 6 | part 'app.injection.dart'; -------------------------------------------------------------------------------- /test/tall/regression/0400/0449.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | for (int i = 0; i < variables.length; ++i) 3 | performance.updateVariable(variables[i]); 4 | <<< 5 | for (int i = 0; i < variables.length; ++i) 6 | performance.updateVariable(variables[i]); -------------------------------------------------------------------------------- /test/tall/regression/0400/0454.unit: -------------------------------------------------------------------------------- 1 | >>> original bug report actually did fit in 80 2 | class F { 3 | List< 4 | AVeryLongTypeNameTHatTheUserCannotChange____________> aDescriptiveName__; 5 | } 6 | <<< 7 | class F { 8 | List aDescriptiveName__; 9 | } 10 | >>> 11 | class F { 12 | List< 13 | AVeryLongTypeNameTHatTheUserCannotChange_____________> aDescriptiveName__; 14 | } 15 | <<< 16 | class F { 17 | List 18 | aDescriptiveName__; 19 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0461.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | receiver___________.property________.add( 3 | new SomeClass___________________.someNamedConstructor_____________________()); 4 | <<< 5 | receiver___________.property________.add( 6 | new SomeClass___________________.someNamedConstructor_____________________(), 7 | ); 8 | >>> (indent 4) 9 | new SomeClass___________________.someNamedConstructor_____________________(); 10 | <<< 11 | new SomeClass___________________.someNamedConstructor_____________________(); -------------------------------------------------------------------------------- /test/tall/regression/0400/0466.unit: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | Future get identifier________ async { 3 | var id = identifier________.identifier__; 4 | 5 | return identifier_____________[ 6 | id] ??= await identifier_______.identifier____________________( 7 | identifier___________________________.create()..identifier____ = id); 8 | } 9 | <<< 10 | Future get identifier________ async { 11 | var id = identifier________.identifier__; 12 | 13 | return identifier_____________[id] ??= await identifier_______ 14 | .identifier____________________( 15 | identifier___________________________.create()..identifier____ = id, 16 | ); 17 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0475.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class ListResultDescriptor { 3 | factory ListResultDescriptor(String name, List defaultValue, 4 | {ResultCachingPolicy< 5 | List> cachingPolicy}) = ListResultDescriptorImpl; 6 | } 7 | <<< 8 | class ListResultDescriptor { 9 | factory ListResultDescriptor( 10 | String name, 11 | List defaultValue, { 12 | ResultCachingPolicy> cachingPolicy, 13 | }) = ListResultDescriptorImpl; 14 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0479.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | _actions..insert.listen(_insert)..delete.listen(_delete)..editable.listen(_makeEditable); 3 | <<< 4 | _actions 5 | ..insert.listen(_insert) 6 | ..delete.listen(_delete) 7 | ..editable.listen(_makeEditable); -------------------------------------------------------------------------------- /test/tall/regression/0400/0481.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Car extends Vehicle with Doors, Windows, Wheels, Tires, 3 | Motor, Hood, Trunk, Roof, Pedals, Gas, Seats, LotsOfFun { 4 | // ... 5 | } 6 | <<< 7 | class Car extends Vehicle 8 | with 9 | Doors, 10 | Windows, 11 | Wheels, 12 | Tires, 13 | Motor, 14 | Hood, 15 | Trunk, 16 | Roof, 17 | Pedals, 18 | Gas, 19 | Seats, 20 | LotsOfFun { 21 | // ... 22 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0488.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | { 3 | fn(x) { ; } 4 | items.forEach(fn); 5 | } 6 | <<< 7 | { 8 | fn(x) { 9 | ; 10 | } 11 | 12 | items.forEach(fn); 13 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0489.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | longerNamedFoo..items.add(new Foo() 3 | ..name = bar.toto 4 | ..placeUrl = place.toString()); 5 | <<< 6 | longerNamedFoo 7 | ..items.add( 8 | new Foo() 9 | ..name = bar.toto 10 | ..placeUrl = place.toString(), 11 | ); -------------------------------------------------------------------------------- /test/tall/regression/0400/0494.unit: -------------------------------------------------------------------------------- 1 | >>> (note: output is weird, but that's ok. the bug was that an assertion failed) 2 | main() { 3 | for (int i = 0; i < 10; i++) 4 | for (int j = 0; j < 3; j++) { 5 | print(''); 6 | } 7 | } 8 | <<< 9 | main() { 10 | for (int i = 0; i < 10; i++) 11 | for (int j = 0; j < 3; j++) { 12 | print(''); 13 | } 14 | } -------------------------------------------------------------------------------- /test/tall/regression/0400/0497.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Stream< 4 | api 5 | .CreateRecipientSourceFromGroupResponse> createRecipientSourceFromGroup( 6 | String groupName, int campaignId, String languagePreference); 7 | } 8 | <<< 9 | class Foo { 10 | Stream 11 | createRecipientSourceFromGroup( 12 | String groupName, 13 | int campaignId, 14 | String languagePreference, 15 | ); 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0503.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Stream< 4 | api 5 | .ReallySuperExtremelyLooooooongTypeName> veryExtremelyLoooongMethodName( 6 | String parameter, int parameter2, String thirdParameter) { 7 | ; 8 | } 9 | } 10 | <<< 11 | class Foo { 12 | Stream 13 | veryExtremelyLoooongMethodName( 14 | String parameter, 15 | int parameter2, 16 | String thirdParameter, 17 | ) { 18 | ; 19 | } 20 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0511.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode( 4 | 'FINAL_NOT_INITIALIZED', 5 | "The final variable '{0}' must be initialized", /*correction:*/ null, /*strongModeError:*/ false); 6 | } 7 | <<< 8 | class Foo { 9 | static const StaticWarningCode FINAL_NOT_INITIALIZED = 10 | const StaticWarningCode( 11 | 'FINAL_NOT_INITIALIZED', 12 | "The final variable '{0}' must be initialized", 13 | /*correction:*/ null, 14 | /*strongModeError:*/ false, 15 | ); 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0513.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | #!script 3 | 4 | 5 | library x; 6 | <<< 7 | #!script 8 | 9 | library x; 10 | >>> 11 | #!script 12 | 13 | library x; 14 | <<< 15 | #!script 16 | 17 | library x; -------------------------------------------------------------------------------- /test/tall/regression/0500/0514.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | someFunction() { 3 | myFunc(namedParam: complexFunc( 4 | complexParam1: "someValue", complexParam2: "anotherValue")); 5 | } 6 | <<< 7 | someFunction() { 8 | myFunc( 9 | namedParam: complexFunc( 10 | complexParam1: "someValue", 11 | complexParam2: "anotherValue", 12 | ), 13 | ); 14 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0519.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | < 3 | int>[1, 2, 3, 4].forEach((int value) { 4 | print(value); 5 | }); 6 | <<< 7 | [1, 2, 3, 4].forEach((int value) { 8 | print(value); 9 | }); -------------------------------------------------------------------------------- /test/tall/regression/0500/0520.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import 'package:meta/meta.dart'; 3 | 4 | class Foo { 5 | final int bar; 6 | Foo({ 7 | @required this.bar, 8 | }); 9 | } 10 | <<< 11 | import 'package:meta/meta.dart'; 12 | 13 | class Foo { 14 | final int bar; 15 | Foo({@required this.bar}); 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0527.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | for (int i = 0; i < variables.length; ++i) performance.updateVariable(variables[i]); 3 | <<< 4 | for (int i = 0; i < variables.length; ++i) 5 | performance.updateVariable(variables[i]); -------------------------------------------------------------------------------- /test/tall/regression/0500/0529.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | enum _ElementLifecycle { 3 | initial, 4 | active, 5 | inactive, 6 | defunct, 7 | } 8 | <<< 9 | enum _ElementLifecycle { initial, active, inactive, defunct } -------------------------------------------------------------------------------- /test/tall/regression/0500/0541.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | String A() native ; 3 | <<< 4 | String A() native; -------------------------------------------------------------------------------- /test/tall/regression/0500/0568.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | var controller = new StreamController(sync: true, onCancel: () { 4 | return Future.wait(operationSet.map((operation) => operation.cancel())); 5 | }); 6 | } 7 | <<< 8 | void main() { 9 | var controller = new StreamController( 10 | sync: true, 11 | onCancel: () { 12 | return Future.wait(operationSet.map((operation) => operation.cancel())); 13 | }, 14 | ); 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0571.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @Timeout(const Duration(minutes: 1)) 3 | 4 | import "package:test/test.dart"; 5 | <<< 6 | @Timeout(const Duration(minutes: 1)) 7 | import "package:test/test.dart"; -------------------------------------------------------------------------------- /test/tall/regression/0500/0581.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 10) 2 | expect( 3 | events[0], 4 | invokesMethod('file').on(fs).withPositionalArguments( 5 | ['/foo']).withResult(isFile)); 6 | <<< 7 | expect( 8 | events[0], 9 | invokesMethod('file') 10 | .on(fs) 11 | .withPositionalArguments(['/foo']) 12 | .withResult(isFile), 13 | ); -------------------------------------------------------------------------------- /test/tall/regression/0500/0582.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void fn() { 3 | List a; 4 | // NOTICE THE TYPE PARAMETER 5 | a.fold(0, (memo, s) { 6 | return max(memo, s.length); 7 | }); 8 | } 9 | <<< 10 | void fn() { 11 | List a; 12 | // NOTICE THE TYPE PARAMETER 13 | a.fold(0, (memo, s) { 14 | return max(memo, s.length); 15 | }); 16 | } -------------------------------------------------------------------------------- /test/tall/regression/0500/0584.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool 3 | listEquals(List a, List b) => const ListEquality().equals(a, b); 4 | <<< 5 | bool listEquals(List a, List b) => 6 | const ListEquality().equals(a, b); -------------------------------------------------------------------------------- /test/tall/regression/0500/0585.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | A___________ r___________________________( 3 | R______________________________ r______________________________, 4 | R_________________________________ r_________________________________) => 5 | new A___________( 6 | [r______________________________, r_________________________________]); 7 | <<< 8 | A___________ r___________________________( 9 | R______________________________ r______________________________, 10 | R_________________________________ r_________________________________, 11 | ) => new A___________([ 12 | r______________________________, 13 | r_________________________________, 14 | ]); -------------------------------------------------------------------------------- /test/tall/regression/0500/0594.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 6) 2 | body = combineStatements( 3 | new ExpressionStatement(lvalue 4 | .buildAssignment(new VariableGet(variable), voidContext: true)), 5 | body); 6 | <<< 7 | body = combineStatements( 8 | new ExpressionStatement( 9 | lvalue.buildAssignment(new VariableGet(variable), voidContext: true), 10 | ), 11 | body, 12 | ); -------------------------------------------------------------------------------- /test/tall/regression/0500/0596.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | Zone.current.scheduleMicrotask( 3 | Zone.current.bindCallback(callback, runGuarded: true)); 4 | <<< 5 | Zone.current.scheduleMicrotask( 6 | Zone.current.bindCallback(callback, runGuarded: true), 7 | ); -------------------------------------------------------------------------------- /test/tall/regression/0600/0613.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void takeIdentityFunction(T id(T x)) {} 3 | <<< 4 | void takeIdentityFunction(T id(T x)) {} -------------------------------------------------------------------------------- /test/tall/regression/0600/0616.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | import "package:expect/expect.dart"; 3 | int Function() x = () => 42; 4 | int Function(int Function()) y = (int Function() x) => x(); 5 | List l = [()=>42, x]; 6 | main() { 7 | Expect.equals(42, y(l[1])); 8 | } 9 | <<< 10 | import "package:expect/expect.dart"; 11 | 12 | int Function() x = () => 42; 13 | int Function(int Function()) y = (int Function() x) => x(); 14 | List l = [() => 42, x]; 15 | main() { 16 | Expect.equals(42, y(l[1])); 17 | } -------------------------------------------------------------------------------- /test/tall/regression/0600/0619.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | typedef F = void Function(T); 3 | <<< 4 | typedef F = void Function(T); -------------------------------------------------------------------------------- /test/tall/regression/0600/0621.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var x = (f as dynamic)(40, 2); 3 | <<< 4 | var x = (f as dynamic)(40, 2); 5 | >>> 6 | var y = (f as dynamic)('hi', '!'); 7 | <<< 8 | var y = (f as dynamic)('hi', '!'); -------------------------------------------------------------------------------- /test/tall/regression/0600/0648.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | for (@nullCheck var i in codePoints) {} 3 | <<< 4 | for (@nullCheck var i in codePoints) {} -------------------------------------------------------------------------------- /test/tall/regression/0600/0658.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class A { 3 | A( 4 | int a, 5 | ) 6 | : super(); 7 | } 8 | <<< 9 | class A { 10 | A(int a) : super(); 11 | } 12 | >>> 13 | class Foo { 14 | Foo({ 15 | Bar bar, 16 | Baz baz, 17 | }) 18 | : assert(bar != null), 19 | super(baz); 20 | } 21 | <<< 22 | class Foo { 23 | Foo({Bar bar, Baz baz}) : assert(bar != null), super(baz); 24 | } -------------------------------------------------------------------------------- /test/tall/regression/0600/0665.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | when( 3 | runner.call( 4 | typed(captureAny), 5 | typed(captureAny), 6 | workingDirectory: typed(captureAny, named: "workingDirectory"), 7 | ), 8 | ) 9 | .thenReturn(new Future.value(new MockProcessResult())); 10 | <<< 11 | when( 12 | runner.call( 13 | typed(captureAny), 14 | typed(captureAny), 15 | workingDirectory: typed(captureAny, named: "workingDirectory"), 16 | ), 17 | ).thenReturn(new Future.value(new MockProcessResult())); -------------------------------------------------------------------------------- /test/tall/regression/0600/0684.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var a = 'Multiline strings keep leading space\n' 'I write adjacent strings.\n'; 3 | <<< 4 | var a = 5 | 'Multiline strings keep leading space\n' 6 | 'I write adjacent strings.\n'; 7 | >>> 8 | var a = '$bar' r'$money' 'newline\n' r'regexp \s*\d+\Z'; 9 | <<< 10 | var a = 11 | '$bar' 12 | r'$money' 13 | 'newline\n' 14 | r'regexp \s*\d+\Z'; 15 | >>> 16 | var b = 'text' /* comment */ 'more text' /* comment */; 17 | <<< 18 | var b = 19 | 'text' /* comment */ 20 | 'more text' /* comment */; -------------------------------------------------------------------------------- /test/tall/regression/0700/0705.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | final _appUrl = Platform.isIOS 3 | ? 'https://itunes.apple.com/us/app/google-adwords/id1037457231' 4 | : 'https://play.google.com/store/apps/details?id=com.google.android.apps.' 5 | 'adwords'; 6 | <<< 7 | final _appUrl = Platform.isIOS 8 | ? 'https://itunes.apple.com/us/app/google-adwords/id1037457231' 9 | : 'https://play.google.com/store/apps/details?id=com.google.android.apps.' 10 | 'adwords'; 11 | <<< 3.7 12 | final _appUrl = 13 | Platform.isIOS 14 | ? 'https://itunes.apple.com/us/app/google-adwords/id1037457231' 15 | : 'https://play.google.com/store/apps/details?id=com.google.android.apps.' 16 | 'adwords'; -------------------------------------------------------------------------------- /test/tall/regression/0700/0711.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var str = '''${""" 3 | a 4 | b 5 | c 6 | """}'''; 7 | <<< 8 | var str = 9 | '''${""" 10 | a 11 | b 12 | c 13 | """}'''; 14 | <<< 3.7 15 | var str = '''${""" 16 | a 17 | b 18 | c 19 | """}'''; -------------------------------------------------------------------------------- /test/tall/regression/0700/0713.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | String type = status == 'OK' 3 | ? 'notices' 4 | : status == 'NO' ? 'warnings' : status == 'BAD' ? 'errors' : ''; 5 | <<< 6 | String type = status == 'OK' 7 | ? 'notices' 8 | : status == 'NO' 9 | ? 'warnings' 10 | : status == 'BAD' 11 | ? 'errors' 12 | : ''; 13 | <<< 3.7 14 | String type = 15 | status == 'OK' 16 | ? 'notices' 17 | : status == 'NO' 18 | ? 'warnings' 19 | : status == 'BAD' 20 | ? 'errors' 21 | : ''; -------------------------------------------------------------------------------- /test/tall/regression/0700/0760.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | foo.bar.create(Thing() 4 | ..a = b 5 | ..c = d) 6 | ..method().chain((_) => lambda); 7 | } 8 | <<< 9 | main() { 10 | foo.bar.create( 11 | Thing() 12 | ..a = b 13 | ..c = d, 14 | )..method().chain((_) => lambda); 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0700/0771.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | void 4 | _SomethingWithAVeryLongName( 5 | List sixteenLetterers, String fiver, List eightish) 6 | native 'SomethingWithAVeryLongName'; // ignore: native_function_body_in_non 7 | } 8 | <<< 9 | class C { 10 | void _SomethingWithAVeryLongName( 11 | List sixteenLetterers, 12 | String fiver, 13 | List eightish, 14 | ) native 'SomethingWithAVeryLongName'; // ignore: native_function_body_in_non 15 | } -------------------------------------------------------------------------------- /test/tall/regression/0700/0799.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @ShouldThrow( 3 | 'Could not generate `toJson` code for `watch`.\n' 4 | 'None of the provided `TypeHelper` instances support the defined type.', 5 | configurations: ['default'], 6 | ) 7 | class C {} 8 | <<< 9 | @ShouldThrow( 10 | 'Could not generate `toJson` code for `watch`.\n' 11 | 'None of the provided `TypeHelper` instances support the defined type.', 12 | configurations: ['default'], 13 | ) 14 | class C {} -------------------------------------------------------------------------------- /test/tall/regression/0800/0831.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | foo() { 3 | final bar = [ 4 | if (longVariableName == 'do nothing but be long') ...[] else if (longVariableName == 5 | 'show the welcome message') 6 | 'Hello' 7 | ]; 8 | } 9 | <<< 10 | foo() { 11 | final bar = [ 12 | if (longVariableName == 'do nothing but be long') 13 | ...[] 14 | else if (longVariableName == 'show the welcome message') 15 | 'Hello', 16 | ]; 17 | } -------------------------------------------------------------------------------- /test/tall/regression/0800/0843.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | assert( 3 | someLongCondition, 'Some long assert message that is a longish sentence.'); 4 | <<< 5 | assert( 6 | someLongCondition, 7 | 'Some long assert message that is a longish sentence.', 8 | ); -------------------------------------------------------------------------------- /test/tall/regression/0800/0861.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | f() { 3 | a.b().m( 4 | t: '', // comment to force split 5 | ); 6 | a.b.m( 7 | t: '', // comment to force split 8 | ); 9 | a.m( 10 | t: '', // comment to force split 11 | ); 12 | } 13 | <<< 14 | f() { 15 | a.b().m( 16 | t: '', // comment to force split 17 | ); 18 | a.b.m( 19 | t: '', // comment to force split 20 | ); 21 | a.m( 22 | t: '', // comment to force split 23 | ); 24 | } -------------------------------------------------------------------------------- /test/tall/regression/0800/0869.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | var failed = [ 3 | for (var e in _restResultEvents) if (!e.isSuccess) e.message, 4 | ]; 5 | <<< 6 | var failed = [ 7 | for (var e in _restResultEvents) 8 | if (!e.isSuccess) e.message, 9 | ]; -------------------------------------------------------------------------------- /test/tall/regression/0900/0927.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | int get currentAngleDigits => _currentSunAngleDeg < 0 ? 1 : _currentSunAngleDeg < 10 ? 2 : 3; 4 | } 5 | <<< 6 | class C { 7 | int get currentAngleDigits => _currentSunAngleDeg < 0 8 | ? 1 9 | : _currentSunAngleDeg < 10 10 | ? 2 11 | : 3; 12 | } 13 | <<< 3.7 14 | class C { 15 | int get currentAngleDigits => 16 | _currentSunAngleDeg < 0 17 | ? 1 18 | : _currentSunAngleDeg < 10 19 | ? 2 20 | : 3; 21 | } -------------------------------------------------------------------------------- /test/tall/regression/0900/0960.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | const m = 0; 3 | 4 | class C { 5 | var z, w, u, v; 6 | C({@m int this.v()?}); 7 | } 8 | 9 | void main() {} 10 | <<< 11 | const m = 0; 12 | 13 | class C { 14 | var z, w, u, v; 15 | C({@m int this.v()?}); 16 | } 17 | 18 | void main() {} -------------------------------------------------------------------------------- /test/tall/regression/0900/0966.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | return [ 3 | for (final x in exampleList) 4 | if (conditionA) 5 | ItemConstructorA() 6 | // Sample multi-line comment 7 | // which broke the formatter 8 | else if (conditionB) 9 | ItemConstructorB() 10 | else 11 | ItemConstructorC() 12 | ]; 13 | <<< 14 | return [ 15 | for (final x in exampleList) 16 | if (conditionA) 17 | ItemConstructorA() 18 | // Sample multi-line comment 19 | // which broke the formatter 20 | else if (conditionB) 21 | ItemConstructorB() 22 | else 23 | ItemConstructorC(), 24 | ]; -------------------------------------------------------------------------------- /test/tall/regression/0900/0999.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | final object = outer(inner() 4 | ..innerProperty1 = 1 5 | ..innerProperty2 = 2) 6 | ..outerProperty = 3; 7 | } 8 | <<< 9 | void main() { 10 | final object = outer( 11 | inner() 12 | ..innerProperty1 = 1 13 | ..innerProperty2 = 2, 14 | )..outerProperty = 3; 15 | } -------------------------------------------------------------------------------- /test/tall/regression/1000/1010.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class Foo { 3 | Foo({ 4 | required int x, 5 | }) : assert(x != 0), 6 | assert(x != -1); 7 | } 8 | <<< 9 | class Foo { 10 | Foo({required int x}) : assert(x != 0), assert(x != -1); 11 | } 12 | >>> 13 | class Foo { 14 | Foo({ 15 | int x, 16 | }) : assert(x != 0), 17 | assert(x != -1); 18 | } 19 | <<< 20 | class Foo { 21 | Foo({int x}) : assert(x != 0), assert(x != -1); 22 | } 23 | >>> 24 | class Foo { 25 | Foo([ 26 | int x, 27 | ]) : assert(x != 0), 28 | assert(x != -1); 29 | } 30 | <<< 31 | class Foo { 32 | Foo([int x]) : assert(x != 0), assert(x != -1); 33 | } -------------------------------------------------------------------------------- /test/tall/regression/1000/1029.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | try { 4 | doSomething(); 5 | } on Exception catch (e) {} finally { 6 | cleanupSomething(); 7 | } 8 | } 9 | <<< 10 | void main() { 11 | try { 12 | doSomething(); 13 | } on Exception catch (e) { 14 | } finally { 15 | cleanupSomething(); 16 | } 17 | } 18 | >>> 19 | void main() { 20 | try { 21 | doSomething(); 22 | } on FooException {} on BarException { 23 | doSomething(); 24 | } 25 | } 26 | <<< 27 | void main() { 28 | try { 29 | doSomething(); 30 | } on FooException { 31 | } on BarException { 32 | doSomething(); 33 | } 34 | } -------------------------------------------------------------------------------- /test/tall/regression/1000/1071.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | external Pointer/**/ parray; 4 | external Pointer*/ > pparray; 5 | } 6 | <<< 7 | class C { 8 | external Pointer /**/ parray; 9 | external Pointer*/> pparray; 10 | } -------------------------------------------------------------------------------- /test/tall/regression/1000/1082.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class A{ 3 | A(this.name): super(); 4 | final String name; 5 | } 6 | 7 | class B{ 8 | B(this.name); 9 | final String name; 10 | } 11 | <<< 12 | class A { 13 | A(this.name) : super(); 14 | final String name; 15 | } 16 | 17 | class B { 18 | B(this.name); 19 | final String name; 20 | } -------------------------------------------------------------------------------- /test/tall/regression/1000/1085.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | var result = condition 4 | ? doA( 5 | param1, // comment to force split 6 | param2, 7 | ) 8 | : doB(); 9 | } 10 | <<< 11 | void main() { 12 | var result = condition 13 | ? doA( 14 | param1, // comment to force split 15 | param2, 16 | ) 17 | : doB(); 18 | } 19 | <<< 3.7 20 | void main() { 21 | var result = 22 | condition 23 | ? doA( 24 | param1, // comment to force split 25 | param2, 26 | ) 27 | : doB(); 28 | } -------------------------------------------------------------------------------- /test/tall/regression/1000/1090.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | subscription = _userRepository.getUser().takeUntil(closesStream).listen( 3 | (user) => setState(DataState.loaded(user)), 4 | onError: (e) => setState(DataError(e)), 5 | ); 6 | <<< 7 | subscription = _userRepository 8 | .getUser() 9 | .takeUntil(closesStream) 10 | .listen( 11 | (user) => setState(DataState.loaded(user)), 12 | onError: (e) => setState(DataError(e)), 13 | ); -------------------------------------------------------------------------------- /test/tall/regression/1100/1107.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class SomeClassC extends SomeClassA { 3 | SomeClassC({required final String property1}) 4 | : super( 5 | property1: property1, 6 | property2: "abc", 7 | complexProperty: SomeClassB( 8 | "sdf", 9 | "dfg", 10 | "fgh", 11 | ), 12 | ); 13 | } 14 | <<< 15 | class SomeClassC extends SomeClassA { 16 | SomeClassC({required final String property1}) 17 | : super( 18 | property1: property1, 19 | property2: "abc", 20 | complexProperty: SomeClassB("sdf", "dfg", "fgh"), 21 | ); 22 | } -------------------------------------------------------------------------------- /test/tall/regression/1100/1143.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | var s1 = [ 3 | 'a' 4 | 'b' + 'c', 5 | 'd' + 'e' 6 | 'f', 7 | ]; 8 | var s2 = [ 9 | 'a' 'b' + 'c', 10 | 'd' + 'e' 'f', 11 | ]; 12 | <<< 13 | var s1 = [ 14 | 'a' 15 | 'b' + 16 | 'c', 17 | 'd' + 18 | 'e' 19 | 'f', 20 | ]; 21 | var s2 = [ 22 | 'a' 23 | 'b' + 24 | 'c', 25 | 'd' + 26 | 'e' 27 | 'f', 28 | ]; -------------------------------------------------------------------------------- /test/tall/regression/1100/1181.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | switch (e) { 3 | case E.e1: 4 | break; 5 | case E.e2: 6 | } 7 | <<< 8 | switch (e) { 9 | case E.e1: 10 | break; 11 | case E.e2: 12 | } -------------------------------------------------------------------------------- /test/tall/regression/1100/1198.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | switch (e) {} 4 | <<< 5 | switch (e) {} 6 | >>> 7 | switch ("a long string that must wrap") {} 8 | <<< 9 | switch ("a long string that must wrap") {} 10 | >>> 11 | switch ([1,]) {} 12 | <<< 13 | switch ([1]) {} 14 | >>> 15 | e = switch (e) {}; 16 | <<< 17 | e = switch (e) {}; 18 | >>> 19 | e = switch ("a long string that must wrap") {}; 20 | <<< 21 | e = switch ("a long string that must wrap") {}; 22 | >>> 23 | e = switch ([1,]) {}; 24 | <<< 25 | e = switch ([1]) {}; -------------------------------------------------------------------------------- /test/tall/regression/1200/1205.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | error( 3 | offset: 10, 4 | ( 5 | code: 'unclosed-block', 6 | message: 'Block was left open', 7 | )); 8 | <<< 9 | error(offset: 10, (code: 'unclosed-block', message: 'Block was left open')); -------------------------------------------------------------------------------- /test/tall/regression/1200/1213.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | final a = ( 4 | element, 5 | element, 6 | ) 7 | .getter; 8 | 9 | final b = [ 10 | element, 11 | element, 12 | ].getter; 13 | } 14 | <<< 15 | main() { 16 | final a = (element, element).getter; 17 | 18 | final b = [element, element].getter; 19 | } -------------------------------------------------------------------------------- /test/tall/regression/1200/1215.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | return switch (level) { 3 | 0 => a, 4 | // Comment. 5 | 1 6 | when flag => 7 | b, 8 | }; 9 | <<< 10 | return switch (level) { 11 | 0 => a, 12 | // Comment. 13 | 1 when flag => b, 14 | }; -------------------------------------------------------------------------------- /test/tall/regression/1200/1232.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | int foo(List list) /* 3 | 1234567 14 21 28 35 42 49 4 | */ 5 | => 7; 6 | <<< 7 | int foo(List list) /* 8 | 1234567 14 21 28 35 42 49 9 | */ => 7; -------------------------------------------------------------------------------- /test/tall/regression/1200/1249.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | late final _callocPtr = _lookup< 4 | ffi 5 | .NativeFunction>( 6 | 'calloc'); 7 | } 8 | <<< 9 | class C { 10 | late final _callocPtr = 11 | _lookup< 12 | ffi.NativeFunction 13 | >('calloc'); 14 | } 15 | <<< 3.7 16 | class C { 17 | late final _callocPtr = _lookup< 18 | ffi.NativeFunction 19 | >('calloc'); 20 | } -------------------------------------------------------------------------------- /test/tall/regression/1200/1254.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | enum EE { 3 | a, 4 | b, // 'b' 5 | c 6 | } 7 | <<< 8 | enum EE { 9 | a, 10 | b, // 'b' 11 | c, 12 | } -------------------------------------------------------------------------------- /test/tall/regression/1300/1321.unit: -------------------------------------------------------------------------------- 1 | >>> `super.` parameter. 2 | class A { 3 | A(int foo(int a)); 4 | } 5 | class B extends A { 6 | B.sub1(int super.bar1(int a1),); 7 | B.sub2(int super.bar2(int a2),); 8 | } 9 | main() {} 10 | <<< 11 | class A { 12 | A(int foo(int a)); 13 | } 14 | 15 | class B extends A { 16 | B.sub1(int super.bar1(int a1)); 17 | B.sub2(int super.bar2(int a2)); 18 | } 19 | 20 | main() {} 21 | >>> `this.` parameter. 22 | class A { 23 | A.sub1(int this.bar1(int a1),); 24 | A.sub2(int this.bar2(int a2),); 25 | } 26 | <<< 27 | class A { 28 | A.sub1(int this.bar1(int a1)); 29 | A.sub2(int this.bar2(int a2)); 30 | } -------------------------------------------------------------------------------- /test/tall/regression/1300/1331.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 8) 2 | await _loadProfileView( 3 | userId: profileView.userId, 4 | setLikeActionType: LikeActionType.block, 5 | // Remove star too from any user that is blocked 6 | setStarAction: false, onUserActionChanged: widget.onUserActionChanged, 7 | ); 8 | <<< 9 | await _loadProfileView( 10 | userId: profileView.userId, 11 | setLikeActionType: LikeActionType.block, 12 | // Remove star too from any user that is blocked 13 | setStarAction: false, 14 | onUserActionChanged: widget.onUserActionChanged, 15 | ); -------------------------------------------------------------------------------- /test/tall/regression/1300/1348.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | abstract class StreamNotifierProviderBase< 3 | NotifierT extends AsyncNotifierBase, 4 | T> extends ProviderWithNotifier, NotifierT> 5 | with FutureModifier { 6 | // ... 7 | } 8 | <<< 9 | abstract class StreamNotifierProviderBase< 10 | NotifierT extends AsyncNotifierBase, 11 | T 12 | > 13 | extends ProviderWithNotifier, NotifierT> 14 | with FutureModifier { 15 | // ... 16 | } -------------------------------------------------------------------------------- /test/tall/regression/1300/1354.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | for (int i; i < 10; print("foo"), ++i, print("bar"),) { 4 | break; 5 | } 6 | } 7 | <<< 8 | void main() { 9 | for (int i; i < 10; print("foo"), ++i, print("bar")) { 10 | break; 11 | } 12 | } -------------------------------------------------------------------------------- /test/tall/regression/1400/1415.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | // Comment. 3 | 4 | main() {} 5 | <<< 6 | // Comment. 7 | 8 | main() {} 9 | >>> 10 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 11 | // for details. All rights reserved. Use of this source code is governed by a 12 | // BSD-style license that can be found in the LICENSE file. 13 | 14 | import 'package:analyzer/dart/ast/ast.dart'; 15 | <<< 16 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 17 | // for details. All rights reserved. Use of this source code is governed by a 18 | // BSD-style license that can be found in the LICENSE file. 19 | 20 | import 'package:analyzer/dart/ast/ast.dart'; -------------------------------------------------------------------------------- /test/tall/regression/1400/1469.stmt: -------------------------------------------------------------------------------- 1 | >>> 2 | stuff = [ 3 | element, 4 | 5 | element, 6 | ]; 7 | <<< 8 | stuff = [element, element]; 9 | >>> 10 | stuff = [ 11 | extremelyGratuitouslyLongElementThatDoesNotFit, 12 | 13 | extremelyGratuitouslyLongElementThatDoesNotFit, 14 | ]; 15 | <<< 16 | stuff = [ 17 | extremelyGratuitouslyLongElementThatDoesNotFit, 18 | 19 | extremelyGratuitouslyLongElementThatDoesNotFit, 20 | ]; -------------------------------------------------------------------------------- /test/tall/regression/1500/1505.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | extension type JSExportedDartFunction._( 3 | JSExportedDartFunctionRepType _jsExportedDartFunction 4 | ) implements JSFunction {} 5 | <<< 6 | extension type JSExportedDartFunction._( 7 | JSExportedDartFunctionRepType _jsExportedDartFunction 8 | ) 9 | implements JSFunction {} -------------------------------------------------------------------------------- /test/tall/regression/1500/1526.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | @freezed 3 | class CharacterOffset with _$CharacterOffset { 4 | factory CharacterOffset({ 5 | required int offset, 6 | @Default('') String name, 7 | }) = _CharacterOffset; 8 | } 9 | <<< 10 | @freezed 11 | class CharacterOffset with _$CharacterOffset { 12 | factory CharacterOffset({required int offset, @Default('') String name}) = 13 | _CharacterOffset; 14 | } -------------------------------------------------------------------------------- /test/tall/regression/1500/1528.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 10) 2 | result = ProviderScope(overrides: [ 3 | selectedCharacterId.overrideWithValue(split.last), 4 | ], child: const CharacterView()); 5 | <<< 6 | result = ProviderScope( 7 | overrides: [selectedCharacterId.overrideWithValue(split.last)], 8 | child: const CharacterView(), 9 | ); -------------------------------------------------------------------------------- /test/tall/regression/1500/1533.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() { 3 | ComplexSelector(complex.leadingCombinators, [ 4 | component, 5 | ], complex.span, lineBreak: false); 6 | } 7 | <<< 8 | void main() { 9 | ComplexSelector( 10 | complex.leadingCombinators, 11 | [component], 12 | complex.span, 13 | lineBreak: false, 14 | ); 15 | } -------------------------------------------------------------------------------- /test/tall/regression/1500/1543.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | void main() async { 3 | fn(param1: true, paraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaam2: [ 4 | ['value'], 5 | ]); 6 | } 7 | <<< 8 | void main() async { 9 | fn( 10 | param1: true, 11 | paraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaam2: [ 12 | ['value'], 13 | ], 14 | ); 15 | } -------------------------------------------------------------------------------- /test/tall/regression/1500/1585.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class AaaaAaaaa { 3 | external Aaaaaa get aa; 4 | external Aaaaaa get aaAaa; 5 | external Aaaaaa get aa; 6 | external aaaa get aaaa; 7 | external /*AaaaaaAaaa*/ aaa get aa; 8 | external Aaaaaa get aaa; 9 | } 10 | <<< 11 | class AaaaAaaaa { 12 | external Aaaaaa get aa; 13 | external Aaaaaa get aaAaa; 14 | external Aaaaaa get aa; 15 | external aaaa get aaaa; 16 | external /*AaaaaaAaaa*/ aaa get aa; 17 | external Aaaaaa get aaa; 18 | } -------------------------------------------------------------------------------- /test/tall/regression/1500/1586.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | main() { 3 | /// Doc comment. 4 | final (a, b) = c; 5 | } 6 | <<< 7 | main() { 8 | /// Doc comment. 9 | final (a, b) = c; 10 | } -------------------------------------------------------------------------------- /test/tall/regression/1600/1602.stmt: -------------------------------------------------------------------------------- 1 | >>> (indent 4) 2 | return switch (_advance().type) { 3 | TokenType.float || TokenType.int || TokenType.string => LiteralExpression( 4 | _previous.value!, 5 | ), 6 | }; 7 | <<< 8 | return switch (_advance().type) { 9 | TokenType.float || 10 | TokenType.int || 11 | TokenType.string => LiteralExpression(_previous.value!), 12 | }; -------------------------------------------------------------------------------- /test/tall/regression/1600/1604.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | class C { 3 | @override 4 | // ignore: hash_and_equals 5 | final int hashCode; 6 | } 7 | <<< 8 | class C { 9 | @override 10 | // ignore: hash_and_equals 11 | final int hashCode; 12 | } -------------------------------------------------------------------------------- /test/tall/regression/1600/1621.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | /*member: readLocalInAnonymousClosure:*/ 3 | readLocalInAnonymousClosure(/**/ parameter) { 4 | var /**/ local = parameter; 5 | return /*fields=[local],free=[local]*/ () => local; 6 | } 7 | <<< 8 | /*member: readLocalInAnonymousClosure:*/ 9 | readLocalInAnonymousClosure(/**/ parameter) { 10 | var /**/ local = parameter; 11 | return /*fields=[local],free=[local]*/ () => local; 12 | } 13 | >>> 14 | class C { 15 | @override 16 | // ignore: overridden_fields 17 | final FunctionEntity _member; 18 | } 19 | <<< 20 | class C { 21 | @override 22 | // ignore: overridden_fields 23 | final FunctionEntity _member; 24 | } -------------------------------------------------------------------------------- /test/tall/regression/1600/1628.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | bool f(bool b, int i) { 3 | return // Check b. 4 | b == true || i.isEven; 5 | } 6 | <<< 7 | bool f(bool b, int i) { 8 | return // Check b. 9 | b == true || i.isEven; 10 | } 11 | >>> 12 | bool f(bool b, int i) { 13 | return // Check b. 14 | b == true || 15 | // Check i. 16 | i 17 | .isEven; 18 | } 19 | <<< 20 | bool f(bool b, int i) { 21 | return // Check b. 22 | b == true || 23 | // Check i. 24 | i.isEven; 25 | } -------------------------------------------------------------------------------- /test/tall/regression/1600/1651.unit: -------------------------------------------------------------------------------- 1 | >>> 2 | typedef ExampleRecordTypedef = 3 | ( 4 | String firstParameter, 5 | int secondParameter, 6 | String thirdParameter, 7 | String fourthParameter, 8 | ); 9 | <<< 10 | typedef ExampleRecordTypedef = ( 11 | String firstParameter, 12 | int secondParameter, 13 | String thirdParameter, 14 | String fourthParameter, 15 | ); 16 | <<< 3.7 17 | typedef ExampleRecordTypedef = 18 | ( 19 | String firstParameter, 20 | int secondParameter, 21 | String thirdParameter, 22 | String fourthParameter, 23 | ); -------------------------------------------------------------------------------- /test/tall/regression/other/misc.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | someLongExpression..prop.cascade( 4 | argument, 5 | argument, 6 | argument, 7 | ); 8 | <<< 9 | someLongExpression 10 | ..prop.cascade( 11 | argument, 12 | argument, 13 | argument, 14 | ); -------------------------------------------------------------------------------- /test/tall/statement/do_while.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Empty block body. 3 | do {} while (true); 4 | <<< 5 | do {} while (true); 6 | >>> Don't split before long condition. 7 | do { 8 | ; 9 | } while (aLongConditionExpressionThatWraps); 10 | <<< 11 | do { 12 | ; 13 | } while (aLongConditionExpressionThatWraps); 14 | >>> Split inside condition. 15 | do { 16 | ; 17 | } while (aLongCondition + expressionThatWraps); 18 | <<< 19 | do { 20 | ; 21 | } while (aLongCondition + 22 | expressionThatWraps); 23 | >>> Unbraced body. 24 | do something(i); while (condition); 25 | <<< 26 | do something(i); while (condition); -------------------------------------------------------------------------------- /test/tall/statement/expression.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> No space before ";". 3 | expression ; 4 | <<< 5 | expression; 6 | >>> Empty statements. 7 | {;;;;} 8 | <<< 9 | { 10 | ; 11 | ; 12 | ; 13 | ; 14 | } -------------------------------------------------------------------------------- /test/tall/statement/if_case_comment.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Line comment before case keyword. 3 | if (obj // comment 4 | case true) {;} 5 | <<< 6 | if (obj // comment 7 | case true) { 8 | ; 9 | } 10 | >>> Line comment after case keyword. 11 | if (obj case // comment 12 | true) {;} 13 | <<< 14 | if (obj 15 | case // comment 16 | true) { 17 | ; 18 | } 19 | >>> Line comment after case clause. 20 | if (obj case true // comment 21 | ) {;} 22 | <<< 23 | if (obj 24 | case true // comment 25 | ) { 26 | ; 27 | } -------------------------------------------------------------------------------- /test/tall/statement/return.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Without value. 3 | return ; 4 | <<< 5 | return; 6 | >>> With value. 7 | return value ; 8 | <<< 9 | return value; 10 | >>> With split value. 11 | return veryLongExpression + anotherLongOne; 12 | <<< 13 | return veryLongExpression + 14 | anotherLongOne; -------------------------------------------------------------------------------- /test/tall/statement/return_comment.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Line comment after return without value. 3 | return // comment 4 | ; 5 | <<< 6 | return // comment 7 | ; 8 | >>> Line comment after semicolon without value. 9 | return; // comment 10 | <<< 11 | return; // comment 12 | >>> Line comment after return with value. 13 | return // comment 14 | 1 + 2; 15 | <<< 16 | return // comment 17 | 1 + 2; 18 | >>> Line comment after return value. 19 | return 1 + 2 // comment 20 | ; 21 | <<< 22 | return 1 + 23 | 2 // comment 24 | ; 25 | >>> Line comment after semicolon with value. 26 | return 1 + 2; // comment 27 | <<< 28 | return 1 + 2; // comment -------------------------------------------------------------------------------- /test/tall/top_level/import_comment.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Line comment in combinator list. 3 | import 'foo.dart' hide First, // 4 | Second; 5 | <<< 6 | import 'foo.dart' 7 | hide 8 | First, // 9 | Second; 10 | >>> Don't split `==` because of comment before left operand. 11 | import 'uri.dart' if ( 12 | // comment 13 | config == 'value') 'c'; 14 | <<< 15 | ### The indentation is odd here because it's an odd place for a comment. 16 | import 'uri.dart' 17 | if ( 18 | // comment 19 | config == 'value') 'c'; -------------------------------------------------------------------------------- /test/tall/top_level/library.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> No spaces between identifiers. 3 | library a . b . c; 4 | <<< 5 | library a.b.c; 6 | >>> Don't wrap identifier. 7 | library veryLong.alsoLong.evenMoreLong.thisToo; 8 | <<< 9 | library veryLong.alsoLong.evenMoreLong.thisToo; 10 | >>> No spaces after unnamed library. 11 | library ; 12 | <<< 13 | library; -------------------------------------------------------------------------------- /test/tall/top_level/script_comment.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Insert blank between script and line comment. 3 | #!script 4 | // comment 5 | <<< 6 | #!script 7 | 8 | // comment 9 | >>> Collapse multiple lines between script and line comment. 10 | #!script 11 | 12 | 13 | 14 | // comment 15 | <<< 16 | #!script 17 | 18 | // comment 19 | >>> Insert blank between script and block comment. 20 | #!script 21 | /* comment */ 22 | <<< 23 | #!script 24 | 25 | /* comment */ 26 | >>> Collapse multiple lines between script and block comment. 27 | #!script 28 | 29 | 30 | 31 | /* comment */ 32 | <<< 33 | #!script 34 | 35 | /* comment */ -------------------------------------------------------------------------------- /test/tall/type/named.stmt: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> Simple named type. 3 | int x ; 4 | <<< 5 | int x; 6 | >>> Nullable type. 7 | String ? s ; 8 | <<< 9 | String? s; 10 | >>> Prefixed type. 11 | library_prefix . TypeName x ; 12 | <<< 13 | library_prefix.TypeName x; 14 | >>> Don't split on prefix. 15 | very_long_library_prefix . VeryLongTypeName x ; 16 | <<< 17 | very_long_library_prefix.VeryLongTypeName 18 | x; 19 | >>> Prefixed nullable type. 20 | prefix . TypeName ? x ; 21 | <<< 22 | prefix.TypeName? x; -------------------------------------------------------------------------------- /test/tall/variable/top_level_comment.unit: -------------------------------------------------------------------------------- 1 | 40 columns | 2 | >>> 3 | var x ; // comment 4 | <<< 5 | var x; // comment 6 | >>> Force blank line before doc comments. 7 | var a = 1; 8 | /// doc 9 | var b = 2; 10 | <<< 11 | var a = 1; 12 | 13 | /// doc 14 | var b = 2; --------------------------------------------------------------------------------