google / google/google-java-format

Error formatting long string literal that contains "...\\t"

Đang mở
#1,186 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
6.2k
Fork
937
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
3

Mô tả

In version n1.24.0 of google-java-format_windows-x86-64.exe a long string literal that contains two backslashes followed by 't' results in an error.

Negative example:
```Java
String t =
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\\t";
```

Tool invocation and error message:
```
$ google-java-format_windows-x86-64.exe -r --skip-removing-unused-imports test\Test.java
Test.java:29:7: error: unclosed string literal
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\\t";
```

Positive example. This can be formatted.
```Java
String s = "01234567890123456789012345678901234567890123456789\\t";
```

Update: Using parameter `--skip-reflowing-long-strings` avoids this error!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.