Skip to content

Commit 6b7d3c4

Browse files
Function signatures consume wrong param comment, resolves #37
1 parent 33ae93b commit 6b7d3c4

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

bin/typedoc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ var TypeDoc;
20442044
var parent = state.parentState.reflection;
20452045
var reflection = new TypeDoc.Models.DeclarationReflection();
20462046
reflection.name = state.getReflectionName();
2047-
reflection.originalName = state.declaration.name;
2047+
reflection.originalName = state.getName();
20482048
reflection.parent = parent;
20492049

20502050
state.reflection = reflection;
@@ -2746,6 +2746,9 @@ var TypeDoc;
27462746
var name = '';
27472747
var target = reflection.parent;
27482748
push(reflection);
2749+
if (name == '') {
2750+
return;
2751+
}
27492752

27502753
while (target instanceof TypeDoc.Models.DeclarationReflection) {
27512754
if (target.comment) {

examples/basic/src/classes.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,21 @@ export class BaseClass implements INameInterface
122122
}
123123

124124

125+
/**
126+
* This is a simple fat arrow function.
127+
*
128+
* @param param1 The first parameter needed by this function.
129+
* @param param2 The second parameter needed by this function.
130+
* @see https://github.com/sebastian-lenz/typedoc/issues/37
131+
*/
132+
public arrowFunction = (param1: string, param2: number): void => {
133+
};
134+
135+
125136
/**
126137
* This is a private function.
127138
*/
128139
private checkName() {
129-
130140
}
131141

132142

src/typedoc/factories/Dispatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ module TypeDoc.Factories
285285
var parent = <Models.DeclarationReflection>state.parentState.reflection;
286286
var reflection = new Models.DeclarationReflection();
287287
reflection.name = state.getReflectionName();
288-
reflection.originalName = state.declaration.name;
288+
reflection.originalName = state.getName();
289289
reflection.parent = parent;
290290

291291
state.reflection = reflection;

src/typedoc/factories/handlers/DeepCommentHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ module TypeDoc.Factories
4242
var name = '';
4343
var target = <Models.DeclarationReflection>reflection.parent;
4444
push(reflection);
45+
if (name == '') {
46+
return;
47+
}
4548

4649
while (target instanceof Models.DeclarationReflection) {
4750
if (target.comment) {

0 commit comments

Comments
 (0)