Eclipse Code Formatter Plugin

妖精的绣舞 提交于 2019-12-05 17:02:37

Eclipse does have built in Java formatting:

Preferences > Java > Code Style > Formatter

For HTML, you might try something like HTML Tidy. The Web Tools Platform project also includes formatting.

Use Source -> Format or CTRL+SHIFT+F

It's a combination of all the answers above, which suits me-

  1. Go to Preferences > Java > Code Style > Formatter and set all the options you want by creating your own profile or using a default one. Personally I find the line-wrap limited to 80 a little too low. I set it to 200.
  2. Save the 'custom' preferences by giving it a new profile name (export it for future restoration)
  3. Select the code in your editor - then hit CTRL+SHIFT+F. That should format your code.

Worked wonders for me everytime.

Java code formatting is built in. Go to Window->Preferences->Java->Code Style->Formatter. There's a built in profile set up and you can make your own.

http://sourceforge.net/projects/jalopy/

Note that Jalopy has its settings under Window> Jalopy Preferences.

(This menu option appears only when all editor tabs are closed)

Eclipse doesn't have proper built-in code formatting. You might want to open your project in Idea IntelliJ or Netbeans and use their formatting to do a thorough job on it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!