Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to correctly create references for config documentation provider implementations #9523

Merged
merged 1 commit into from
Nov 21, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ public List<CmType> getTypes() {
public void setTypes(List<CmType> types) {
this.types = types;
}

@Override
public String toString() {
return module;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -205,10 +207,13 @@ public void process() {

// map of annotated types to documentation
Map<String, CmType> configuredTypes = new HashMap<>();
Set<String> allTypes = new HashSet<>();

for (CmModule module : allModules) {
for (CmType type : module.getTypes()) {
configuredTypes.put(type.getAnnotatedType(), type);
allTypes.add(type.getAnnotatedType());
allTypes.add(type.getType());
}
}

Expand All @@ -225,7 +230,7 @@ public void process() {

List<String> generatedFiles = new LinkedList<>();
for (CmModule module : allModules) {
moduleDocs(configuredTypes, typeTemplate, path, module, generatedFiles);
moduleDocs(allTypes, configuredTypes, typeTemplate, path, module, generatedFiles);
}

// sort alphabetically by page title
Expand Down Expand Up @@ -320,14 +325,15 @@ private static String title(String typeName) {
return title;
}

private static void moduleDocs(Map<String, CmType> configuredTypes,
private static void moduleDocs(Set<String> allTypes,
Map<String, CmType> configuredTypes,
Template template,
Path modulePath,
CmModule module,
List<String> generatedFiles) {
Function<String, Boolean> exists = type -> {
// 1: check if part of this processing
if (configuredTypes.containsKey(type)) {
if (allTypes.contains(type)) {
return true;
}
// 2: check if exists in target directory
Expand Down