Intellij code formatting, save / * package * / in the same line

In some cases, it makes sense to use package visibility for some methods.
By convention, we put / * package * / comment in place of the modifier so that it is clear that it is intentional:

/* package */ int getSpan() {  
    return mSpan; 
}

However, automatic formatting by IntelliJ continues to put this comment on a separate line ... only for the final methods: /.
Is there a way to configure formatting so that all occurrences of this comment remain on the same line?

+4
source share
1 answer

I had a similar problem in Intellij with my Scala code, where is the following:

import ExecutionContext.Implicits.global // TODO use own execution context

Formatted to:

import ExecutionContext.Implicits.global

// TODO use own execution context

I managed to stop this by noting Comment at first columnunder Keep when formatting:

enter image description here

0

Source: https://habr.com/ru/post/1599293/


All Articles