Eclipse Linear Linear Packaging

When I run Formatter, it indentes string literals to the last line of the variable name, even if it exceeds the column guide, as shown in this screenshot:

Unwanted line break behavior

Ideally, I want all the lines to be wrapped like the first line ends, with just a few tabs (or, if possible, a single tab). I changed all the settings of the Formatter for assignment and binary expression, and this does not affect the behavior of the shell of the Formatter string.

Is there a way to get Eclipse to wrap strings like NetBeans or maybe with some plugin?

Here are my Formatter settings for Line Wrapping: enter image description here

+5
source share
1 answer

Plugins

has an extended and fixed word wrap mode.

  1. Eclipse Word-Wrap

Designed for word wrap and can do the job.

Customization

Here, how and where you do it in Eclipse: Preferences->Java->Code Style->Formatter , then click the Edit button and select the Comments tab. After that, in the same place you can select the Line Wrapping tab and the Indentation tab. You can also set tab margins and sizes in Preferences>General>Editors>Text Editors by editing Displayed Tab Width

I note that the version of Eclipse must be Eclipse Project Neon (4.6) M4 or higher, because Eclipse 4.6 appeared with some updated word wrapping out of the box.

+1
source

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


All Articles