LoginSignup
6
4

More than 3 years have passed since last update.

Eclipseでフォーマット機能を指定箇所だけオフ

Posted at

Eclipse IDE for Enterprise Java Developers 2019-06 (4.12.0)で確認。

Window -> Preferences -> Java -> Code Style -> Formatter -> Edit -> Off/On Tagsを開いてEnable Off/On tagsにチェックを入れる。
eclipse-off-format.jpg

ソースコードで、フォーマットのOFF開始が//@formatter:off、ONで再開させるのに//@formatter:onを使用する。以下のような感じ。

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4