LoginSignup
0

More than 5 years have passed since last update.

IntelliJ IDEA で formatter:off が効かない時の対処法

Last updated at Posted at 2018-08-04

ある時、フォーマットかけたくない箇所に、
@formatter:off
と記載していたのですが、指定箇所のフォーマット機能が無効になっていなかったことがありました。

下記の方法で解決したので、備忘録がわりに記載。

Eclipse Code Formatter 未使用の場合は、原因は別になるので、
他の解決方法をご参考ください。


@formatter:offEclipse Code Formatter の影響で 効かない場合は、
{それぞれのリポジトリパス}/.settings/org.eclipse.jdt.core.prefs に下記を追記すると
@formatter:offが有効になります。

 org.eclipse.jdt.core.formatter.disabling_tag=@formatter:off
 org.eclipse.jdt.core.formatter.enabling_tag=@formatter:on
 org.eclipse.jdt.core.formatter.use_on_off_tags=true

EclipseCodeFormatter か どっかのGithubで Issue化されていたので、そのうち直るといいですね。

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
0