Home > Software design >  How to disable comment formatting in VS Code?
How to disable comment formatting in VS Code?

Time:10-07

I have a Java file with multiline comments like below:

/** 
 *   original: 0, 2, 1, 4, 3, 5, 7, 6
 *   max:      0, 2, 2, 4, 4, 5, 7, 7
 *   sorted:   0, 1, 2, 3, 4, 5, 6, 7
 *   index:    0, 1, 2, 3, 4, 5, 6, 7
 * 
 *   The chunks are: 0 | 2, 1 | 4, 3 | 5 | 7, 6
 *   @param arr
 *   @return
 */

When I format the source code, it format the comments as below:

/**
 * original: 0, 2, 1, 4, 3, 5, 7, 6 max: 0, 2, 2, 4, 4, 5, 7, 7 sorted: 0, 1, 2,
 * 3, 4, 5, 6, 7 index: 0, 1, 2, 3, 4, 5, 6, 7
 * 
 * The chunks are: 0 | 2, 1 | 4, 3 | 5 | 7, 6
 * 
 * @param arr
 * @return
 */

Does anyone know how to disable formatting comments in VS Code? Thanks!

CodePudding user response:

I have no idea what plugin and/or formatter you're using, but this is for the most popular plugin from Red Hat

enter image description here

  • Related