Skip to content

No linebreak at single variables #777

@koppor

Description

@koppor

This refs #626 (comment).

Prettier-Java 2.7.5

Input:

            git.remoteAdd()
               .setName(remoteName)
               .setUri(new URIish(headRepoCloneUrl))
               .call();

Output:

            git
                .remoteAdd()
                .setName(remoteName)
                .setUri(new URIish(headRepoCloneUrl))
                .call();

Expected behavior:

Dots are aligned - and first method call directly after variable.


Similar:

-                .filter(r -> r.getURIs().stream().anyMatch(uri -> uri.toString().contains("JabRef/jabref")))
+                .filter(r ->
+                    r
+                        .getURIs()
+                        .stream()
+                        .anyMatch(uri ->
+                            uri.toString().contains("JabRef/jabref")
+                        )
+                )

It should be r.getURIs() and then .stream() in the next line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions