我的编程空间,编程开发者的网络收藏夹
学习永远不晚

idea如何格式化代码

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

idea如何格式化代码

本文小编为大家详细介绍“idea如何格式化代码”,内容详细,步骤清晰,细节处理妥当,希望这篇“idea如何格式化代码”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。

idea格式化代码的方法:1、直接使用快捷键“Ctrl+Alt+L”格式化代码。2、打开打开idea,依次点击“File”-“Settings”-“Plugins”,搜索并安装“eclipse code formatter”;然后导入配置文件“eclipse-codestyle.xml”;最后使用快捷键“Ctrl+Shift+Alt+L”格式化代码。

IDEA 全称 IntelliJ IDEA,是java编程语言的集成开发环境。IntelliJ在业界被公认为最好的Java开发工具,尤其在智能代码助手、代码自动提示、重构、JavaEE支持、各类版本工具(git、svn等)、JUnit、CVS整合、代码分析、 创新的GUI设计等方面的功能可以说是超常的。IDEA是JetBrains公司的产品,这家公司总部位于捷克共和国的首都布拉格,开发人员以严谨著称的东欧程序员为主。它的旗舰版还支持HTML,CSS,PHP,MySQL,Python等。免费版只支持Java,Kotlin等少数语言。

idea格式化代码的方法

方法1:原生方法

在IDEA中,可以使用Ctrl+Alt+L快捷键格式化代码。

idea如何格式化代码

使用Ctrl+Alt+L快捷键格式化代码,这时代码格式会变得很工整。

idea如何格式化代码

方法2:利用插件

是否遇到过使用快捷键“Ctrl+Alt+L”后代码几乎没变化,格式化后的结果没有达到预期效果,不妨试试配置代码格式化模板。

一、idea格式化模板配置步骤

安装插件:EclipseCodeFormatter

阿里配置文件只是针对eclipse,所以导入配置文件之前需要先安装EclipseFormatter插件

打开idea编辑器:File->Settings->Plugins,搜索 eclipse code formatter

idea如何格式化代码

我这是已经安装好的页面

导入配置文件 eclipse-codestyle.xml

上面步骤操作完页面不要关,找到下面的Other Settings->Adapter eclipse code formatter路径,按照图片位置找到eclipse-codestyle.xml文件保存的位置,添加进去就行了(文件放文章后面

idea如何格式化代码

二、格式化代码只格式化我修改的代码不格式化未修改的代码

只格式化自己写的代码,不格式化版本仓库里面的代码,防止代码评审或者代码对比出现大量不一致的代码
快捷键:Ctrl+Shift+Alt+L

idea如何格式化代码

  • 在默认情况下,Scope 选项是 Whole file ,也就是格式化当前窗口的全部代码

  • Only changes uncommitted to VCS表示只格式化我修改的,不格式化我未修改的代码

  • 我们也可以设置在自动保存的时候触发代码格式化。 操作方法:File->Settings->Tools->Actions on Save 中进行设置。
    注意在勾选完Reformat code 之后后面的 Whole file 这里要改为 Changed lines

idea如何格式化代码

eclipse-codestyle.xml文件自取,记得一键三连哦0.0

<?xml version="1.0" encoding="UTF-8" standalone="no"?><profiles version="12">    <profile kind="CodeFormatterProfile" name="P3C-CodeStyle" version="13">        <!--可变参数的... Idea没有对应的配置项,强制insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>        <!--枚举值之间 Idea没有对应的配置项,强制insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=Java:SPACE_BEFORE_COMMA-->        <!--org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=Java:SPACE_BEFORE_COMMA        由于IDEA只有一个SPACE_BEFORE_COMMA选项,所以统一设置 insert_space_before_comma 为 do not insert        -->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not 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_comma_in_type_arguments" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"                 value="do not insert"/>        <!--insert_space_before_comma end-->        <!--org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=Java:SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>        <!--IDEA只有一个配置项SPACE_AFTER_COMMA,insert_space_after_comma*统一设置成insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>        <!--insert_space_after_comma end-->        <!--org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=Java:SPACE_BEFORE_COLON-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=Java:SPACE_AFTER_COLON-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>        <!--IDEA不支持配置,默认do not insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>        <!--这个在Eclipse也没有找到配置的地方-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_semicolon=Java:SPACE_BEFORE_SEMICOLON        程序导入的时候强制将SPACE_BEFORE_SEMICOLON设置为false        -->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>        <!--SPACE_AFTER_SEMICOLON=true-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>        <!--IDEA不支持配置,do not insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"                 value="do not insert"/>        <setting                id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"                value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"                 value="do not insert"/>        <!--IDEA不支持,使用默认-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>        <!--IDEA不支持配置,使用如下值,两者对应-->        <setting                id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"                value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"                 value="insert"/>        <setting                id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"                value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"                 value="do not insert"/>        <setting                id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"                value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"                 value="do not insert"/>        <!--Java:SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETER-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=Java:SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENT-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>        <!--IDEA使用了对应的配置:Java:SPACE_WITHIN_ARRAY_INITIALIZER_BRACES,但感觉不太好,IDEA默认不插入,Eclipse也使用不插入-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"                 value="do not insert"/>        <!--use default insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return"                 value="insert"/>        <!--use default do not insert -->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>        <!--use default insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"                 value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw"                 value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=Java:SPACE_BEFORE_SWITCH_LBRACE-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=Java:SPACE_BEFORE_CLASS_LBRACE-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"                 value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=Java:SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"                 value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=Java:SPACE_BEFORE_METHOD_LBRACE-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"                 value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=Java:SPACE_AFTER_QUEST-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=Java:SPACE_BEFORE_QUEST-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=Java:SPACE_BEFORE_ANOTATION_PARAMETER_LIST-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"                 value="do not insert"/>        <!--use default do not insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>        <setting                id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"                value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"                 value="do not insert"/>        <!--下面两个对应IDEA中的一个配置Java:SPACE_AROUND_ASSIGNMENT_OPERATORS,使用insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=Java:SPACE_BEFORE_CATCH_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=Java:SPACE_BEFORE_METHOD_CALL_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=Java:SPACE_BEFORE_TRY_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>        <!--下面两个对应IDEA中的一个配置Java:SPACE_AROUND_UNARY_OPERATOR,使用do not insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=Java:SPACE_BEFORE_IF_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=Java:SPACE_BEFORE_WHILE_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=Java:SPACE_AFTER_TYPE_CAST-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=Java:SPACE_BEFORE_METHOD_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=Java:SPACE_BEFORE_FOR_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=Java:SPACE_BEFORE_SYNCHRONIZED_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=Java:SPACE_BEFORE_SWITCH_PARENTHESES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>        <!--下面两个对应IDEA中的一个配置Java:SPACE_AROUND_LAMBDA_ARROW,使用insert-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>        <!--SPACE_WITHIN_EMPTY_ARRAY_INITIALIZER_BRACES-->        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"                 value="do not insert"/>        <!--Idea -> Wrapping And Braces -> Simple classes in one line -->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="do not insert"/>        <!--Idea -> Wrapping And Braces -> Simple method in one line -->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>        <!--因为Idea不支持配置,所以设置为 Idea默认值-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant"                 value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="insert"/>        <!--Idea可以通过Wrap Always实现 TODO-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>        <!--Idea -> Wrapping And Braces -> Simple block in one line -> do not select -->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>        <!--Idea -> Wrapping And Braces -> try statement -> catch.... (Java:CATCH_ON_NEW_LINE)-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=Java:ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"                 value="do not insert"/>        <!--#org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=Java:ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=Java:ELSE_ON_NEW_LINE-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=Java:WHILE_ON_NEW_LINE-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"                 value="do not insert"/>        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=Java:FINALLY_ON_NEW_LINE-->        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"                 value="do not insert"/>        <!--comment start-->        <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>        <!--ENABLE_JAVADOC_FORMATTING-->        <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>        <!--org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>        <!--IDEA无对应设置,所以关闭对block comment的格式化 -->        <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>        <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>        <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>        <!--org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=Java:KEEP_FIRST_COLUMN_COMMENT-->        <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>        <!--org.eclipse.jdt.core.formatter.use_on_off_tags=FORMATTER_TAGS_ENABLED-->        <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>        <!--org.eclipse.jdt.core.formatter.disabling_tag=FORMATTER_OFF_TAG-->        <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>        <!--org.eclipse.jdt.core.formatter.enabling_tag=FORMATTER_ON_TAG-->        <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>        <!--下面的没有IDEA对应项,在代码里面对IDEA中使用默认值即可,LINE_COMMENT_AT_FIRST_COLUMN BLOCK_COMMENT_AT_FIRST_COLUMN设置为false-->        <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>        <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>        <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments"                 value="false"/>        <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>        <!--和IDEA保持一致,注释换行-->        <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>        <!--comment end-->        <!--org.eclipse.jdt.core.formatter.blank_lines_after_imports=Java:BLANK_LINES_AFTER_IMPORTS-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_before_imports=Java:BLANK_LINES_BEFORE_IMPORTS-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_after_package=Java:BLANK_LINES_AFTER_PACKAGE-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=Java:BLANK_LINES_AROUND_CLASS-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>        <!--org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=Java:BLANK_LINES_BEFORE_METHOD_BODY-->        <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_before_field=Java:BLANK_LINES_AROUND_FIELD-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_before_method=Java:BLANK_LINES_AROUND_METHOD-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>        <!--org.eclipse.jdt.core.formatter.blank_lines_before_package=Java:BLANK_LINES_BEFORE_PACKAGE-->        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>        <!--下面IDEA没有对应设置,使用对应值即可-->        <setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>        <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>        <!--org.eclipse.jdt.core.formatter.indentation.size=Java:IndentOptions:INDENT_SIZE-->        <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>        <!--org.eclipse.jdt.core.formatter.continuation_indentation=Java:IndentOptions:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>        <!--org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>        <!--org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=Java:IndentOptions:SMART_TABS-->        <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>        <!--org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=Java:INDENT_CASE_FROM_SWITCH-->        <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>        <!--KEEP_INDENTS_ON_EMPTY_LINES-->        <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>        <!--org.eclipse.jdt.core.formatter.tabulation.size=Java:IndentOptions:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>        <!--Java:IndentOptions:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>        <!--下面IDEA没有对应设置,使用对应值即可-->        <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"                 value="true"/>        <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"                 value="true"/>        <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"                 value="true"/>        <!--Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>        <!--下面没有对应的IDEA设置,Eclipse先使用对应值-->        <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"                 value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>        <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="16"/>        <!--IDEA默认配置在同一行,Eclipse使用对应值即可-->        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration"                 value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>        <!--Java:BINARY_OPERATION_SIGN_ON_NEXT_LINE-->        <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>        <!--ASSIGNMENT_WRAP 需要设置为 WRAP_AS_NEEDED  WRAP_AS_NEEDED . Add in jdt.core-3.12,it's not work in previous version -->        <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>        <!--IDEA无配置项,Eclipse使用对应值即可-->        <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>        <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>        <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>        <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>        <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>        <!--org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=Java:KEEP_CONTROL_STATEMENT_IN_ONE_LINE-->        <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>        <!--org.eclipse.jdt.core.formatter.compact_else_if=Java:SPECIAL_ELSE_IF_TREATMENT-->        <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>        <!--Java:ALIGN_GROUP_FIELD_DECLARATIONS-->        <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>        <!--Java:<Programmatic>-->        <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>        <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>        <!--统一为end_of_lint,IDEA默认一致-->        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"                 value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>        <!--        <setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>                <setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>                <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>                        <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>                                <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>                                        <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>                -->        <!--Java:KEEP_SIMPLE_BLOCKS_IN_ONE_LINE-->        <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>        <!--Java:CLASS_BRACE_STYLE,统一使用end_of_line TODO-->        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>        <!--org.eclipse.jdt.core.formatter.lineSplit=RIGHT_MARGIN-->        <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>    </profile></profiles>

读到这里,这篇“idea如何格式化代码”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注编程网行业资讯频道。

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

idea如何格式化代码

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

idea如何格式化代码

本文小编为大家详细介绍“idea如何格式化代码”,内容详细,步骤清晰,细节处理妥当,希望这篇“idea如何格式化代码”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。idea格式化代码的方法:1、直接使用快捷键“Ct
2023-07-05

怎么在IDEA中格式化SQL代码

怎么在IDEA中格式化SQL代码?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。1.1、建立连接,数据库服务器地址,账号,密码等…1.2、基本操作,很多,增删改查
2023-06-06

idea如何格式化json

要格式化JSON,可以使用Python的json库来实现。以下是一个例子:```pythonimport jsonjson_data = '{"name":"John", "age":30, "city":"New York"}'# 解析J
2023-09-01

pycharm如何格式化代码

pycharm格式化代码的方法:1、手动格式化,使用快捷键“Ctrl+Alt+L”来格式化当前文件中的代码;2、自定义代码风格规则,进入“Settings”选项,选择“Editor”,最后选“Code Style”;3、使用Python C
pycharm如何格式化代码
2023-12-09

怎么通过IDEA优化代码格式和风格

通过IDEA(IntelliJ IDEA)可以很方便地优化代码格式和风格。以下是一些常用的方法:使用代码格式化功能:IDEA提供了代码格式化功能,可以通过快捷键Ctrl + Alt + L(Windows)或Cmd + Alt + L(Ma
怎么通过IDEA优化代码格式和风格
2024-04-03

js如何格式化JSON代码

这篇文章将为大家详细讲解有关js如何格式化JSON代码,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。格式化 JSON 代码相信大家都使用过JSON.stringify方法,该方法可以将一个 JavaScr
2023-06-17

JavaScript如何格式化JSON代码

这篇文章主要为大家展示了“JavaScript如何格式化JSON代码”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“JavaScript如何格式化JSON代码”这篇文章吧。格式化JSON代码我们都
2023-06-27

Flex如何实现代码格式化

这篇文章将为大家详细讲解有关Flex如何实现代码格式化,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。Flex代码格式化在做Flex编码的时候,调整编码格式非常让人头疼,特别是有时候从其它文档中复制代码进来
2023-06-17

Go代码格式化gofmt如何使用

本篇内容介绍了“Go代码格式化gofmt如何使用”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!gofmt使用对于一门编程语言来说,代码格式化
2023-07-06

如何使用PyCharm进行代码格式化

PyCharm是一款强大的Python集成开发环境(IDE),其代码美化工具可以帮助开发者规范代码风格、优化代码结构,提高代码可读性。本文将介绍PyCharm代码美化工具的使用方法,并结合具体的代码示例进行详细说明。一、安装代码美化工具
如何使用PyCharm进行代码格式化
2024-02-25

如何使用Flex代码格式化工具

小编给大家分享一下如何使用Flex代码格式化工具,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!Flex代码格式化在做Flex编码的时候,调整编码格式非常让人头疼,
2023-06-17

js代码格式化工具eslint如何使用

这篇文章主要介绍“js代码格式化工具eslint如何使用”,在日常操作中,相信很多人在js代码格式化工具eslint如何使用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”js代码格式化工具eslint如何使用
2023-06-26

Dreamweaver代码的格式化功能掌控html代码的格式

今天偶然发现了Dreamweaver的一个非常有用的功能,就是代码的格式化功能。一般情况下,我们写的htm编程客栈l或编程客栈者css代码都计较混乱,难以阅读,即使刚开始很在意代码的可读性,但是等到所使用的标编程客栈签越来越多,嵌套越来越深
2022-06-12

如何使用Python 代码格式化工具 Black-Python

如何使用Python 代码格式化工具 Black-Python,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。Black 号称是不妥协的 Python 代码格式化工具。之所以
2023-06-02

PHPStorm如何实现自动执行代码格式化

这篇文章主要介绍了PHPStorm如何实现自动执行代码格式化的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇PHPStorm如何实现自动执行代码格式化文章都会有所收获,下面我们一起来看看吧。在我们日常开发中,一定
2023-07-04

Flex Builder 3代码格式化方

Flex Builder的最新版本已经到了4.5,可是代码格式化工具并没有集成在安装版本中,需要通过其他途径来实现。下面提供一个安装插件的方法实现Flex代码格式化:      1. 点击菜单中的 Help-> Software Updat
2023-01-31

如何用VBS写的VBSCRIPT代码格式化工具VbsBeautifier

这篇文章主要讲解了“如何用VBS写的VBSCRIPT代码格式化工具VbsBeautifier”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何用VBS写的VBSCRIPT代码格式化工具Vbs
2023-06-08

如何用VSCode的Format功能实现代码格式化

这篇文章主要介绍了如何用VSCode的Format功能实现代码格式化的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇如何用VSCode的Format功能实现代码格式化文章都会有所收获,下面我们一起来看看吧。近年开
2023-07-05

编程热搜

  • Python 学习之路 - Python
    一、安装Python34Windows在Python官网(https://www.python.org/downloads/)下载安装包并安装。Python的默认安装路径是:C:\Python34配置环境变量:【右键计算机】--》【属性】-
    Python 学习之路 - Python
  • chatgpt的中文全称是什么
    chatgpt的中文全称是生成型预训练变换模型。ChatGPT是什么ChatGPT是美国人工智能研究实验室OpenAI开发的一种全新聊天机器人模型,它能够通过学习和理解人类的语言来进行对话,还能根据聊天的上下文进行互动,并协助人类完成一系列
    chatgpt的中文全称是什么
  • C/C++中extern函数使用详解
  • C/C++可变参数的使用
    可变参数的使用方法远远不止以下几种,不过在C,C++中使用可变参数时要小心,在使用printf()等函数时传入的参数个数一定不能比前面的格式化字符串中的’%’符号个数少,否则会产生访问越界,运气不好的话还会导致程序崩溃
    C/C++可变参数的使用
  • css样式文件该放在哪里
  • php中数组下标必须是连续的吗
  • Python 3 教程
    Python 3 教程 Python 的 3.0 版本,常被称为 Python 3000,或简称 Py3k。相对于 Python 的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0 在设计的时候没有考虑向下兼容。 Python
    Python 3 教程
  • Python pip包管理
    一、前言    在Python中, 安装第三方模块是通过 setuptools 这个工具完成的。 Python有两个封装了 setuptools的包管理工具: easy_install  和  pip , 目前官方推荐使用 pip。    
    Python pip包管理
  • ubuntu如何重新编译内核
  • 改善Java代码之慎用java动态编译

目录