Skip to content

Commit

Permalink
Config Doc - Restore some backward compatibility
Browse files Browse the repository at this point in the history
Let's make sure the types are displayed even if we do not have a context
set.
  • Loading branch information
gsmet committed Sep 28, 2024
1 parent 5c98569 commit 474ed5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ private static Engine initializeQuteEngine(Formatter formatter, Format format, S
.resolveSync(ctx -> formatter.formatTypeDescription((ConfigProperty) ctx.getBase(),
(Context) ctx.evaluate(ctx.getParams().get(0)).toCompletableFuture().join()))
.build())
// deprecated, for backward compatibility
.addValueResolver(ValueResolver.builder()
.applyToBaseClass(ConfigProperty.class)
.applyToName("formatTypeDescription")
.applyToNoParameters()
.resolveSync(ctx -> formatter.formatTypeDescription((ConfigProperty) ctx.getBase(), null))
.build())
.addValueResolver(ValueResolver.builder()
.applyToBaseClass(ConfigProperty.class)
.applyToName("formatDescription")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ protected JavadocFormat javadocFormat() {
}

protected String moreInformationAboutType(Context context, String anchorRoot, String type) {
return String.format(MORE_INFO_ABOUT_TYPE_FORMAT, anchorRoot + "-" + context.summaryTableId(), type);
return String.format(MORE_INFO_ABOUT_TYPE_FORMAT, anchorRoot + "-" + (context != null ? context.summaryTableId() : ""),
type);
}

protected String tooltip(String value, String javadocDescription) {
Expand Down

0 comments on commit 474ed5f

Please sign in to comment.