Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/printers/packages-and-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,23 @@ export default {
child.node.type === SyntaxType.Annotation ||
child.node.type === SyntaxType.MarkerAnnotation
) {
parts.push(print(child));
parts.push(print(child), hardline);
}
}, "namedChildren");

if (path.node.children.some(({ type }) => type === "open")) {
parts.push("open");
parts.push("open", " ");
}

parts.push(
"module",
path.call(print, "nameNode"),
path.call(print, "bodyNode")
join(" ", [
"module",
path.call(print, "nameNode"),
path.call(print, "bodyNode")
])
);

return join(" ", parts);
return parts;
},

module_body(path, print) {
Expand Down
13 changes: 11 additions & 2 deletions test/unit-test/modules/_input.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,14 @@
provides fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part with another , again,ano ;

provides model with another , again,ano,another , again,ano,another , again,ano,another , again,averyveryveryveryveryveryveryveryveryveryverylongname ;

}

}

@Annotation module m {
requires a;
}

@SuppressWarnings("x") // note
module m {
requires a;
}
10 changes: 10 additions & 0 deletions test/unit-test/modules/_output.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@
again,
averyveryveryveryveryveryveryveryveryveryverylongname;
}

@Annotation
module m {
requires a;
}

@SuppressWarnings("x") // note
module m {
requires a;
}
Loading