简体   繁体   中英

How can I get JBoss Developer Studio to auto-indent line comments with command+/?

When I comment a line of code in JBoss Developer Studio with command+/ , it makes the comment left-aligned. Instead, I'd like the comment to follow the indentation size of my code block. How can I accomplish this?

Current

private static String transformSymbolicName(String unformatted) {
//  String formatted = unformatted.replace('-', '.').toLowerCase();
    return formatted;
}

Desired

private static String transformSymbolicName(String unformatted) {
    // String formatted = unformatted.replace('-', '.').toLowerCase();
    return formatted;
}

JBoss>首选项> Java>代码样式>格式化程序>注释

Tools: JBoss Developer Studio 8, JDK 1.7.0_80, macOS Sierra

Go to

  1. Window -> Preferences
  2. on the left unwrap Java -> Code Style, choose Formatter
  3. Click Edit...
  4. Go to Comments tab In General Settings block and remove tick for:

    a. Never indent line comments on first column

    b. Never indent block comments on first column

    You can see how it affects in the Preview window on the right

  5. Change profile name on the top and click Apply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM