Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Not formatting file on save in Intellij 2023.1

オープン
#929 コメント 11 件 リアクション 29 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java
領域
tooling

調査の方向性

まず、IntelliJ 2023.1、google-java-format plugin 1.16.0.1、および一覧にある save actions を有効にした状態で、フォーマットが必要な Java ファイルを使って報告内容を再現します。プラグインの save actions の動作と利用可能なログを確認します。保存時にファイルが再フォーマットされ、imports が最適化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

IntelliJ

My Java files are not being formatted on save, only when I do a reformat manually. I can see that the google-java-format plugin is running when I save the file (it is quickly showing in the status bar), but the file is not reformatted. I cannot find any logs on this.

My setup

  • Intellij 2023.1 (Build #IU-231.8109.175, built on March 28, 2023)
  • google-java-format plugin 1.16.0.1
  • Activated "Reformat code" and "Optimize imports" under settings -> Tools -> actions on save
    *I have imported the intellij-java-google-style file under settings -> code style -> Scheme.
  • Runtime version: 17.0.6+10-b829.5 aarch64
  • VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

I have setup custom VM options as follows

-Xmx3072m
-Dsplash=true
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
主要言語
Java
スター
6.2k
フォーク
936
平均マージ
6分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/google-java-format のほかの issue

google/google-java-format の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。