Eclipse默认自定义格式化程序 [英] Eclipse default custom formatter

查看:55
本文介绍了Eclipse默认自定义格式化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse使您能够自定义代码格式化程序并导出/导入它们.我有什么方法可以创建一个格式化程序,将其保存在源代码管理中,并在某个地方设置一个属性,该属性将在您打开项目时自动将其加载到Eclipse中?

Eclipse allows the ability for you to customize code formatters and export/import them. Is there a way for me to create a formatter, save it in source control, and set a property somewhere that will load that into eclipse automatically when you open the project?

我们要使用自定义格式化程序,但如果无法通过团队自动配置,则不要使用.我们不希望有人忘记导入格式化程序并最终用另一种设置来格式化代码.只能想象这会在将来产生一些不太有趣的冲突.

We want to use a custom formatter but not if it can't be configured automatically through the team. We don't want someone forget to import the formatter and end up formatting the code with another setup. Could only imagine that would create some not so fun conflicts down the road.

推荐答案

右键单击项目,选择属性",然后选择"Java-> Formatter",选中启用项目特定设置",然后配置格式化程序.想.然后,整个配置将保存在项目目录中,您可以轻松地将其置于版本控制下.

Right-click the project, choose "Properties", then "Java -> Formatter", check "enable project specific settings", and configure your formatter however you want. The entire configuration will then be saved in the project directory, which you can easily put under version control.

这篇关于Eclipse默认自定义格式化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆