[JAVA] Turn off the format function only in the specified part in Eclipse

Confirmed with Eclipse IDE for Enterprise Java Developers 2019-06 (4.12.0).

Open Window-> Preferences-> Java-> Code Style-> Formatter-> Edit-> Off / On Tags and check Enable Off / On tags. eclipse-off-format.jpg

In the source code, use `// @ formatter: off``` to start the format OFF and use `//@ formatter: on``` to restart it with ON. It looks like the following.

//@formatter:off
list
  .stream()
  .filter(s -> s.endsWith(".txt"))
  .map(s -> NumberUtils.toInt(s))
  .collect(Collectors.toList());
//@formatter:on

Recommended Posts

Turn off the format function only in the specified part in Eclipse
Install the plugin in Eclipse
Like function The part that is stuck in making it asynchronous
Qualify only part of the text
Use the Findbugs plugin in Eclipse