Skip to content

Commit 22c33d5

Browse files
committed
Handle Markdown in EnumDeclaration
This commit fixes the IOBE on formatting Markdown in Enum declaration part Fixes : #5032
1 parent 4ea0cd7 commit 22c33d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2014, 2025 Mateusz Matela and others.
2+
* Copyright (c) 2014, 2026 Mateusz Matela and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -164,7 +164,7 @@ public boolean visit(EnumDeclaration node) {
164164
for (int i = 0; i < enumConstants.size(); i++) {
165165
EnumConstantDeclaration declaration = enumConstants.get(i);
166166
if (declaration.getJavadoc() != null)
167-
this.tm.firstTokenIn(declaration, TokenNameCOMMENT_JAVADOC).breakBefore();
167+
this.tm.firstTokenIn(declaration, ANY).breakBefore();
168168
if (declaration.getAnonymousClassDeclaration() != null && i < enumConstants.size() - 1)
169169
this.tm.firstTokenAfter(declaration, TokenNameCOMMA).breakAfter();
170170
}

0 commit comments

Comments
 (0)