palantir-java-format icon indicating copy to clipboard operation
palantir-java-format copied to clipboard

Wrong indentation formatting multiple long method param annotations

Open fawind opened this issue 2 years ago • 1 comments

What happened?

When formatting the following snippet, the method parameter annotations are not aligned. I.e. this is the formatting output using version 2.26.0:

interface MyClass {

    MyCustomReturnType getReturnType(
            @Nullable
                    @DoNotLog
                    @Request.Header(value = HttpHeaders.AUTHORIZATION, encoder = AuthHeaderParamEncoder.class)
                    AuthHeader authHeader);
}

What did you want to happen?

When breaking multiple param annotations into one line each, I would expect all annotations to have the same indentation level.

fawind avatar Sep 27 '22 10:09 fawind

this was apparently intentional in google-java-format https://github.com/google/google-java-format/issues/103

sparecycles avatar Feb 20 '24 21:02 sparecycles