jhipster / jhipster/prettier-java

Continuation Indent

Open
#429 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
120
Avg merge
1d 14h
Merged PRs (30d)
27

Description

**Prettier-Java ^0.8.0**

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

**Input:**

```java
// code snippet
public class Test {

public void testMethod(final String param1, final String param2) throws Exception {
throw new Exception("blah");
}

}
```

**Output:**

> Note that `throws` and `throw` appear at the same indentation.

```java
// code snippet
public class Test {

public void testMethod(final String param1, final String param2)
throws Exception {
throw new Exception("blah");
}
}
```

**Expected behavior:**

When `throws` is wrapped, it seems like it should be more clearly separated from code inside the method.

One option is to use one additional indentation any time a line is wrapped, but open to alternatives:
```
public class Test {

public void testMethod(final String param1, final String param2)
throws Exception {
throw new Exception("blah");
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.