Custom Code Style Settings using xml file like in eclipse


I have an xml file of my own code formatting style rules created using eclipse. Followings are the example entries in that
<profiles version="12">
<profile kind="CodeFormatterProfile" name="Aristocrat_java_formatter" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>



How I can use it in intelliJ ? I tried it using code styles -> java -> manage -> import, but there is only one predefined option.

Comment actions Permalink

You've probably disabled Eclipse Integration plug-in ( which provides an additional option for this dialog:

Another option is to use Eclipse Code Formatter plug-in ( which will replace built-in code formatter and provide exactly the same results as Eclipse.

Comment actions Permalink

Thanks a lot !! It works(Second Option)


Please sign in to leave a comment.