Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit fe34175

Browse files
Merge pull request #14 from Salling-Group/annotations-options
Pass options to annotations visitor
2 parents 6df5f8b + 2d12734 commit fe34175

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3873,7 +3873,11 @@ private static Direction canLocalHaveHorizontalAnnotations(ModifiersTree modifie
38733873
* Should a field with a set of modifiers be declared with horizontal annotations? This is
38743874
* currently true if all annotations are parameterless annotations.
38753875
*/
3876-
private static Direction fieldAnnotationDirection(ModifiersTree modifiers) {
3876+
private Direction fieldAnnotationDirection(ModifiersTree modifiers) {
3877+
if (options.alwaysStackFieldAnnotations()) {
3878+
return Direction.VERTICAL;
3879+
}
3880+
38773881
for (AnnotationTree annotation : modifiers.getAnnotations()) {
38783882
if (!annotation.getArguments().isEmpty()) {
38793883
return Direction.VERTICAL;

0 commit comments

Comments
 (0)