Skip to content

Commit

Permalink
Config Doc - Expand enums even if tooltip is not supported
Browse files Browse the repository at this point in the history
This was an oversight.

Fixes #43307
  • Loading branch information
gsmet committed Oct 1, 2024
1 parent 7aa6f66 commit 7851e56
Showing 1 changed file with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,26 @@ public String formatDescription(ConfigProperty configProperty) {
public String formatTypeDescription(ConfigProperty configProperty, Context context) {
String typeContent = "";

if (configProperty.isEnum() && enableEnumTooltips) {
typeContent = configProperty.getEnumAcceptedValues().values().entrySet().stream()
.map(e -> {
Optional<JavadocElement> javadocElement = javadocRepository.getElement(configProperty.getType(),
e.getKey());
if (javadocElement.isEmpty()) {
return "`" + e.getValue().configValue() + "`";
}

return tooltip(e.getValue().configValue(), JavadocTransformer
.transform(javadocElement.get().description(), javadocElement.get().format(), javadocFormat()));
})
.collect(Collectors.joining(", "));
if (configProperty.isEnum()) {
if (enableEnumTooltips) {
typeContent = configProperty.getEnumAcceptedValues().values().entrySet().stream()
.map(e -> {
Optional<JavadocElement> javadocElement = javadocRepository.getElement(configProperty.getType(),
e.getKey());
if (javadocElement.isEmpty()) {
return "`" + e.getValue().configValue() + "`";
}

return tooltip(e.getValue().configValue(), JavadocTransformer
.transform(javadocElement.get().description(), javadocElement.get().format(),
javadocFormat()));
})
.collect(Collectors.joining(", "));
} else {
typeContent = configProperty.getEnumAcceptedValues().values().values().stream()
.map(v -> v.configValue())
.collect(Collectors.joining("`, `", "`", "`"));
}
} else {
typeContent = configProperty.getTypeDescription();
if (configProperty.getJavadocSiteLink() != null) {
Expand Down

0 comments on commit 7851e56

Please sign in to comment.