@@ -6836,32 +6836,17 @@ namespace ts {
6836
6836
const result: Signature[] = [];
6837
6837
for (let i = 0; i < symbol.declarations.length; i++) {
6838
6838
const node = symbol.declarations[i];
6839
- switch (node.kind) {
6840
- case SyntaxKind.FunctionType:
6841
- case SyntaxKind.ConstructorType:
6842
- case SyntaxKind.FunctionDeclaration:
6843
- case SyntaxKind.MethodDeclaration:
6844
- case SyntaxKind.MethodSignature:
6845
- case SyntaxKind.Constructor:
6846
- case SyntaxKind.CallSignature:
6847
- case SyntaxKind.ConstructSignature:
6848
- case SyntaxKind.IndexSignature:
6849
- case SyntaxKind.GetAccessor:
6850
- case SyntaxKind.SetAccessor:
6851
- case SyntaxKind.FunctionExpression:
6852
- case SyntaxKind.ArrowFunction:
6853
- case SyntaxKind.JSDocFunctionType:
6854
- // Don't include signature if node is the implementation of an overloaded function. A node is considered
6855
- // an implementation node if it has a body and the previous node is of the same kind and immediately
6856
- // precedes the implementation node (i.e. has the same parent and ends where the implementation starts).
6857
- if (i > 0 && (<FunctionLikeDeclaration>node).body) {
6858
- const previous = symbol.declarations[i - 1];
6859
- if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) {
6860
- break;
6861
- }
6862
- }
6863
- result.push(getSignatureFromDeclaration(<SignatureDeclaration>node));
6839
+ if (!isFunctionLike(node)) continue;
6840
+ // Don't include signature if node is the implementation of an overloaded function. A node is considered
6841
+ // an implementation node if it has a body and the previous node is of the same kind and immediately
6842
+ // precedes the implementation node (i.e. has the same parent and ends where the implementation starts).
6843
+ if (i > 0 && (node as FunctionLikeDeclaration).body) {
6844
+ const previous = symbol.declarations[i - 1];
6845
+ if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) {
6846
+ continue;
6847
+ }
6864
6848
}
6849
+ result.push(getSignatureFromDeclaration(node));
6865
6850
}
6866
6851
return result;
6867
6852
}
0 commit comments