From 93276aebb55037ecbb4f21a46999c4be9d6db099 Mon Sep 17 00:00:00 2001 From: Axetroy Date: Wed, 4 Jul 2018 02:08:08 +0800 Subject: [PATCH] feat: support paraterName for class constructor (#11) --- src/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service.ts b/src/service.ts index 7964271..b08bc92 100644 --- a/src/service.ts +++ b/src/service.ts @@ -122,7 +122,7 @@ function getDecorations( } else if (ts.isArrowFunction(node) && !node.type && context.configuration.features.functionReturnType) { const signature = typeChecker.getSignatureFromDeclaration(node); result.push(getDecoration(sourceFile!, typeChecker, configuration, node, node.equalsGreaterThanToken, signature && signature.getReturnType(), true)); - } else if (ts.isCallExpression(node) && node.arguments.length > 0 && context.configuration.features.parameterName) { + } else if ((ts.isCallExpression(node) || ts.isNewExpression(node)) && node.arguments && node.arguments.length > 0 && context.configuration.features.parameterName) { const resolvedSignature = typeChecker.getResolvedSignature(node); for (let i = 0; i < node.arguments.length; ++i) { const argument = node.arguments[i];