Skip to content

Commit 450fbb5

Browse files
committed
make setFormatStructure force node position.
1 parent bae47cf commit 450fbb5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

core/src/main/java/net/j4c0b3y/api/config/StaticConfig.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,12 @@ private void step(String path) throws ReflectiveOperationException {
302302

303303
// Set the associated comment for the route's block if present.
304304
document.setComment(document.getBlock(route), field.getAnnotation(Comment.class));
305+
306+
// Ensure position is forced when structure formatting is enabled.
307+
if (handler.isFormatStructure()) {
308+
document.move(route, route);
309+
}
310+
305311
continue;
306312
}
307313

@@ -321,6 +327,12 @@ private void step(String path) throws ReflectiveOperationException {
321327
// If the section exists, and we shouldn't skip, set the comment and recurse.
322328
if (section != null) {
323329
document.setComment(section, member.getAnnotation(Comment.class));
330+
331+
// Ensure position is forced when structure formatting is enabled.
332+
if (handler.isFormatStructure()) {
333+
document.move(route, route);
334+
}
335+
324336
step(route);
325337
}
326338
}

0 commit comments

Comments
 (0)