Eclipse: Set maximum line length for auto formatting?

前端 未结 10 796
情歌与酒
情歌与酒 2020-12-04 04:22

I am working with Java. If I hit Ctrl+Shift+F in Eclipse Helios, it will auto format my code. At a certain point, it wraps lines. I would li

相关标签:
10条回答
  • 2020-12-04 05:20

    Line length formatter setup is blocked for annotations (Eclipse Photon checked). Therefore it is needed in Line Wrapping -> Wrapping settings -> Annotations. Setup line wrapping as appropriate for you. There is couple of possibilities, e.q. Enable wrap when necessary to use first icon list.

    0 讨论(0)
  • 2020-12-04 05:21

    Take a look of following image:

    Java->Code style->Formatter-> Edit
    

    enter image description here

    0 讨论(0)
  • 2020-12-04 05:22

    for XML line width, update preferences > XML > XML Files > Editor > Line width

    0 讨论(0)
  • 2020-12-04 05:22

    Preferences -> Java -> Code Style -> Formatter / "Edit..."

    Tabs: "Line wrapping" , "Comments"

    Field: "Maximum line width"

    Set both to make comments have the same length too. You might need to create a new profile if you don't have one already.

    0 讨论(0)
提交回复
热议问题