Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Not formatting file on save in Intellij 2023.1

Đang mở
#929 11 bình luận 29 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện báo cáo với IntelliJ 2023.1, plugin google-java-format 1.16.0.1 và các save actions được liệt kê đã bật, sử dụng một tệp Java cần được định dạng. Kiểm tra hành vi save actions của plugin và các log hiện có; hoàn tất khi tệp được định dạng lại và các imports được tối ưu hóa lúc lưu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Java
Star
6.2k
Fork
936
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/google-java-format

Tất cả issue của google/google-java-format

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.