Eclipse Code Formatting Plugin

Can someone suggest me a plugin for formatting HTML and JAVA code with correct indentation, etc.? Is there a built-in option in Eclipse?

+4
source share
5 answers

Eclipse has built-in Java formatting:

Preferences > Java > Code Style > Formatter

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

+7
source

Use Source -> Format or CTRL + SHIFT + F

+9
source

This is a combination of all the answers above that suits me -

  • Go to Preferences > Java > Code Style > Formatter and set all the necessary parameters, creating your own profile or using the standard one. Personally, I think that linear transfer is limited to 80 too low. I set it to 200.
  • Save the "user" settings by specifying a new profile name (export it for further recovery)
  • Select the code in your editor, then press CTRL+SHIFT+F This should format your code.

Designed miracles for me every time.

+4
source

Formatting Java code is generated. Go to Window-> Preferences-> Java-> Code Style-> Formatter. There, the built-in profile is configured, and you can make your own.

+3
source

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

Note that Jalopy has its own settings in the Window> Jalopy Preferences menu.

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

Eclipse does not have proper built-in code formatting. You might want to open your project in Idea IntelliJ or Netbeans and use their formatting to complete the job.

+1
source

Source: https://habr.com/ru/post/1345727/


All Articles