jhipster / jhipster/prettier-java
Regression in 2.6.0
- Lingua principale
- Java
- Stelle
- 1.2k
- Fork
- 120
- Merge medio
- 1g 14h
- PR unite (30g)
- 27
Descrizione
**Prettier-Java 0.6.0**
```sh
# Options (if any):
--print-width 120
```
It looks like https://github.com/jhipster/prettier-java/pull/632 , despite being a great improvement overall, introduced a regression when the first method call needs to be multi-line due to long arguments, leading to a closing `)` misaligned.
**Input:**
```java
public static final MethodDescriptor NEW_TUNNEL_METHOD = MethodDescriptor
.newBuilder(ByteBufMarshaller.INSTANCE, ByteBufMarshaller.INSTANCE)
.setFullMethodName(TUNNEL_SERVICE + "/new")
.setType(MethodDescriptor.MethodType.BIDI_STREAMING)
.build();
```
**Output:**
```java
public static final MethodDescriptor NEW_TUNNEL_METHOD = MethodDescriptor.newBuilder(
ByteBufMarshaller.INSTANCE,
ByteBufMarshaller.INSTANCE
)
.setFullMethodName(TUNNEL_SERVICE + "/new")
.setType(MethodDescriptor.MethodType.BIDI_STREAMING)
.build();
```
**Expected behavior:**
```java
public static final MethodDescriptor NEW_TUNNEL_METHOD = MethodDescriptor
.newBuilder(ByteBufMarshaller.INSTANCE, ByteBufMarshaller.INSTANCE)
.setFullMethodName(TUNNEL_SERVICE + "/new")
.setType(MethodDescriptor.MethodType.BIDI_STREAMING)
.build();
```
**Alternative expected behavior:**
```java
public static final MethodDescriptor NEW_TUNNEL_METHOD = MethodDescriptor.newBuilder(
ByteBufMarshaller.INSTANCE,
ByteBufMarshaller.INSTANCE
)
.setFullMethodName(TUNNEL_SERVICE + "/new")
.setType(MethodDescriptor.MethodType.BIDI_STREAMING)
.build();
```
See https://github.com/bsideup/grpc-bidi/commit/bd351342e59ed4be2ad6f18e32f174978f0c7c02
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.