Skip to content

Commit

Permalink
fix(app): rawDescription for JSDoc and visitEnumTypeAliasFunctionDecl…
Browse files Browse the repository at this point in the history
…arationDescription
  • Loading branch information
vogloblinsky committed Jul 14, 2021
1 parent a888f25 commit 47fe06d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
6 changes: 6 additions & 0 deletions src/app/compiler/angular-dependencies.ts
Expand Up @@ -602,7 +602,9 @@ export class AngularDependencies extends FrameworkDependencies {
this.visitEnumTypeAliasFunctionDeclarationDescription(node),
file: file
};

if (!isIgnore(node)) {
this.debug(enumDeps);
outputSymbols.miscellaneous.enumerations.push(enumDeps);
}
} else if (ts.isTypeAliasDeclaration(node)) {
Expand Down Expand Up @@ -766,6 +768,7 @@ export class AngularDependencies extends FrameworkDependencies {
RouterParserUtil.addModule(name, [routingInitializer]);
}
if (!isIgnore(node)) {
this.debug(deps);
outputSymbols.miscellaneous.variables.push(deps);
}
}
Expand Down Expand Up @@ -795,6 +798,7 @@ export class AngularDependencies extends FrameworkDependencies {
deps.rawtype = srcFile.text.substring(node.type.pos, node.type.end);
}
if (!isIgnore(node)) {
this.debug(deps);
outputSymbols.miscellaneous.typealiases.push(deps);
}
}
Expand Down Expand Up @@ -828,6 +832,7 @@ export class AngularDependencies extends FrameworkDependencies {
Configuration.mainData.disablePrivate
)
) {
this.debug(functionDep);
outputSymbols.miscellaneous.functions.push(functionDep);
}
}
Expand All @@ -849,6 +854,7 @@ export class AngularDependencies extends FrameworkDependencies {
file: file
};
if (!isIgnore(node)) {
this.debug(enumDeps);
outputSymbols.miscellaneous.enumerations.push(enumDeps);
}
}
Expand Down
39 changes: 24 additions & 15 deletions src/utils/jsdoc-parser.util.ts
Expand Up @@ -246,25 +246,34 @@ export class JsdocParserUtil {
}

public parseJSDocNode(node): string {
const len = node.jsDoc[0].comment.length;
let rawDescription = '';

for (let i = 0; i < len; i++) {
const JSDocNode = node.jsDoc[0].comment[i];
switch (JSDocNode.kind) {
case SyntaxKind.JSDocText:
rawDescription += JSDocNode.text;
break;
case SyntaxKind.JSDocLink:
if (JSDocNode.name) {
rawDescription +=
JSDocNode.text + '{@link ' + JSDocNode.name.escapedText + '}';
}
break;
default:
break;
if (typeof node.jsDoc[0].comment === 'string') {
rawDescription += node.jsDoc[0].comment;
} else {
const len = node.jsDoc[0].comment.length;

for (let i = 0; i < len; i++) {
const JSDocNode = node.jsDoc[0].comment[i];
switch (JSDocNode.kind) {
case SyntaxKind.JSDocComment:
rawDescription += JSDocNode.comment;
break;
case SyntaxKind.JSDocText:
rawDescription += JSDocNode.text;
break;
case SyntaxKind.JSDocLink:
if (JSDocNode.name) {
rawDescription +=
JSDocNode.text + '{@link ' + JSDocNode.name.escapedText + '}';
}
break;
default:
break;
}
}
}

return rawDescription;
}
}

0 comments on commit 47fe06d

Please sign in to comment.