Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,112 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sean0407 ci sta già lavorando.

Dal 20/10/2026.

  • #1116 di @sean0407 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
1.2k
Fork
123
Merge medio
2g 10h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jhipster/prettier-java

Tutte le issue di jhipster/prettier-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.