Skip to content

Continuation Indent #429

Description

@jmfee-usgs

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");
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions