redhat-developer / redhat-developer/vscode-java

Code formatter does not support additive operator preferences

Đang mở
#931 8 bình luận 0 reaction 1 người được giao Xem trên GitHub

@snjeza đang làm issue này rồi.

Từ ngày 21/5/2019.

bug formatter
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ả

Eclipse code formatting supports a setting that wraps lines after the string concatenation operator (+), along with column formatting that aligns text with one element per line:

public enum SqlQuery {
    createChatSchema( "CREATE SCHEMA IF NOT EXISTS chat;" +
                      "ALTER SCHEMA chat" +
                      "    OWNER TO postgres;" +
                      "CREATE TABLE IF NOT EXISTS chat.messages_as_json" +
                      " (id BIGSERIAL PRIMARY KEY, message JSON NOT NULL);" ),
    // leaving out constructor, etc.
}
Environment

Version: 1.34.0 (user setup)
Commit: a622c65b2c713c890fcf4fbf07cf34049d5fe758
Date: 2019-05-15T21:59:37.030Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.18898

Java extension version: 0.7.1

Steps To Reproduce
  1. Export eclipse code style with:
  • string concatenation wrap after operator
  • wrap all elements, one per line
  1. export settings from eclipse
  2. set vscode url to point at the exported settings
  3. create a type that defines a String that includes wrapping.
  4. auto format the file
Current Result
public enum SqlQuery {
    createChatSchema("CREATE SCHEMA IF NOT EXISTS chat;" + "ALTER SCHEMA chat" + "    OWNER TO postgres;"
            + "CREATE TABLE IF NOT EXISTS chat.messages_as_json"
            + " (id BIGSERIAL PRIMARY KEY, message JSON NOT NULL);"),
Expected Result
public enum SqlQuery {
    createChatSchema( "CREATE SCHEMA IF NOT EXISTS chat;" +
                      "ALTER SCHEMA chat" +
                      "    OWNER TO postgres;" +
                      "CREATE TABLE IF NOT EXISTS chat.messages_as_json" +
                      " (id BIGSERIAL PRIMARY KEY, message JSON NOT NULL);" ),
    // leaving out constructor, etc.
}

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đá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.