docs(dotnet): ability to generate generics and null on path args (#5824)
This commit is contained in:
parent
ab4629af38
commit
36a61c36b3
|
|
@ -469,8 +469,8 @@ function renderMethod(member, parent, output, name) {
|
||||||
|
|
||||||
if (arg.type.expression === '[string]|[path]') {
|
if (arg.type.expression === '[string]|[path]') {
|
||||||
let argName = translateMemberName('argument', arg.name, null);
|
let argName = translateMemberName('argument', arg.name, null);
|
||||||
pushArg("string", argName, arg);
|
pushArg("string", `${argName} = null`, arg);
|
||||||
pushArg("string", `${argName}Path`, arg);
|
pushArg("string", `${argName}Path = null`, arg);
|
||||||
if (arg.spec) {
|
if (arg.spec) {
|
||||||
addParamsDoc(argName, XmlDoc.renderTextOnly(arg.spec, maxDocumentationColumnWidth));
|
addParamsDoc(argName, XmlDoc.renderTextOnly(arg.spec, maxDocumentationColumnWidth));
|
||||||
addParamsDoc(`${argName}Path`, [`Instead of specifying <paramref name="${argName}"/>, gives the file name to load from.`]);
|
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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type.templates) {
|
||||||
|
// this should mean we have a generic type and we can translate that
|
||||||
|
/** @type {string[]} */
|
||||||
|
var types = type.templates.map(template => translateType(template, parent));
|
||||||
|
return `${type.name}<${types.join(', ')}>`
|
||||||
|
}
|
||||||
|
|
||||||
// there's a chance this is a name we've already seen before, so check
|
// there's a chance this is a name we've already seen before, so check
|
||||||
// this is also where we map known types, like boolean -> bool, etc.
|
// this is also where we map known types, like boolean -> bool, etc.
|
||||||
let name = classNameMap.get(type.name) || type.name;
|
let name = classNameMap.get(type.name) || type.name;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue