redhat-developer / redhat-developer/vscode-java
java formatter: unable to wrap/break long Strings
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 546
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
I come from Intellij idea and I'm used to break long lines with the formatter. I managed to export/import most of the settings, but I can not manage it that vscode breaks long String lines, splitting the Strings with "firstPart" + "secondPart".
These are my related settings in the codeFormatterSettings.json:
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="180"/>
<setting id="org.eclipse.jdt.core.formatter.formatter_wrap_long_strings" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_strings" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
Please ask if I should upload the whole file.
This is an example line of code:
String strSystemPrompt =
"You are a system that generates a concise and informative answer in less than 100 words for the given question, which is marked with QUESTION. Use the given search results marked with SEARCH RESULT as only knowledge base. Answer questions in the language of the question, i.e. german questions in german and only english questions in english.";
This is the expected output:
String strSystemPrompt =
"You are a system that generates a concise and informative answer in less than 100 words for the given question, which is marked with QUESTION. Use the given search" +
"results marked with SEARCH RESULT as only knowledge base. Answer questions in the language of the question, i.e. german questions in german and only english" +
"questions in english.";
Am I missing something, is it not supported, or is it a bug?
VSCode version 1.98.2
Java Language support:
Version
1.40.0
Last Updated
2025-03-06, 08:33:26
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện hành vi của formatter với các thiết lập được hiển thị trong codeFormatterSettings.json và ví dụ Java từ issue. Kiểm tra xem các tùy chọn về chuỗi dài và phép nối chuỗi được liệt kê có đến được formatter Java được VS Code extension sử dụng hay không. Được xem là hoàn tất khi các string literal Java dài được tách thành các chuỗi được nối như trong đầu ra dự kiến.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100