I make all according this question: Eclipse: Set maximum line length for auto formatting?.
my result:
I tryed to make own profile. profile was created:
before ctrl+shift+f :
after:
How to fix it?
To set the maximum line length in Eclipse, open Eclipse and in the menu bar, go to Window -> Preferences and in the pop-up window, go to Java -> Code Style -> Formatter. This will open up the Formatter options in the right window pane. Click on the Edit button to modify the current formatter profile.
Line length formatter setup is blocked for annotations (Eclipse Photon checked). Therefore it is needed in Line Wrapping -> Wrapping settings -> Annotations. Setup line wrapping as appropriate for you.
Field: "Maximum line width", Set the desired value (Default value set to 120) to increase/decrease the line length in the editor. Note: Remember to rename the Active profile to the name of your choice, as the default Eclipse profile won't accept your changes.
In the formatter profile pop-up window, click on the Line Wrapping tab. The width of the line can be set in field, Maximum line width. Changing any of the [built-in] profiles requires to save the changes as a custom profile.
Goto How to Change the Default Format Settings in Eclipse
Follow the steps to create a new profile. Step 11 [Line Wrapping] shows a 'Maximum line width' field, changing that would fix your issue.
Also, make sure your newly created profile is selected in the Active Profile drop-down inside Window -> Preferences -> Java -> Code Style -> Formatter.
If you are trying to format XML: Goto Window -> Preferences -> XML -> XML Files -> Editor and change Line width field.
right answer:
P.S. thanks Jon Skeet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With