Skip to content

Commit

Permalink
Move documentation before release tag and deprecation (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Mar 15, 2024
1 parent a17478e commit ea953e1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ boolean writeShapeDocs(Shape shape, UnaryOperator<String> preprocessor) {
docs = docs.replace("{", "\\{")
.replace("}", "\\}");
docs = preprocessor.apply(docs);
docs = addReleaseTag(shape, docs);
if (shape.getTrait(DeprecatedTrait.class).isPresent()) {
DeprecatedTrait deprecatedTrait = shape.expectTrait(DeprecatedTrait.class);
String deprecationMessage = deprecatedTrait.getMessage()
.map(msg -> " " + msg)
.orElse("");
String deprecationString = "@deprecated" + deprecationMessage;
docs = deprecationString + "\n\n" + docs;
docs = docs + "\n" + deprecationString;
}
docs = addReleaseTag(shape, docs);
writeDocs(docs);
return true;
}).orElse(false);
Expand Down Expand Up @@ -248,9 +248,9 @@ private boolean isTargetDeprecated(Model model, MemberShape member) {

private String addReleaseTag(Shape shape, String docs) {
if (shape.getTrait(InternalTrait.class).isPresent()) {
docs = "@internal\n" + docs;
docs = docs + "\n@internal";
} else {
docs = "@public\n" + docs;
docs = docs + "\n@public";
}
return docs;
}
Expand Down

0 comments on commit ea953e1

Please sign in to comment.