Skip to content

Commit 402845f

Browse files
author
benzhai
committed
fix bug.
1 parent 6ec7ffa commit 402845f

File tree

7 files changed

+76
-69
lines changed

7 files changed

+76
-69
lines changed

components/convert-component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class ConvertComponent extends ConverterComponent {
147147
case ReflectionKind.Property:
148148
case ReflectionKind.CallSignature:
149149
case ReflectionKind.EnumMember:
150-
case ReflectionKind.Constructor:
150+
151151
/**
152152
* Skip reflections with type @ReflectionKind.Function because they are aslo @ReflectionKInd.CallSignature
153153
* but the handling process here is not appropriate for them.
@@ -179,6 +179,7 @@ export class ConvertComponent extends ConverterComponent {
179179
break;
180180
case ReflectionKind.GetSignature:
181181
case ReflectionKind.SetSignature:
182+
case ReflectionKind.ConstructorSignature:
182183
const accessorName = reflection.parent.name;
183184
const accessorType = reflection.kind;
184185
const accessorData = this.getCommentInfo(reflection);

components/render-component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class RenderComponenet extends RendererComponent {
7777
case ReflectionKind.Property:
7878
case ReflectionKind.CallSignature:
7979
case ReflectionKind.EnumMember:
80-
case ReflectionKind.Constructor:
80+
8181
/**
8282
* Skip reflections with type @ReflectionKind.Function because they are aslo @ReflectionKInd.CallSignature
8383
* but the handling process here is not appropriate for them.
@@ -90,8 +90,7 @@ export class RenderComponenet extends RendererComponent {
9090
const parentName = parent.name;
9191
const attributeName = reflection.name;
9292
console.log(attributeName);
93-
if (ReflectionKind.Constructor === reflection.kind)
94-
debugger;
93+
//if (ReflectionKind.Constructor === reflection.kind)
9594

9695
const attributeData = this.getAttributeData(parentName, getAttributeType(reflection.kind), attributeName, reflection.flags.isStatic);
9796
if(attributeData) {
@@ -116,6 +115,7 @@ export class RenderComponenet extends RendererComponent {
116115
break;
117116
case ReflectionKind.GetSignature:
118117
case ReflectionKind.SetSignature:
118+
case ReflectionKind.ConstructorSignature:
119119
const accessorParent = this.getParentBasedOnType(reflection, reflection.kind);
120120
const accessor = reflection.parent;
121121
const accessorSignature = reflection.kind;
@@ -190,6 +190,7 @@ export class RenderComponenet extends RendererComponent {
190190
const paramFromJson = dataObj[Constants.COMMENT][Constants.PARAMS][param.name];
191191
if (paramFromJson) {
192192
param.comment.text = this.parser.joinByCharacter(paramFromJson[Constants.COMMENT].text, '\n');
193+
param.comment.shortText = this.parser.joinByCharacter(paramFromJson[Constants.COMMENT].shortText, '\n');
193194
return param;
194195
}
195196
});
@@ -203,6 +204,7 @@ export class RenderComponenet extends RendererComponent {
203204
*/
204205
private getParentBasedOnType(reflection, kind) {
205206
if (kind === ReflectionKind.CallSignature ||
207+
kind === ReflectionKind.ConstructorSignature ||
206208
kind === ReflectionKind.GetSignature ||
207209
kind === ReflectionKind.SetSignature) {
208210
return reflection.parent.parent;

package-lock.json

Lines changed: 60 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dist/"
1010
],
1111
"scripts": {
12-
"build": "tsc"
12+
"build": "tsc -w"
1313
},
1414
"repository": {
1515
"type": "git",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
"es2017",
88
"dom"
99
],
10+
"sourceMap": true,
1011
// "allowJs": true, /* Allow javascript files to be compiled. */
1112
// "checkJs": true, /* Report errors in .js files. */
1213
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
1314
// "declaration": true, /* Generates corresponding '.d.ts' file. */
1415
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
1516
// "sourceMap": true, /* Generates corresponding '.map' file. */
1617
// "outFile": "./", /* Concatenate and emit output to single file. */
17-
"outDir": "C:\\Repositories\\gctypedoc\\node_modules\\typedoc-plugin-localization2", /* Redirect output structure to the directory. */
18+
"outDir": "D:\\BitBucket\\gctypedoc\\node_modules\\typedoc-plugin-localization2", /* Redirect output structure to the directory. */
1819
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
1920
// "composite": true, /* Enable project compilation */
2021
// "removeComments": true, /* Do not emit comments to output. */

utils/enums/json-keys.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ export enum AttributeType {
88
getter = ReflectionKind.GetSignature,
99
setter = ReflectionKind.SetSignature,
1010
members = ReflectionKind.EnumMember,
11+
constructorSignature = ReflectionKind.ConstructorSignature
1112
}
1213

1314
export function getAttributeType(reflectionKind: ReflectionKind){
1415
if (reflectionKind === ReflectionKind.Constructor){
1516
return AttributeType[ReflectionKind.CallSignature];
1617
}
1718

19+
if(reflectionKind === ReflectionKind.ConstructorSignature) {
20+
return AttributeType[ReflectionKind.ConstructorSignature];
21+
}
22+
1823
return AttributeType[reflectionKind];
1924
}

0 commit comments

Comments
 (0)