From a9c079594b206b3e95320cebaaa432a5c94fc832 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Mon, 28 Jan 2019 18:53:42 +0300 Subject: [PATCH] Add header information (scheme name, version) to exported code style Json --- .../testData/codeStyle/jsonExport.j2ee.json | 524 +++++++++--------- .../testData/codeStyle/jsonExport.json | 490 ++++++++-------- .../json/CodeStyleSchemeJsonDescriptor.java | 85 +++ .../json/CodeStyleSchemeJsonExporter.java | 56 +- .../testData/codeStyle/json/exportToJson.json | 222 ++++---- 5 files changed, 710 insertions(+), 667 deletions(-) create mode 100644 platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonDescriptor.java diff --git a/java/java-tests/testData/codeStyle/jsonExport.j2ee.json b/java/java-tests/testData/codeStyle/jsonExport.j2ee.json index fd1eb062af42..890cce779f8e 100644 --- a/java/java-tests/testData/codeStyle/jsonExport.j2ee.json +++ b/java/java-tests/testData/codeStyle/jsonExport.j2ee.json @@ -1,261 +1,265 @@ -[ - { - "language": "java", - "options": { - "align_consecutive_assignments": "false", - "align_consecutive_variable_declarations": "false", - "align_group_field_declarations": "false", - "align_multiline_annotation_parameters": "false", - "align_multiline_array_initializer_expression": "false", - "align_multiline_assignment": "false", - "align_multiline_binary_operation": "false", - "align_multiline_chained_methods": "false", - "align_multiline_extends_list": "false", - "align_multiline_for": "true", - "align_multiline_method_brackets": "false", - "align_multiline_parameters": "true", - "align_multiline_parameters_in_calls": "false", - "align_multiline_parenthesized_expression": "false", - "align_multiline_resources": "true", - "align_multiline_ternary_operation": "false", - "align_multiline_throws_list": "false", - "align_subsequent_simple_methods": "false", - "align_throws_keyword": "false", - "annotation_parameter_wrap": "off", - "array_initializer_new_line_after_left_brace": "false", - "array_initializer_right_brace_on_new_line": "false", - "array_initializer_wrap": "off", - "assert_statement_colon_on_next_line": "false", - "assert_statement_wrap": "off", - "assignment_wrap": "off", - "binary_operation_sign_on_next_line": "false", - "binary_operation_wrap": "off", - "blank_lines_after_anonymous_class_header": "0", - "blank_lines_after_class_header": "0", - "blank_lines_after_imports": "1", - "blank_lines_after_package": "1", - "blank_lines_around_class": "1", - "blank_lines_around_field": "0", - "blank_lines_around_field_in_interface": "0", - "blank_lines_around_initializer": "1", - "blank_lines_around_method": "1", - "blank_lines_around_method_in_interface": "1", - "blank_lines_before_class_end": "0", - "blank_lines_before_imports": "1", - "blank_lines_before_method_body": "0", - "blank_lines_before_package": "0", - "block_comment_at_first_column": "true", - "brace_style": "end_of_line", - "call_parameters_new_line_after_left_paren": "false", - "call_parameters_right_paren_on_new_line": "false", - "call_parameters_wrap": "on_every_item", - "case_statement_on_new_line": "true", - "catch_on_new_line": "false", - "class_annotation_wrap": "split_into_lines", - "class_brace_style": "end_of_line", - "class_count_to_use_import_on_demand": "5", - "class_names_in_javadoc": "1", - "continuation_indent_size": "8", - "do_not_indent_top_level_class_members": "false", - "do_not_wrap_after_single_annotation": "false", - "do_while_brace_force": "never", - "doc_add_blank_line_after_description": "true", - "doc_add_blank_line_after_param_comments": "false", - "doc_add_blank_line_after_return": "false", - "doc_add_p_tag_on_empty_lines": "true", - "doc_align_exception_comments": "true", - "doc_align_param_comments": "true", - "doc_do_not_wrap_if_one_line": "false", - "doc_enable_formatting": "true", - "doc_enable_leading_asterisks": "true", - "doc_indent_on_continuation": "false", - "doc_keep_empty_lines": "true", - "doc_keep_empty_parameter_tag": "true", - "doc_keep_empty_return_tag": "true", - "doc_keep_empty_throws_tag": "true", - "doc_keep_invalid_tags": "true", - "doc_param_description_on_new_line": "false", - "doc_preserve_line_breaks": "false", - "doc_use_throws_not_exception_tag": "true", - "else_on_new_line": "false", - "entity_dd_suffix": "EJB", - "entity_eb_suffix": "Bean", - "entity_hi_suffix": "Home", - "entity_lhi_prefix": "Local", - "entity_lhi_suffix": "Home", - "entity_li_prefix": "Local", - "entity_pk_class": "java.lang.String", - "entity_vo_suffix": "VO", - "enum_constants_wrap": "off", - "extends_keyword_wrap": "off", - "extends_list_wrap": "off", - "field_annotation_wrap": "split_into_lines", - "field_name_prefix": "m_", - "finally_on_new_line": "false", - "for_brace_force": "never", - "for_statement_new_line_after_left_paren": "false", - "for_statement_right_paren_on_new_line": "false", - "for_statement_wrap": "off", - "generate_final_locals": "false", - "generate_final_parameters": "false", - "if_brace_force": "never", - "imports_layout": [ - "*", - "blank_line", - "javax.**", - "java.**", - "blank_line", - "static *" - ], - "indent_case_from_switch": "true", - "indent_size": "4", - "indent_style": "space", - "insert_inner_class_imports": "false", - "insert_override_annotation": "true", - "keep_blank_lines_before_right_brace": "2", - "keep_blank_lines_between_package_declaration_and_header": "2", - "keep_blank_lines_in_code": "2", - "keep_blank_lines_in_declarations": "2", - "keep_control_statement_in_one_line": "true", - "keep_first_column_comment": "true", - "keep_indents_on_empty_lines": "false", - "keep_line_breaks": "true", - "keep_multiple_expressions_in_one_line": "false", - "keep_simple_blocks_in_one_line": "false", - "keep_simple_classes_in_one_line": "false", - "keep_simple_lambdas_in_one_line": "false", - "keep_simple_methods_in_one_line": "false", - "lambda_brace_style": "end_of_line", - "layout_static_imports_separately": "true", - "line_comment_add_space": "false", - "line_comment_at_first_column": "true", - "message_dd_suffix": "EJB", - "message_eb_suffix": "Bean", - "method_annotation_wrap": "split_into_lines", - "method_brace_style": "end_of_line", - "method_call_chain_wrap": "off", - "method_parameters_new_line_after_left_paren": "false", - "method_parameters_right_paren_on_new_line": "false", - "method_parameters_wrap": "normal", - "modifier_list_wrap": "false", - "names_count_to_use_import_on_demand": "3", - "packages_to_use_import_on_demand": [ - "java.awt.*", - "javax.swing.*" - ], - "parameter_annotation_wrap": "off", - "parentheses_expression_new_line_after_left_paren": "false", - "parentheses_expression_right_paren_on_new_line": "false", - "place_assignment_sign_on_next_line": "false", - "prefer_longer_names": "true", - "prefer_parameters_wrap": "false", - "repeat_synchronized": "true", - "replace_instanceof_and_cast": "false", - "replace_null_check": "true", - "resource_list_new_line_after_left_paren": "false", - "resource_list_right_paren_on_new_line": "false", - "resource_list_wrap": "off", - "session_dd_suffix": "EJB", - "session_eb_suffix": "Bean", - "session_hi_suffix": "Home", - "session_lhi_prefix": "Local", - "session_lhi_suffix": "Home", - "session_li_prefix": "Local", - "session_si_suffix": "Service", - "smart_tabs": "false", - "space_after_closing_angle_bracket_in_type_argument": "false", - "space_after_colon": "true", - "space_after_comma": "true", - "space_after_comma_in_type_arguments": "true", - "space_after_for_semicolon": "true", - "space_after_quest": "true", - "space_after_type_cast": "true", - "space_before_annotation_array_initializer_left_brace": "false", - "space_before_anotation_parameter_list": "false", - "space_before_array_initializer_left_brace": "false", - "space_before_catch_keyword": "true", - "space_before_catch_left_brace": "true", - "space_before_catch_parentheses": "true", - "space_before_class_left_brace": "true", - "space_before_colon": "true", - "space_before_colon_in_foreach": "true", - "space_before_comma": "false", - "space_before_do_left_brace": "true", - "space_before_else_keyword": "true", - "space_before_else_left_brace": "true", - "space_before_finally_keyword": "true", - "space_before_finally_left_brace": "true", - "space_before_for_left_brace": "true", - "space_before_for_parentheses": "true", - "space_before_for_semicolon": "false", - "space_before_if_left_brace": "true", - "space_before_if_parentheses": "true", - "space_before_method_call_parentheses": "false", - "space_before_method_left_brace": "true", - "space_before_method_parentheses": "false", - "space_before_opening_angle_bracket_in_type_parameter": "false", - "space_before_quest": "true", - "space_before_switch_left_brace": "true", - "space_before_switch_parentheses": "true", - "space_before_synchronized_left_brace": "true", - "space_before_synchronized_parentheses": "true", - "space_before_try_left_brace": "true", - "space_before_try_parentheses": "true", - "space_before_type_parameter_list": "false", - "space_before_while_keyword": "true", - "space_before_while_left_brace": "true", - "space_before_while_parentheses": "true", - "space_inside_one_line_enum_braces": "false", - "spaces_around_additive_operators": "true", - "spaces_around_assignment_operators": "true", - "spaces_around_bitwise_operators": "true", - "spaces_around_equality_operators": "true", - "spaces_around_lambda_arrow": "true", - "spaces_around_logical_operators": "true", - "spaces_around_method_ref_dbl_colon": "false", - "spaces_around_multiplicative_operators": "true", - "spaces_around_relational_operators": "true", - "spaces_around_shift_operators": "true", - "spaces_around_type_bounds_in_type_parameters": "true", - "spaces_around_unary_operator": "false", - "spaces_within_angle_brackets": "false", - "spaces_within_annotation_parentheses": "false", - "spaces_within_array_initializer_braces": "false", - "spaces_within_braces": "false", - "spaces_within_brackets": "false", - "spaces_within_cast_parentheses": "false", - "spaces_within_catch_parentheses": "false", - "spaces_within_empty_array_initializer_braces": "false", - "spaces_within_empty_method_call_parentheses": "false", - "spaces_within_empty_method_parentheses": "false", - "spaces_within_for_parentheses": "false", - "spaces_within_if_parentheses": "false", - "spaces_within_method_call_parentheses": "false", - "spaces_within_method_parentheses": "false", - "spaces_within_parentheses": "false", - "spaces_within_switch_parentheses": "false", - "spaces_within_synchronized_parentheses": "false", - "spaces_within_try_parentheses": "false", - "spaces_within_while_parentheses": "false", - "special_else_if_treatment": "true", - "static_field_name_suffix": "_s", - "subclass_name_suffix": "Impl", - "tab_width": "4", - "ternary_operation_signs_on_next_line": "false", - "ternary_operation_wrap": "off", - "test_name_suffix": "Test", - "throws_keyword_wrap": "off", - "throws_list_wrap": "off", - "use_external_annotations": "false", - "use_fq_class_names": "false", - "use_single_class_imports": "true", - "variable_annotation_wrap": "off", - "visibility": "public", - "while_brace_force": "never", - "while_on_new_line": "false", - "wrap_comments": "false", - "wrap_first_method_in_call_chain": "false", - "wrap_long_lines": "false" +{ + "schemeName": "Test", + "version": "1.0", + "codeStyle": [ + { + "language": "java", + "options": { + "align_consecutive_assignments": "false", + "align_consecutive_variable_declarations": "false", + "align_group_field_declarations": "false", + "align_multiline_annotation_parameters": "false", + "align_multiline_array_initializer_expression": "false", + "align_multiline_assignment": "false", + "align_multiline_binary_operation": "false", + "align_multiline_chained_methods": "false", + "align_multiline_extends_list": "false", + "align_multiline_for": "true", + "align_multiline_method_brackets": "false", + "align_multiline_parameters": "true", + "align_multiline_parameters_in_calls": "false", + "align_multiline_parenthesized_expression": "false", + "align_multiline_resources": "true", + "align_multiline_ternary_operation": "false", + "align_multiline_throws_list": "false", + "align_subsequent_simple_methods": "false", + "align_throws_keyword": "false", + "annotation_parameter_wrap": "off", + "array_initializer_new_line_after_left_brace": "false", + "array_initializer_right_brace_on_new_line": "false", + "array_initializer_wrap": "off", + "assert_statement_colon_on_next_line": "false", + "assert_statement_wrap": "off", + "assignment_wrap": "off", + "binary_operation_sign_on_next_line": "false", + "binary_operation_wrap": "off", + "blank_lines_after_anonymous_class_header": "0", + "blank_lines_after_class_header": "0", + "blank_lines_after_imports": "1", + "blank_lines_after_package": "1", + "blank_lines_around_class": "1", + "blank_lines_around_field": "0", + "blank_lines_around_field_in_interface": "0", + "blank_lines_around_initializer": "1", + "blank_lines_around_method": "1", + "blank_lines_around_method_in_interface": "1", + "blank_lines_before_class_end": "0", + "blank_lines_before_imports": "1", + "blank_lines_before_method_body": "0", + "blank_lines_before_package": "0", + "block_comment_at_first_column": "true", + "brace_style": "end_of_line", + "call_parameters_new_line_after_left_paren": "false", + "call_parameters_right_paren_on_new_line": "false", + "call_parameters_wrap": "on_every_item", + "case_statement_on_new_line": "true", + "catch_on_new_line": "false", + "class_annotation_wrap": "split_into_lines", + "class_brace_style": "end_of_line", + "class_count_to_use_import_on_demand": "5", + "class_names_in_javadoc": "1", + "continuation_indent_size": "8", + "do_not_indent_top_level_class_members": "false", + "do_not_wrap_after_single_annotation": "false", + "do_while_brace_force": "never", + "doc_add_blank_line_after_description": "true", + "doc_add_blank_line_after_param_comments": "false", + "doc_add_blank_line_after_return": "false", + "doc_add_p_tag_on_empty_lines": "true", + "doc_align_exception_comments": "true", + "doc_align_param_comments": "true", + "doc_do_not_wrap_if_one_line": "false", + "doc_enable_formatting": "true", + "doc_enable_leading_asterisks": "true", + "doc_indent_on_continuation": "false", + "doc_keep_empty_lines": "true", + "doc_keep_empty_parameter_tag": "true", + "doc_keep_empty_return_tag": "true", + "doc_keep_empty_throws_tag": "true", + "doc_keep_invalid_tags": "true", + "doc_param_description_on_new_line": "false", + "doc_preserve_line_breaks": "false", + "doc_use_throws_not_exception_tag": "true", + "else_on_new_line": "false", + "entity_dd_suffix": "EJB", + "entity_eb_suffix": "Bean", + "entity_hi_suffix": "Home", + "entity_lhi_prefix": "Local", + "entity_lhi_suffix": "Home", + "entity_li_prefix": "Local", + "entity_pk_class": "java.lang.String", + "entity_vo_suffix": "VO", + "enum_constants_wrap": "off", + "extends_keyword_wrap": "off", + "extends_list_wrap": "off", + "field_annotation_wrap": "split_into_lines", + "field_name_prefix": "m_", + "finally_on_new_line": "false", + "for_brace_force": "never", + "for_statement_new_line_after_left_paren": "false", + "for_statement_right_paren_on_new_line": "false", + "for_statement_wrap": "off", + "generate_final_locals": "false", + "generate_final_parameters": "false", + "if_brace_force": "never", + "imports_layout": [ + "*", + "blank_line", + "javax.**", + "java.**", + "blank_line", + "static *" + ], + "indent_case_from_switch": "true", + "indent_size": "4", + "indent_style": "space", + "insert_inner_class_imports": "false", + "insert_override_annotation": "true", + "keep_blank_lines_before_right_brace": "2", + "keep_blank_lines_between_package_declaration_and_header": "2", + "keep_blank_lines_in_code": "2", + "keep_blank_lines_in_declarations": "2", + "keep_control_statement_in_one_line": "true", + "keep_first_column_comment": "true", + "keep_indents_on_empty_lines": "false", + "keep_line_breaks": "true", + "keep_multiple_expressions_in_one_line": "false", + "keep_simple_blocks_in_one_line": "false", + "keep_simple_classes_in_one_line": "false", + "keep_simple_lambdas_in_one_line": "false", + "keep_simple_methods_in_one_line": "false", + "lambda_brace_style": "end_of_line", + "layout_static_imports_separately": "true", + "line_comment_add_space": "false", + "line_comment_at_first_column": "true", + "message_dd_suffix": "EJB", + "message_eb_suffix": "Bean", + "method_annotation_wrap": "split_into_lines", + "method_brace_style": "end_of_line", + "method_call_chain_wrap": "off", + "method_parameters_new_line_after_left_paren": "false", + "method_parameters_right_paren_on_new_line": "false", + "method_parameters_wrap": "normal", + "modifier_list_wrap": "false", + "names_count_to_use_import_on_demand": "3", + "packages_to_use_import_on_demand": [ + "java.awt.*", + "javax.swing.*" + ], + "parameter_annotation_wrap": "off", + "parentheses_expression_new_line_after_left_paren": "false", + "parentheses_expression_right_paren_on_new_line": "false", + "place_assignment_sign_on_next_line": "false", + "prefer_longer_names": "true", + "prefer_parameters_wrap": "false", + "repeat_synchronized": "true", + "replace_instanceof_and_cast": "false", + "replace_null_check": "true", + "resource_list_new_line_after_left_paren": "false", + "resource_list_right_paren_on_new_line": "false", + "resource_list_wrap": "off", + "session_dd_suffix": "EJB", + "session_eb_suffix": "Bean", + "session_hi_suffix": "Home", + "session_lhi_prefix": "Local", + "session_lhi_suffix": "Home", + "session_li_prefix": "Local", + "session_si_suffix": "Service", + "smart_tabs": "false", + "space_after_closing_angle_bracket_in_type_argument": "false", + "space_after_colon": "true", + "space_after_comma": "true", + "space_after_comma_in_type_arguments": "true", + "space_after_for_semicolon": "true", + "space_after_quest": "true", + "space_after_type_cast": "true", + "space_before_annotation_array_initializer_left_brace": "false", + "space_before_anotation_parameter_list": "false", + "space_before_array_initializer_left_brace": "false", + "space_before_catch_keyword": "true", + "space_before_catch_left_brace": "true", + "space_before_catch_parentheses": "true", + "space_before_class_left_brace": "true", + "space_before_colon": "true", + "space_before_colon_in_foreach": "true", + "space_before_comma": "false", + "space_before_do_left_brace": "true", + "space_before_else_keyword": "true", + "space_before_else_left_brace": "true", + "space_before_finally_keyword": "true", + "space_before_finally_left_brace": "true", + "space_before_for_left_brace": "true", + "space_before_for_parentheses": "true", + "space_before_for_semicolon": "false", + "space_before_if_left_brace": "true", + "space_before_if_parentheses": "true", + "space_before_method_call_parentheses": "false", + "space_before_method_left_brace": "true", + "space_before_method_parentheses": "false", + "space_before_opening_angle_bracket_in_type_parameter": "false", + "space_before_quest": "true", + "space_before_switch_left_brace": "true", + "space_before_switch_parentheses": "true", + "space_before_synchronized_left_brace": "true", + "space_before_synchronized_parentheses": "true", + "space_before_try_left_brace": "true", + "space_before_try_parentheses": "true", + "space_before_type_parameter_list": "false", + "space_before_while_keyword": "true", + "space_before_while_left_brace": "true", + "space_before_while_parentheses": "true", + "space_inside_one_line_enum_braces": "false", + "spaces_around_additive_operators": "true", + "spaces_around_assignment_operators": "true", + "spaces_around_bitwise_operators": "true", + "spaces_around_equality_operators": "true", + "spaces_around_lambda_arrow": "true", + "spaces_around_logical_operators": "true", + "spaces_around_method_ref_dbl_colon": "false", + "spaces_around_multiplicative_operators": "true", + "spaces_around_relational_operators": "true", + "spaces_around_shift_operators": "true", + "spaces_around_type_bounds_in_type_parameters": "true", + "spaces_around_unary_operator": "false", + "spaces_within_angle_brackets": "false", + "spaces_within_annotation_parentheses": "false", + "spaces_within_array_initializer_braces": "false", + "spaces_within_braces": "false", + "spaces_within_brackets": "false", + "spaces_within_cast_parentheses": "false", + "spaces_within_catch_parentheses": "false", + "spaces_within_empty_array_initializer_braces": "false", + "spaces_within_empty_method_call_parentheses": "false", + "spaces_within_empty_method_parentheses": "false", + "spaces_within_for_parentheses": "false", + "spaces_within_if_parentheses": "false", + "spaces_within_method_call_parentheses": "false", + "spaces_within_method_parentheses": "false", + "spaces_within_parentheses": "false", + "spaces_within_switch_parentheses": "false", + "spaces_within_synchronized_parentheses": "false", + "spaces_within_try_parentheses": "false", + "spaces_within_while_parentheses": "false", + "special_else_if_treatment": "true", + "static_field_name_suffix": "_s", + "subclass_name_suffix": "Impl", + "tab_width": "4", + "ternary_operation_signs_on_next_line": "false", + "ternary_operation_wrap": "off", + "test_name_suffix": "Test", + "throws_keyword_wrap": "off", + "throws_list_wrap": "off", + "use_external_annotations": "false", + "use_fq_class_names": "false", + "use_single_class_imports": "true", + "variable_annotation_wrap": "off", + "visibility": "public", + "while_brace_force": "never", + "while_on_new_line": "false", + "wrap_comments": "false", + "wrap_first_method_in_call_chain": "false", + "wrap_long_lines": "false" + } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/java/java-tests/testData/codeStyle/jsonExport.json b/java/java-tests/testData/codeStyle/jsonExport.json index 910f44d4d0cc..21eca3aaa950 100644 --- a/java/java-tests/testData/codeStyle/jsonExport.json +++ b/java/java-tests/testData/codeStyle/jsonExport.json @@ -1,244 +1,248 @@ -[ - { - "language": "java", - "options": { - "align_consecutive_assignments": "false", - "align_consecutive_variable_declarations": "false", - "align_group_field_declarations": "false", - "align_multiline_annotation_parameters": "false", - "align_multiline_array_initializer_expression": "false", - "align_multiline_assignment": "false", - "align_multiline_binary_operation": "false", - "align_multiline_chained_methods": "false", - "align_multiline_extends_list": "false", - "align_multiline_for": "true", - "align_multiline_method_brackets": "false", - "align_multiline_parameters": "true", - "align_multiline_parameters_in_calls": "false", - "align_multiline_parenthesized_expression": "false", - "align_multiline_resources": "true", - "align_multiline_ternary_operation": "false", - "align_multiline_throws_list": "false", - "align_subsequent_simple_methods": "false", - "align_throws_keyword": "false", - "annotation_parameter_wrap": "off", - "array_initializer_new_line_after_left_brace": "false", - "array_initializer_right_brace_on_new_line": "false", - "array_initializer_wrap": "off", - "assert_statement_colon_on_next_line": "false", - "assert_statement_wrap": "off", - "assignment_wrap": "off", - "binary_operation_sign_on_next_line": "false", - "binary_operation_wrap": "off", - "blank_lines_after_anonymous_class_header": "0", - "blank_lines_after_class_header": "0", - "blank_lines_after_imports": "1", - "blank_lines_after_package": "1", - "blank_lines_around_class": "1", - "blank_lines_around_field": "0", - "blank_lines_around_field_in_interface": "0", - "blank_lines_around_initializer": "1", - "blank_lines_around_method": "1", - "blank_lines_around_method_in_interface": "1", - "blank_lines_before_class_end": "0", - "blank_lines_before_imports": "1", - "blank_lines_before_method_body": "0", - "blank_lines_before_package": "0", - "block_comment_at_first_column": "true", - "brace_style": "end_of_line", - "call_parameters_new_line_after_left_paren": "false", - "call_parameters_right_paren_on_new_line": "false", - "call_parameters_wrap": "on_every_item", - "case_statement_on_new_line": "true", - "catch_on_new_line": "false", - "class_annotation_wrap": "split_into_lines", - "class_brace_style": "end_of_line", - "class_count_to_use_import_on_demand": "5", - "class_names_in_javadoc": "1", - "continuation_indent_size": "8", - "do_not_indent_top_level_class_members": "false", - "do_not_wrap_after_single_annotation": "false", - "do_while_brace_force": "never", - "doc_add_blank_line_after_description": "true", - "doc_add_blank_line_after_param_comments": "false", - "doc_add_blank_line_after_return": "false", - "doc_add_p_tag_on_empty_lines": "true", - "doc_align_exception_comments": "true", - "doc_align_param_comments": "true", - "doc_do_not_wrap_if_one_line": "false", - "doc_enable_formatting": "true", - "doc_enable_leading_asterisks": "true", - "doc_indent_on_continuation": "false", - "doc_keep_empty_lines": "true", - "doc_keep_empty_parameter_tag": "true", - "doc_keep_empty_return_tag": "true", - "doc_keep_empty_throws_tag": "true", - "doc_keep_invalid_tags": "true", - "doc_param_description_on_new_line": "false", - "doc_preserve_line_breaks": "false", - "doc_use_throws_not_exception_tag": "true", - "else_on_new_line": "false", - "enum_constants_wrap": "off", - "extends_keyword_wrap": "off", - "extends_list_wrap": "off", - "field_annotation_wrap": "split_into_lines", - "field_name_prefix": "m_", - "finally_on_new_line": "false", - "for_brace_force": "never", - "for_statement_new_line_after_left_paren": "false", - "for_statement_right_paren_on_new_line": "false", - "for_statement_wrap": "off", - "generate_final_locals": "false", - "generate_final_parameters": "false", - "if_brace_force": "never", - "imports_layout": [ - "*", - "blank_line", - "javax.**", - "java.**", - "blank_line", - "static *" - ], - "indent_case_from_switch": "true", - "indent_size": "4", - "indent_style": "space", - "insert_inner_class_imports": "false", - "insert_override_annotation": "true", - "keep_blank_lines_before_right_brace": "2", - "keep_blank_lines_between_package_declaration_and_header": "2", - "keep_blank_lines_in_code": "2", - "keep_blank_lines_in_declarations": "2", - "keep_control_statement_in_one_line": "true", - "keep_first_column_comment": "true", - "keep_indents_on_empty_lines": "false", - "keep_line_breaks": "true", - "keep_multiple_expressions_in_one_line": "false", - "keep_simple_blocks_in_one_line": "false", - "keep_simple_classes_in_one_line": "false", - "keep_simple_lambdas_in_one_line": "false", - "keep_simple_methods_in_one_line": "false", - "lambda_brace_style": "end_of_line", - "layout_static_imports_separately": "true", - "line_comment_add_space": "false", - "line_comment_at_first_column": "true", - "method_annotation_wrap": "split_into_lines", - "method_brace_style": "end_of_line", - "method_call_chain_wrap": "off", - "method_parameters_new_line_after_left_paren": "false", - "method_parameters_right_paren_on_new_line": "false", - "method_parameters_wrap": "normal", - "modifier_list_wrap": "false", - "names_count_to_use_import_on_demand": "3", - "packages_to_use_import_on_demand": [ - "java.awt.*", - "javax.swing.*" - ], - "parameter_annotation_wrap": "off", - "parentheses_expression_new_line_after_left_paren": "false", - "parentheses_expression_right_paren_on_new_line": "false", - "place_assignment_sign_on_next_line": "false", - "prefer_longer_names": "true", - "prefer_parameters_wrap": "false", - "repeat_synchronized": "true", - "replace_instanceof_and_cast": "false", - "replace_null_check": "true", - "resource_list_new_line_after_left_paren": "false", - "resource_list_right_paren_on_new_line": "false", - "resource_list_wrap": "off", - "smart_tabs": "false", - "space_after_closing_angle_bracket_in_type_argument": "false", - "space_after_colon": "true", - "space_after_comma": "true", - "space_after_comma_in_type_arguments": "true", - "space_after_for_semicolon": "true", - "space_after_quest": "true", - "space_after_type_cast": "true", - "space_before_annotation_array_initializer_left_brace": "false", - "space_before_anotation_parameter_list": "false", - "space_before_array_initializer_left_brace": "false", - "space_before_catch_keyword": "true", - "space_before_catch_left_brace": "true", - "space_before_catch_parentheses": "true", - "space_before_class_left_brace": "true", - "space_before_colon": "true", - "space_before_colon_in_foreach": "true", - "space_before_comma": "false", - "space_before_do_left_brace": "true", - "space_before_else_keyword": "true", - "space_before_else_left_brace": "true", - "space_before_finally_keyword": "true", - "space_before_finally_left_brace": "true", - "space_before_for_left_brace": "true", - "space_before_for_parentheses": "true", - "space_before_for_semicolon": "false", - "space_before_if_left_brace": "true", - "space_before_if_parentheses": "true", - "space_before_method_call_parentheses": "false", - "space_before_method_left_brace": "true", - "space_before_method_parentheses": "false", - "space_before_opening_angle_bracket_in_type_parameter": "false", - "space_before_quest": "true", - "space_before_switch_left_brace": "true", - "space_before_switch_parentheses": "true", - "space_before_synchronized_left_brace": "true", - "space_before_synchronized_parentheses": "true", - "space_before_try_left_brace": "true", - "space_before_try_parentheses": "true", - "space_before_type_parameter_list": "false", - "space_before_while_keyword": "true", - "space_before_while_left_brace": "true", - "space_before_while_parentheses": "true", - "space_inside_one_line_enum_braces": "false", - "spaces_around_additive_operators": "true", - "spaces_around_assignment_operators": "true", - "spaces_around_bitwise_operators": "true", - "spaces_around_equality_operators": "true", - "spaces_around_lambda_arrow": "true", - "spaces_around_logical_operators": "true", - "spaces_around_method_ref_dbl_colon": "false", - "spaces_around_multiplicative_operators": "true", - "spaces_around_relational_operators": "true", - "spaces_around_shift_operators": "true", - "spaces_around_type_bounds_in_type_parameters": "true", - "spaces_around_unary_operator": "false", - "spaces_within_angle_brackets": "false", - "spaces_within_annotation_parentheses": "false", - "spaces_within_array_initializer_braces": "false", - "spaces_within_braces": "false", - "spaces_within_brackets": "false", - "spaces_within_cast_parentheses": "false", - "spaces_within_catch_parentheses": "false", - "spaces_within_empty_array_initializer_braces": "false", - "spaces_within_empty_method_call_parentheses": "false", - "spaces_within_empty_method_parentheses": "false", - "spaces_within_for_parentheses": "false", - "spaces_within_if_parentheses": "false", - "spaces_within_method_call_parentheses": "false", - "spaces_within_method_parentheses": "false", - "spaces_within_parentheses": "false", - "spaces_within_switch_parentheses": "false", - "spaces_within_synchronized_parentheses": "false", - "spaces_within_try_parentheses": "false", - "spaces_within_while_parentheses": "false", - "special_else_if_treatment": "true", - "static_field_name_suffix": "_s", - "subclass_name_suffix": "Impl", - "tab_width": "4", - "ternary_operation_signs_on_next_line": "false", - "ternary_operation_wrap": "off", - "test_name_suffix": "Test", - "throws_keyword_wrap": "off", - "throws_list_wrap": "off", - "use_external_annotations": "false", - "use_fq_class_names": "false", - "use_single_class_imports": "true", - "variable_annotation_wrap": "off", - "visibility": "public", - "while_brace_force": "never", - "while_on_new_line": "false", - "wrap_comments": "false", - "wrap_first_method_in_call_chain": "false", - "wrap_long_lines": "false" +{ + "schemeName": "Test", + "version": "1.0", + "codeStyle": [ + { + "language": "java", + "options": { + "align_consecutive_assignments": "false", + "align_consecutive_variable_declarations": "false", + "align_group_field_declarations": "false", + "align_multiline_annotation_parameters": "false", + "align_multiline_array_initializer_expression": "false", + "align_multiline_assignment": "false", + "align_multiline_binary_operation": "false", + "align_multiline_chained_methods": "false", + "align_multiline_extends_list": "false", + "align_multiline_for": "true", + "align_multiline_method_brackets": "false", + "align_multiline_parameters": "true", + "align_multiline_parameters_in_calls": "false", + "align_multiline_parenthesized_expression": "false", + "align_multiline_resources": "true", + "align_multiline_ternary_operation": "false", + "align_multiline_throws_list": "false", + "align_subsequent_simple_methods": "false", + "align_throws_keyword": "false", + "annotation_parameter_wrap": "off", + "array_initializer_new_line_after_left_brace": "false", + "array_initializer_right_brace_on_new_line": "false", + "array_initializer_wrap": "off", + "assert_statement_colon_on_next_line": "false", + "assert_statement_wrap": "off", + "assignment_wrap": "off", + "binary_operation_sign_on_next_line": "false", + "binary_operation_wrap": "off", + "blank_lines_after_anonymous_class_header": "0", + "blank_lines_after_class_header": "0", + "blank_lines_after_imports": "1", + "blank_lines_after_package": "1", + "blank_lines_around_class": "1", + "blank_lines_around_field": "0", + "blank_lines_around_field_in_interface": "0", + "blank_lines_around_initializer": "1", + "blank_lines_around_method": "1", + "blank_lines_around_method_in_interface": "1", + "blank_lines_before_class_end": "0", + "blank_lines_before_imports": "1", + "blank_lines_before_method_body": "0", + "blank_lines_before_package": "0", + "block_comment_at_first_column": "true", + "brace_style": "end_of_line", + "call_parameters_new_line_after_left_paren": "false", + "call_parameters_right_paren_on_new_line": "false", + "call_parameters_wrap": "on_every_item", + "case_statement_on_new_line": "true", + "catch_on_new_line": "false", + "class_annotation_wrap": "split_into_lines", + "class_brace_style": "end_of_line", + "class_count_to_use_import_on_demand": "5", + "class_names_in_javadoc": "1", + "continuation_indent_size": "8", + "do_not_indent_top_level_class_members": "false", + "do_not_wrap_after_single_annotation": "false", + "do_while_brace_force": "never", + "doc_add_blank_line_after_description": "true", + "doc_add_blank_line_after_param_comments": "false", + "doc_add_blank_line_after_return": "false", + "doc_add_p_tag_on_empty_lines": "true", + "doc_align_exception_comments": "true", + "doc_align_param_comments": "true", + "doc_do_not_wrap_if_one_line": "false", + "doc_enable_formatting": "true", + "doc_enable_leading_asterisks": "true", + "doc_indent_on_continuation": "false", + "doc_keep_empty_lines": "true", + "doc_keep_empty_parameter_tag": "true", + "doc_keep_empty_return_tag": "true", + "doc_keep_empty_throws_tag": "true", + "doc_keep_invalid_tags": "true", + "doc_param_description_on_new_line": "false", + "doc_preserve_line_breaks": "false", + "doc_use_throws_not_exception_tag": "true", + "else_on_new_line": "false", + "enum_constants_wrap": "off", + "extends_keyword_wrap": "off", + "extends_list_wrap": "off", + "field_annotation_wrap": "split_into_lines", + "field_name_prefix": "m_", + "finally_on_new_line": "false", + "for_brace_force": "never", + "for_statement_new_line_after_left_paren": "false", + "for_statement_right_paren_on_new_line": "false", + "for_statement_wrap": "off", + "generate_final_locals": "false", + "generate_final_parameters": "false", + "if_brace_force": "never", + "imports_layout": [ + "*", + "blank_line", + "javax.**", + "java.**", + "blank_line", + "static *" + ], + "indent_case_from_switch": "true", + "indent_size": "4", + "indent_style": "space", + "insert_inner_class_imports": "false", + "insert_override_annotation": "true", + "keep_blank_lines_before_right_brace": "2", + "keep_blank_lines_between_package_declaration_and_header": "2", + "keep_blank_lines_in_code": "2", + "keep_blank_lines_in_declarations": "2", + "keep_control_statement_in_one_line": "true", + "keep_first_column_comment": "true", + "keep_indents_on_empty_lines": "false", + "keep_line_breaks": "true", + "keep_multiple_expressions_in_one_line": "false", + "keep_simple_blocks_in_one_line": "false", + "keep_simple_classes_in_one_line": "false", + "keep_simple_lambdas_in_one_line": "false", + "keep_simple_methods_in_one_line": "false", + "lambda_brace_style": "end_of_line", + "layout_static_imports_separately": "true", + "line_comment_add_space": "false", + "line_comment_at_first_column": "true", + "method_annotation_wrap": "split_into_lines", + "method_brace_style": "end_of_line", + "method_call_chain_wrap": "off", + "method_parameters_new_line_after_left_paren": "false", + "method_parameters_right_paren_on_new_line": "false", + "method_parameters_wrap": "normal", + "modifier_list_wrap": "false", + "names_count_to_use_import_on_demand": "3", + "packages_to_use_import_on_demand": [ + "java.awt.*", + "javax.swing.*" + ], + "parameter_annotation_wrap": "off", + "parentheses_expression_new_line_after_left_paren": "false", + "parentheses_expression_right_paren_on_new_line": "false", + "place_assignment_sign_on_next_line": "false", + "prefer_longer_names": "true", + "prefer_parameters_wrap": "false", + "repeat_synchronized": "true", + "replace_instanceof_and_cast": "false", + "replace_null_check": "true", + "resource_list_new_line_after_left_paren": "false", + "resource_list_right_paren_on_new_line": "false", + "resource_list_wrap": "off", + "smart_tabs": "false", + "space_after_closing_angle_bracket_in_type_argument": "false", + "space_after_colon": "true", + "space_after_comma": "true", + "space_after_comma_in_type_arguments": "true", + "space_after_for_semicolon": "true", + "space_after_quest": "true", + "space_after_type_cast": "true", + "space_before_annotation_array_initializer_left_brace": "false", + "space_before_anotation_parameter_list": "false", + "space_before_array_initializer_left_brace": "false", + "space_before_catch_keyword": "true", + "space_before_catch_left_brace": "true", + "space_before_catch_parentheses": "true", + "space_before_class_left_brace": "true", + "space_before_colon": "true", + "space_before_colon_in_foreach": "true", + "space_before_comma": "false", + "space_before_do_left_brace": "true", + "space_before_else_keyword": "true", + "space_before_else_left_brace": "true", + "space_before_finally_keyword": "true", + "space_before_finally_left_brace": "true", + "space_before_for_left_brace": "true", + "space_before_for_parentheses": "true", + "space_before_for_semicolon": "false", + "space_before_if_left_brace": "true", + "space_before_if_parentheses": "true", + "space_before_method_call_parentheses": "false", + "space_before_method_left_brace": "true", + "space_before_method_parentheses": "false", + "space_before_opening_angle_bracket_in_type_parameter": "false", + "space_before_quest": "true", + "space_before_switch_left_brace": "true", + "space_before_switch_parentheses": "true", + "space_before_synchronized_left_brace": "true", + "space_before_synchronized_parentheses": "true", + "space_before_try_left_brace": "true", + "space_before_try_parentheses": "true", + "space_before_type_parameter_list": "false", + "space_before_while_keyword": "true", + "space_before_while_left_brace": "true", + "space_before_while_parentheses": "true", + "space_inside_one_line_enum_braces": "false", + "spaces_around_additive_operators": "true", + "spaces_around_assignment_operators": "true", + "spaces_around_bitwise_operators": "true", + "spaces_around_equality_operators": "true", + "spaces_around_lambda_arrow": "true", + "spaces_around_logical_operators": "true", + "spaces_around_method_ref_dbl_colon": "false", + "spaces_around_multiplicative_operators": "true", + "spaces_around_relational_operators": "true", + "spaces_around_shift_operators": "true", + "spaces_around_type_bounds_in_type_parameters": "true", + "spaces_around_unary_operator": "false", + "spaces_within_angle_brackets": "false", + "spaces_within_annotation_parentheses": "false", + "spaces_within_array_initializer_braces": "false", + "spaces_within_braces": "false", + "spaces_within_brackets": "false", + "spaces_within_cast_parentheses": "false", + "spaces_within_catch_parentheses": "false", + "spaces_within_empty_array_initializer_braces": "false", + "spaces_within_empty_method_call_parentheses": "false", + "spaces_within_empty_method_parentheses": "false", + "spaces_within_for_parentheses": "false", + "spaces_within_if_parentheses": "false", + "spaces_within_method_call_parentheses": "false", + "spaces_within_method_parentheses": "false", + "spaces_within_parentheses": "false", + "spaces_within_switch_parentheses": "false", + "spaces_within_synchronized_parentheses": "false", + "spaces_within_try_parentheses": "false", + "spaces_within_while_parentheses": "false", + "special_else_if_treatment": "true", + "static_field_name_suffix": "_s", + "subclass_name_suffix": "Impl", + "tab_width": "4", + "ternary_operation_signs_on_next_line": "false", + "ternary_operation_wrap": "off", + "test_name_suffix": "Test", + "throws_keyword_wrap": "off", + "throws_list_wrap": "off", + "use_external_annotations": "false", + "use_fq_class_names": "false", + "use_single_class_imports": "true", + "variable_annotation_wrap": "off", + "visibility": "public", + "while_brace_force": "never", + "while_on_new_line": "false", + "wrap_comments": "false", + "wrap_first_method_in_call_chain": "false", + "wrap_long_lines": "false" + } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonDescriptor.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonDescriptor.java new file mode 100644 index 000000000000..48c602d181eb --- /dev/null +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonDescriptor.java @@ -0,0 +1,85 @@ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.psi.impl.source.codeStyle.json; + +import com.intellij.application.options.codeStyle.properties.AbstractCodeStylePropertyMapper; +import com.intellij.application.options.codeStyle.properties.CodeStylePropertiesUtil; +import com.intellij.application.options.codeStyle.properties.GeneralCodeStylePropertyMapper; +import com.intellij.application.options.codeStyle.properties.LanguageCodeStylePropertyMapper; +import com.intellij.lang.Language; +import com.intellij.psi.codeStyle.CodeStyleScheme; +import com.intellij.psi.codeStyle.CodeStyleSettings; +import com.intellij.psi.codeStyle.DisplayPriority; +import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider; +import com.intellij.util.PlatformUtils; +import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.NotNull; + +import java.util.Collections; +import java.util.List; + +public class CodeStyleSchemeJsonDescriptor { + + public final static String VERSION = "1.0"; + + private transient final CodeStyleScheme myScheme; + private transient final List myLangDomainIds; + + public final String schemeName; + public final String version = VERSION; + public List codeStyle; + + CodeStyleSchemeJsonDescriptor(CodeStyleScheme scheme, List ids) { + myScheme = scheme; + schemeName = scheme.getName(); + myLangDomainIds = ids; + this.codeStyle = getOptionDescriptors(); + } + + private List getOptionDescriptors() { + List descriptors = ContainerUtil.newArrayList(); + CodeStylePropertiesUtil.collectMappers(myScheme.getCodeStyleSettings(), mapper -> { + if (myLangDomainIds == null || myLangDomainIds.contains(mapper.getLanguageDomainId())) { + descriptors.add(new LanguagePropertyMapperDescriptor(mapper.getLanguageDomainId(), mapper, getPriority(mapper))); + } + }); + Collections.sort(descriptors); + return descriptors; + } + + private static DisplayPriority getPriority(@NotNull AbstractCodeStylePropertyMapper mapper) { + if (mapper instanceof GeneralCodeStylePropertyMapper) { + return DisplayPriority.GENERAL_SETTINGS; + } + else if (mapper instanceof LanguageCodeStylePropertyMapper) { + Language language = ((LanguageCodeStylePropertyMapper)mapper).getLanguage(); + LanguageCodeStyleSettingsProvider provider = LanguageCodeStyleSettingsProvider.forLanguage(language); + if (provider != null) { + return provider.getDisplayPriority(); + } + } + return DisplayPriority.OTHER_SETTINGS; + } + + private static class LanguagePropertyMapperDescriptor implements Comparable { + final @NotNull String language; + final @NotNull AbstractCodeStylePropertyMapper options; + private final transient @NotNull DisplayPriority priority; + + private LanguagePropertyMapperDescriptor(@NotNull String language, + @NotNull AbstractCodeStylePropertyMapper mapper, + @NotNull DisplayPriority priority) { + this.language = language; + this.options = mapper; + this.priority = priority; + } + + @Override + public int compareTo(@NotNull LanguagePropertyMapperDescriptor d) { + int result = this.priority.compareTo(d.priority); + if (result == 0) { + result = this.language.compareTo(d.language); + } + return result; + } + } +} diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonExporter.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonExporter.java index 7e198708b54c..e9421adce696 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonExporter.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/json/CodeStyleSchemeJsonExporter.java @@ -3,13 +3,8 @@ package com.intellij.psi.impl.source.codeStyle.json; import com.google.gson.*; import com.intellij.application.options.codeStyle.properties.*; -import com.intellij.lang.Language; import com.intellij.openapi.options.SchemeExporter; import com.intellij.psi.codeStyle.CodeStyleScheme; -import com.intellij.psi.codeStyle.CodeStyleSettings; -import com.intellij.psi.codeStyle.DisplayPriority; -import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider; -import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -18,7 +13,6 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; -import java.util.Collections; import java.util.List; public class CodeStyleSchemeJsonExporter extends SchemeExporter { @@ -57,7 +51,7 @@ public class CodeStyleSchemeJsonExporter extends SchemeExporter } }); Gson gson = builder.create(); - String json = gson.toJson(getOptionDescriptors(scheme.getCodeStyleSettings(), languageNames)); + String json = gson.toJson(new CodeStyleSchemeJsonDescriptor(scheme, languageNames)); try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))) { writer.write(json); } @@ -69,52 +63,4 @@ public class CodeStyleSchemeJsonExporter extends SchemeExporter } - private static List getOptionDescriptors(@NotNull CodeStyleSettings settings, - @Nullable List languageDomainIds) { - List descriptors = ContainerUtil.newArrayList(); - CodeStylePropertiesUtil.collectMappers(settings, mapper -> { - if (languageDomainIds == null || languageDomainIds.contains(mapper.getLanguageDomainId())) { - descriptors.add(new LanguagePropertyMapperDescriptor(mapper.getLanguageDomainId(), mapper, getPriority(mapper))); - } - }); - Collections.sort(descriptors); - return descriptors; - } - - private static DisplayPriority getPriority(@NotNull AbstractCodeStylePropertyMapper mapper) { - if (mapper instanceof GeneralCodeStylePropertyMapper) { - return DisplayPriority.GENERAL_SETTINGS; - } - else if (mapper instanceof LanguageCodeStylePropertyMapper) { - Language language = ((LanguageCodeStylePropertyMapper)mapper).getLanguage(); - LanguageCodeStyleSettingsProvider provider = LanguageCodeStyleSettingsProvider.forLanguage(language); - if (provider != null) { - return provider.getDisplayPriority(); - } - } - return DisplayPriority.OTHER_SETTINGS; - } - - private static class LanguagePropertyMapperDescriptor implements Comparable { - final @NotNull String language; - final @NotNull AbstractCodeStylePropertyMapper options; - private final transient @NotNull DisplayPriority priority; - - private LanguagePropertyMapperDescriptor(@NotNull String language, - @NotNull AbstractCodeStylePropertyMapper mapper, - @NotNull DisplayPriority priority) { - this.language = language; - this.options = mapper; - this.priority = priority; - } - - @Override - public int compareTo(@NotNull LanguagePropertyMapperDescriptor d) { - int result = this.priority.compareTo(d.priority); - if (result == 0) { - result = this.language.compareTo(d.language); - } - return result; - } - } } diff --git a/platform/platform-tests/testData/codeStyle/json/exportToJson.json b/platform/platform-tests/testData/codeStyle/json/exportToJson.json index 45901472c777..9f911c68148b 100644 --- a/platform/platform-tests/testData/codeStyle/json/exportToJson.json +++ b/platform/platform-tests/testData/codeStyle/json/exportToJson.json @@ -1,110 +1,114 @@ -[ - { - "language": "all", - "options": { - "formatter_off_tag": "@formatter:off", - "formatter_on_tag": "@formatter:on", - "formatter_tags_accept_regexp": "false", - "formatter_tags_enabled": "false", - "max_line_length": "120", - "wrap_on_typing": "false" +{ + "schemeName": "Test", + "version": "1.0", + "codeStyle": [ + { + "language": "all", + "options": { + "formatter_off_tag": "@formatter:off", + "formatter_on_tag": "@formatter:on", + "formatter_tags_accept_regexp": "false", + "formatter_tags_enabled": "false", + "max_line_length": "120", + "wrap_on_typing": "false" + } + }, + { + "language": "html", + "options": { + "add_new_line_before_tags": [ + "body", + "div", + "p", + "form", + "h1", + "h2", + "h3" + ], + "align_attributes": "true", + "align_text": "false", + "attribute_wrap": "normal", + "block_comment_at_first_column": "true", + "continuation_indent_size": "8", + "do_not_align_children_of_min_lines": "0", + "do_not_break_if_inline_tags": [ + "title", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "p" + ], + "do_not_indent_children_of_tags": [ + "html", + "body", + "thead", + "tbody", + "tfoot" + ], + "enforce_quotes": "false", + "indent_size": "4", + "indent_style": "space", + "inline_tags": [ + "a", + "abbr", + "acronym", + "b", + "basefont", + "bdo", + "big", + "br", + "cite", + "cite", + "code", + "dfn", + "em", + "font", + "i", + "img", + "input", + "kbd", + "label", + "q", + "s", + "samp", + "select", + "span", + "strike", + "strong", + "sub", + "sup", + "textarea", + "tt", + "u", + "var" + ], + "keep_blank_lines": "2", + "keep_indents_on_empty_lines": "false", + "keep_line_breaks": "true", + "keep_line_breaks_in_text": "true", + "keep_whitespaces": "false", + "keep_whitespaces_inside": [ + "span", + "pre", + "textarea" + ], + "line_comment_at_first_column": "true", + "new_line_after_last_attribute": "never", + "new_line_before_first_attribute": "never", + "quote_style": "double", + "remove_new_line_before_tags": [ + "br" + ], + "smart_tabs": "false", + "space_after_tag_name": "false", + "space_around_equality_in_attribute": "false", + "space_inside_empty_tag": "false", + "tab_width": "4", + "text_wrap": "normal" + } } - }, - { - "language": "html", - "options": { - "add_new_line_before_tags": [ - "body", - "div", - "p", - "form", - "h1", - "h2", - "h3" - ], - "align_attributes": "true", - "align_text": "false", - "attribute_wrap": "normal", - "block_comment_at_first_column": "true", - "continuation_indent_size": "8", - "do_not_align_children_of_min_lines": "0", - "do_not_break_if_inline_tags": [ - "title", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "p" - ], - "do_not_indent_children_of_tags": [ - "html", - "body", - "thead", - "tbody", - "tfoot" - ], - "enforce_quotes": "false", - "indent_size": "4", - "indent_style": "space", - "inline_tags": [ - "a", - "abbr", - "acronym", - "b", - "basefont", - "bdo", - "big", - "br", - "cite", - "cite", - "code", - "dfn", - "em", - "font", - "i", - "img", - "input", - "kbd", - "label", - "q", - "s", - "samp", - "select", - "span", - "strike", - "strong", - "sub", - "sup", - "textarea", - "tt", - "u", - "var" - ], - "keep_blank_lines": "2", - "keep_indents_on_empty_lines": "false", - "keep_line_breaks": "true", - "keep_line_breaks_in_text": "true", - "keep_whitespaces": "false", - "keep_whitespaces_inside": [ - "span", - "pre", - "textarea" - ], - "line_comment_at_first_column": "true", - "new_line_after_last_attribute": "never", - "new_line_before_first_attribute": "never", - "quote_style": "double", - "remove_new_line_before_tags": [ - "br" - ], - "smart_tabs": "false", - "space_after_tag_name": "false", - "space_around_equality_in_attribute": "false", - "space_inside_empty_tag": "false", - "tab_width": "4", - "text_wrap": "normal" - } - } -] \ No newline at end of file + ] +} \ No newline at end of file