From cc5dd5bf797dddb75304eedff9fd9aa61d39d7b1 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Jun 2016 13:22:15 -0700 Subject: [PATCH] Add comments --- src/services/services.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/services.ts b/src/services/services.ts index 7c743aa86de..fa4333b7492 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4164,12 +4164,15 @@ namespace ts { const argumentInfo = SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); if (argumentInfo) { + // Get string literal completions from specialized signatures of the target return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo); } else if (isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { + // Get all names of properties on the expression return getStringLiteralCompletionEntriesFromElementAccess(node.parent); } else { + // Otherwise, get the completions from the contextual type if one exists return getStringLiteralCompletionEntriesFromContextualType(node); } }