Input and Ouput (see bad specifically):
class SomeClass {
void doSomething() {
// bad
var test = """
line 1
line 2
""".formatted(
1,
"some text long enough to cause a wrap of these arguments",
2,
3
);
// good
var test = """
line 1
line 2
"""
.formatted(
1,
"some text long enough to cause a wrap of these arguments",
2,
3
)
.formatted(5);
// good
System.out.println(
"""
line 1
line 2
""".formatted(
1,
"some text long enough to cause a wrap of these arguments",
2,
3
)
);
}
}
Expected Output (see bad specifically):
class SomeClass {
void doSomething() {
// bad
var test = """
line 1
line 2
""".formatted(
1,
"some text long enough to cause a wrap of these arguments",
2,
3
);
// good
var test = """
line 1
line 2
"""
.formatted(
1,
"some text long enough to cause a wrap of these arguments",
2,
3
)
.formatted(5);
// good
System.out.println(
"""
line 1
line 2
""".formatted(
1,
"some text long enough to cause a wrap of these arguments",
2,
3
)
);
}
}
This seems to be limited to situations where there is a text block, with a single, unchained method called on it, having wrapped arguments, which is then used in assignment.
Input and Ouput (see
badspecifically):Expected Output (see
badspecifically):This seems to be limited to situations where there is a text block, with a single, unchained method called on it, having wrapped arguments, which is then used in assignment.