Intellij code formatting, Java annotations on new lines

前端 未结 4 1007
清歌不尽
清歌不尽 2020-12-02 12:10

I\'m using IntelliJ 12 and It\'s putting my member variable annotations on the same line, which i hate! How do I setup the code formatter to keep annotations on separate li

4条回答
  •  广开言路
    2020-12-02 12:32

    I think all the above answers are correct but here is step by step for Mac users:

    1. Click on "IntelliJ IDEA"
    2. Click on "Preferences"
    3. Go "Code Style" on the left navigation window and you will see "Java" listed below it and Click on it !
    4. Look for the header tab "Wrapping and Braces" on the right side of Preferences window.
    5. At this point you want to look for the item called "Do not wrap after single annotation" under "Field annotations". click "ok" and you are done !

    enter image description here

提交回复
热议问题