-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
This issue is relevant only for the command line tool (I'm using version 2.50.0
), the IntelliJ IDEA plugin of the same version works correctly.
When I'm using the console tool and formatting a file containing a text block wider than 120 characters and having a trailing triple-quote """
on the same line, the formatter fails:
public class Test {
public void doSomething() {
var string =
"""
aaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb cccccccccccccccc ddddddddddddddddd eeeeeeeeeeeeeeeeee fffffffffffffffff""";
}
}
The output I'm getting in the console:
./palantir-java-format -r --palantir ~/Test.java
/Users/ilya.borisenko/Test.java:error: Something has gone terribly wrong. Please file a bug: https://github.com/palantir/palantir-java-format/issues/new
=== Actual: ===
package com.fivetran.database.account;
public class Test {
public void doSomething() {
/*missing*/ string = "aaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb cccccccccccccccc ddddddddddddddddd\"\n + \" eeeeeeeeeeeeeeeeee fffffffffffffffff";
}
}
=== Expected: ===
package com.fivetran.database.account;
public class Test {
public void doSomething() {
/*missing*/ string = "aaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb cccccccccccccccc ddddddddddddddddd eeeeeeeeeeeeeeeeee fffffffffffffffff";
}
}
Moving the trailing triple-quote to a new line solves the problem, and the formatter doesn't fail if I define the string like this:
var string =
"""
aaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb cccccccccccccccc ddddddddddddddddd eeeeeeeeeeeeeeeeee fffffffffffffffff
""";
davo-canva, tobyh-canva, jdcaperon, Shingyx, kelvinou01 and 1 more
Metadata
Metadata
Assignees
Labels
No labels