Comment before // prettier-ignore on an expression fails with "Comment was not printed"
Maintainer thường phản hồi trong vòng 2 ngày
Một pull request liên quan đã được merge.
- #1109 của @jtkiesel — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
The issue provides two Java inputs that trigger the error, one in an array initializer and one in a conditional expression, but names no source files or tests. Start by locating the comment printing and prettier-ignore handling paths and run the relevant tests with these examples. Done means both comments are retained and the ignored expression stays unchanged without a “Comment was not printed” error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prettier-Java 2.11.0
Input:
class A {
Object[] a = {
// explain
// prettier-ignore
foo(1,
2),
};
}
class A {
Object f(boolean c) {
return c
? a()
: // prettier-ignore
// explain
b(1, 2);
}
}
Output:
[error] A.java: Error: Comment "// explain" was not printed. Please report this error!
(Same error for both inputs.)
Expected behavior: Both comments are kept, and the ignored expression is printed as-is. For the first input:
class A {
Object[] a = {
// explain
// prettier-ignore
foo(1,
2),
};
}
Note: This issue is similar to #1098, but that one is about @formatter:on and @formatter:off comments.
- Ngôn ngữ chính
- Java
- Star
- 1.2k
- Fork
- 123
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jhipster/prettier-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jhipster/prettier-java#1113 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
jhipster/prettier-java#1114 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Text block containing a comment-like line with " or \ fails with "Comment was not printed"Có thể đã có người làm @sean0407 đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
jhipster/prettier-java#1112 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
JEP 401 Support value keywordĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
jhipster/prettier-java#1031 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Adds needlessly parenthesesCó thể đã có người làm @braxtonzhangio đã nhận 74 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
jhipster/prettier-java#1001 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của jhipster/prettier-java
Issue tương tự
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitCó thể đã có người làm @MohabMohie đã nhận hôm nay. Đang mởagentic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug/错误
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FCL-Team/FoldCraftLauncher#1951 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
quarkusio/quarkus-agent-mcp#296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commons-app/apps-android-commons#7072 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
hypherionmc/sdlink#240 ·