fix(46563): show completions at this type (#46581)

This commit is contained in:
Oleksandr T
2021-12-03 14:29:45 -08:00
committed by GitHub
parent c5d9200ec6
commit 407edc95c0
9 changed files with 45 additions and 5 deletions
+1 -1
View File
@@ -264,7 +264,7 @@ namespace ts.Completions.StringCompletions {
checker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount);
const types = flatMap(candidates, candidate => {
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length) return;
const type = checker.getParameterType(candidate, argumentInfo.argumentIndex);
const type = candidate.getTypeParameterAtPosition(argumentInfo.argumentIndex);
isNewIdentifier = isNewIdentifier || !!(type.flags & TypeFlags.String);
return getStringLiteralTypes(type, uniques);
});