Skip to content

String concatenation is not indented #761

@boris-petrov

Description

@boris-petrov

Prettier-Java 2.7.3

Playground link

--print-width 140

Input:

public abstract class Foo implements MyInterface {
  @Override public String foo() {
	var a =
		b("long text text text text text text " + "text text text text text text" + "something", b);
  }
}

Output:

public abstract class Foo implements MyInterface {

	@Override
	public String foo() {
		var a = b(
			"long text text text text text text " +
			"text text text text text text" +
			"something",
			b
		);
	}
}

Expected behavior:

public abstract class Foo implements MyInterface {

	@Override
	public String foo() {
		var a = b(
			"long text text text text text text " +
				"text text text text text text" +
				"something",
			b
		);
	}
}

Prettier for JavaScript does that. I would expect Prettier for Java to do the same.

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