Skip to content

Commit fa0521f

Browse files
committed
Add descriptive titles to parameter notes #37
Signed-off-by: Mārtiņš Avots <martins.avots@splitcells.net>
1 parent ec122df commit fa0521f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

projects/net.splitcells.gel.editor/src/main/java/net/splitcells/gel/editor/geal/runners/FunctionCallRunnerParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import static net.splitcells.dem.lang.namespace.NameSpaces.SEW;
2929
import static net.splitcells.dem.lang.tree.TreeI.tree;
30+
import static net.splitcells.dem.utils.StringUtils.intToOrdinal;
3031

3132
public class FunctionCallRunnerParser<T> {
3233
public static <R> FunctionCallRunnerParser<R> functionCallRunnerParser(String argName
@@ -58,8 +59,9 @@ public Tree document(Editor context) {
5859
try (val fcr = context.functionCallRecord(null, null, name, variation, true)) {
5960
parser.apply(fcr);
6061
val functionCallDoc = tree("chapter", SEW);
61-
functionCallDoc.withChild(tree("title", SEW).withText(fcr.getName() + " " + fcr.getVariation()));
62+
functionCallDoc.withChild(tree("title", SEW).withText(intToOrdinal(fcr.getVariation()) + " " + fcr.getName()));
6263
val list = tree("list", SEW).withParent(functionCallDoc);
64+
list.withProperty("name", "Parameter Rules:");
6365
if (fcr.getRequireSubjectAbsent()) {
6466
list.withChild(tree("item", SEW).withText("No Subject"));
6567
} else if (fcr.getRequiredSubjectTypes().size() == 1) {
@@ -83,6 +85,7 @@ public Tree document(Editor context) {
8385
tree("list", SEW).withParent(functionCallDoc).withText("Only attribute references are allowed as arguments.");
8486
} else {
8587
val arguments = tree("list", SEW).withParent(functionCallDoc);
88+
arguments.withProperty("name", "Parameters:");
8689
fcr.argumentIndexes().forEach(i -> {
8790
final String validValues;
8891
final String validValuesDesc;

0 commit comments

Comments
 (0)