[ADF-1769] Added JSDocs and methods and updated script (#2927)

This commit is contained in:
Andy Stark
2018-02-09 18:06:24 +00:00
committed by Eugenio Romano
parent 2bfed5818f
commit 76ad797488
16 changed files with 219 additions and 109 deletions

View File

@@ -27,7 +27,8 @@ var ParamData = /** @class */ (function () {
var sig = this.name;
if (this.optional)
sig += "?";
sig += ": " + this.type;
if (this.type)
sig += ": " + this.type;
if (this.initializer)
sig += " = " + this.initializer;
return sig;
@@ -134,6 +135,8 @@ var ServiceDocAutoContent = /** @class */ (function () {
var methData = new MethodData();
methData.name = memSymbol.getName();
var doc = ts.displayPartsToString(memSymbol.getDocumentationComment());
if (!doc)
console.log("Warning: Method " + classDec.name.escapedText + "." + methData.name + " is not documented");
methData.docText = doc.replace(/\r\n/g, " ");
var sig = checker.getSignatureFromDeclaration(method);
var returnType = sig.getReturnType();
@@ -143,9 +146,14 @@ var ServiceDocAutoContent = /** @class */ (function () {
for (var p = 0; p < params.length; p++) {
var pData = new ParamData();
pData.name = params[p].name.getText();
pData.type = params[p].type.getText();
if (params[p].type)
pData.type = params[p].type.getText();
else
pData.type = "";
var paramSymbol = checker.getSymbolAtLocation(params[p].name);
pData.docText = ts.displayPartsToString(paramSymbol.getDocumentationComment());
if (!pData.docText)
console.log("Warning: Parameter \"" + pData.name + "\" of " + classDec.name.escapedText + "." + methData.name + " is not documented");
pData.optional = params[p].questionToken ? true : false;
if (params[p].initializer) {
var initText = params[p].initializer.getText();