jhipster / jhipster/prettier-java

String concatenation formatting

Aperta
#532 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: enhancement :wrench:
Lingua principale
Java
Stelle
1.2k
Fork
120
Merge medio
1g 14h
PR unite (30g)
27

Descrizione

**Prettier-Java 1.6.1**

Related to https://github.com/jhipster/prettier-java/issues/77.
In this case we're getting compilable code, it's just sub-ideal.

```sh
# Options (if any):
--print-width 140
```

**Input:**
```java
PreparedStatement statement =
connection.prepareStatement(
"INSERT INTO noneofyourbusiness(" +
"field1," +
"field2," +
"field3," +
"field4) " +
"VALUES (?, ?, ?, ?)");
```

**Output:**

```java
PreparedStatement statement = connection.prepareStatement(
"INSERT INTO noneofyourbusiness(" + "field1," + "field2," + "field3," + "field4) " + "VALUES (?, ?, ?, ?)"
);
```

**Expected behavior:**
I see two options:
- do not join the lines if they contain string concatenation like this
- join, but make sure to get rid of all the concatenation

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the Input, Output, and Expected behavior examples in this issue, then locate the formatter entry point that handles Java string concatenation. Reproduce the case with print width 140 and make the output follow one of the two proposed behaviors: preserve the concatenated lines or remove the concatenation. Verify the resulting formatting against the example.

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

Valutazione

Stack tecnologico
java
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.