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

Text block containing a comment-like line with " or \ fails with "Comment was not printed"

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

Maintainer thường phản hồi trong vòng 2 ngày

@sean0407 đang làm issue này rồi.

Từ ngày 20/10/2026.

  • #1116 của @sean0407 — đang mở

Đá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
66/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
tooling

Hướng nghiên cứu

Start by locating the formatter’s handling of Java text blocks and the tests for comment printing; the issue provides no file or test path. Reproduce with the supplied examples, including comment-like lines containing quotes or backslashes, and compare the formatted output. Done means these text block contents format without a “Comment was not printed” error and are not treated as Java comments.

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 {
  String s = """
    /* a "b" c */
    x""";
}

Output:

[error] A.java: Error: Comment "/* a "b" c */" was not printed. Please report this error!

Expected behavior:

class A {

  String s = """
  /* a "b" c */
  x""";
}

Text block content should never be treated as Java comments.


The same crash happens with a line comment or a backslash, as in these examples:

  String s = """
    // a "b
    x""";
  String s = """
    /* a \\n b */
    x""";
  String s = """
    // a \\ b
    x""";

A comment-like line without " or \, such as /* plain */, formats fine.

Ngôn ngữ chính
Java
Star
1.2k
Fork
122
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
35

Chuẩn bị môi trường

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 jhipster/prettier-java

Tất cả issue của jhipster/prettier-java

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.