Skip to content

Commit 36a61c3

Browse files
authored
docs(dotnet): ability to generate generics and null on path args (#5824)
1 parent ab4629a commit 36a61c3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

utils/doclint/generateDotnetApi.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ function renderMethod(member, parent, output, name) {
469469

470470
if (arg.type.expression === '[string]|[path]') {
471471
let argName = translateMemberName('argument', arg.name, null);
472-
pushArg("string", argName, arg);
473-
pushArg("string", `${argName}Path`, arg);
472+
pushArg("string", `${argName} = null`, arg);
473+
pushArg("string", `${argName}Path = null`, arg);
474474
if (arg.spec) {
475475
addParamsDoc(argName, XmlDoc.renderTextOnly(arg.spec, maxDocumentationColumnWidth));
476476
addParamsDoc(`${argName}Path`, [`Instead of specifying <paramref name="${argName}"/>, gives the file name to load from.`]);
@@ -691,6 +691,13 @@ function translateType(type, parent, generateNameCallback = t => t.name) {
691691
}
692692
}
693693

694+
if (type.templates) {
695+
// this should mean we have a generic type and we can translate that
696+
/** @type {string[]} */
697+
var types = type.templates.map(template => translateType(template, parent));
698+
return `${type.name}<${types.join(', ')}>`
699+
}
700+
694701
// there's a chance this is a name we've already seen before, so check
695702
// this is also where we map known types, like boolean -> bool, etc.
696703
let name = classNameMap.get(type.name) || type.name;

0 commit comments

Comments
 (0)