Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuation Indent #429

Open
jmfee-usgs opened this issue Oct 2, 2020 · 1 comment · May be fixed by #591
Open

Continuation Indent #429

jmfee-usgs opened this issue Oct 2, 2020 · 1 comment · May be fixed by #591

Comments

@jmfee-usgs
Copy link

jmfee-usgs commented Oct 2, 2020

Prettier-Java ^0.8.0

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

Input:

// 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.

// 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");
  }
}
@jhaber
Copy link
Contributor

jhaber commented Oct 2, 2020

Some related discussion: #384 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants