google / google/google-java-format

Bug: error when too long line before ending triple quotes

オープン
#969 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.2k
フォーク
937
平均マージ
6分
マージ済み PR(30日)
3

説明

I have a very simple example where google-java-format errors:

```
class Problem {
static String problematic() {
return """
A too long string directly before the ending triple quote seems to cause a problem with google java formatter""";
}
}
```

When I run the formatter on this file (using `java -jar /path/to/google-java-format-1.17.0-all-deps.jar /path/to/Problem.java`) I get the following error:

```
/path/to/Problem.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new

=== Actual: ===

class Problem {

static String problematic() {
return "A too long string directly before the ending triple quote seems to cause a problem\"\n + \" with google java formatter";
}
}
=== Expected: ===

class Problem {

static String problematic() {
return "A too long string directly before the ending triple quote seems to cause a problem with google java formatter";
}
}

```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。