-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix column limit logic to work as expected with initializers (#138)
Method chains in initializers may once again be laid onto a single next line, if they are short enough. This fixes a regression from #123 (0.3.11) where the column limit for method chains would prevent us from attempting to put the initializer on the 2nd line first and see if that works.
- Loading branch information
1 parent
d9a0043
commit 15b46e4
Showing
7 changed files
with
36 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type: fix | ||
fix: | ||
description: 'Method chains in initializers may once again be laid onto a single | ||
next line, if they are short enough. This fixes a regression from #123 (0.3.11) | ||
where the column limit for method chains would prevent us from attempting to put | ||
the initializer on the 2nd line first and see if that works.' | ||
links: | ||
- https://github.com/palantir/palantir-java-format/pull/138 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...tir-java-format/src/test/resources/com/palantir/javaformat/java/testdata/B22610221.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...t/src/test/resources/com/palantir/javaformat/java/testdata/palantir-chain-next-line.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class PalantirChainNextLine { | ||
void foo() { | ||
Iterator<Map.Entry<ThingId, DelegateOtherThing>> delegateIterator = delegates | ||
.entrySet() | ||
.iterator(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
.../src/test/resources/com/palantir/javaformat/java/testdata/palantir-chain-next-line.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class PalantirChainNextLine { | ||
void foo() { | ||
Iterator<Map.Entry<ThingId, DelegateOtherThing>> delegateIterator = | ||
delegates.entrySet().iterator(); | ||
} | ||
} |